{
 "openapi": "3.1.1",
 "info": {
  "title": "Youniton API",
  "version": "1.0.0-baseline",
  "description": "Assembled from the specifications' OpenAPI fragments (docs/specs). Generated — do not edit; change the fragments and run `make openapi-assemble` (05-api.md §2)."
 },
 "servers": [
  {
   "url": "/api/v1",
   "description": "app.<apex> — the tenant API"
  }
 ],
 "security": [
  {
   "spaSession": []
  },
  {
   "personalAccessToken": []
  }
 ],
 "paths": {
  "/acceptance-criteria/{criterionId}": {
   "patch": {
    "operationId": "editAcceptanceCriterion",
    "summary": "Change the text of a criterion",
    "x-feature": "F-WRK-39",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/AcceptanceCriterionIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AcceptanceCriterionPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The criterion. `ETag` is its version.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AcceptanceCriterionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeAcceptanceCriterion",
    "summary": "Remove a criterion",
    "x-feature": "F-WRK-39",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AcceptanceCriterionIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Removed. The rows after it moved up one place."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/acceptance-criteria/{criterionId}/met": {
   "put": {
    "operationId": "setAcceptanceCriterionMet",
    "summary": "Tick or untick a criterion",
    "x-feature": "F-WRK-39",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AcceptanceCriterionIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AcceptanceCriterionMetRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The criterion. A tick of a met criterion keeps the first tick.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AcceptanceCriterionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/acceptance-criteria/{criterionId}/position": {
   "put": {
    "operationId": "moveAcceptanceCriterion",
    "summary": "Move a criterion after another criterion, or to the top",
    "x-feature": "F-WRK-39",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AcceptanceCriterionIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AcceptanceCriterionPositionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The criterion at its new place.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AcceptanceCriterionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/access-extensions/{extensionId}": {
   "patch": {
    "operationId": "changeAccessExtension",
    "summary": "Change an extension's grant, projects, reason or expiry",
    "x-feature": "F-ACC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "extensionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccessExtensionPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed extension.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccessExtensionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "revokeAccessExtension",
    "summary": "Revoke an extension at once",
    "x-feature": "F-ACC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "extensionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Revoked; the member's next request no longer includes it."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/access/schema": {
   "get": {
    "operationId": "getAccessSchema",
    "summary": "The rule registry of the current grammar version for the role editor",
    "x-feature": "F-ACC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Attributes, operators, capabilities, fields, scopes, levels, templates, limits and the tenant's custom fields.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccessSchemaView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/account-recovery-notices/{requestId}": {
   "get": {
    "operationId": "getAccountRecoveryNotice",
    "summary": "A tenant Admin's view of a recovery that concerns a member of the tenant",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "responses": {
     "200": {
      "description": "The member (id in this tenant, name, e-mail), the initiator kind, the state, the request time and the earliest completion; never evidence.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "memberId",
            "memberName",
            "memberEmail",
            "initiatorKind",
            "state",
            "requestedAt"
           ],
           "properties": {
            "memberId": {
             "$ref": "#/components/schemas/Uuid",
             "description": "The member's id in this tenant (XM-1028); never the account id or another tenant's member id."
            },
            "memberName": {
             "$ref": "#/components/schemas/PersonName"
            },
            "memberEmail": {
             "type": "string",
             "format": "email",
             "maxLength": 254,
             "description": "The member's sign-in e-mail address (XM-1028), the address the tenant's member directory shows."
            },
            "requestedAt": {
             "$ref": "#/components/schemas/Instant",
             "description": "When the recovery request was opened (XM-1028)."
            },
            "initiatorKind": {
             "type": "string",
             "enum": [
              "self",
              "tenant_admin",
              "operator"
             ]
            },
            "state": {
             "type": "string",
             "enum": [
              "requested",
              "approved",
              "held",
              "completed",
              "cancelled",
              "rejected",
              "expired"
             ]
            },
            "completesAt": {
             "$ref": "#/components/schemas/Instant"
            },
            "objectedByThisTenant": {
             "type": "boolean"
            },
            "attestedByThisTenant": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/account-recovery-notices/{requestId}/attest": {
   "post": {
    "operationId": "attestAccountRecovery",
    "summary": "A tenant Admin attests the member's identity (supporting evidence only)",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountRecoveryNoticeAct"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Attestation recorded as T1 evidence."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/account-recovery-notices/{requestId}/object": {
   "post": {
    "operationId": "objectToAccountRecovery",
    "summary": "A tenant Admin objects; an approved request is held for review",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountRecoveryNoticeAct"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Objection recorded."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities": {
   "get": {
    "operationId": "listAgentIdentities",
    "summary": "The tenant's agent identities (an Admin) or the caller's own identities (a member)",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/AgentIdentityState"
      }
     },
     {
      "name": "ownerMemberId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50 identities, by name.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AgentIdentityView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createAgentIdentity",
    "summary": "Create an agent, service or meeting-assistant identity",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AgentIdentityInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The identity, without tokens.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIdentityView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}": {
   "get": {
    "operationId": "getAgentIdentity",
    "summary": "One identity with its tokens and its usage of the last 30 days",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The identity.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIdentityView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeAgentIdentity",
    "summary": "Change an identity's name, projects, abilities, actions, approvers, write mode, limits or ranges",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/AgentIdentityPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed identity.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIdentityView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/pause": {
   "post": {
    "operationId": "pauseAgentIdentity",
    "summary": "Stop every call of the identity until it is resumed",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The paused identity.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIdentityView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/resume": {
   "post": {
    "operationId": "resumeAgentIdentity",
    "summary": "Let a paused identity act again",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The active identity.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIdentityView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/retract-items": {
   "post": {
    "operationId": "retractAgentItems",
    "summary": "Retract every item that the identity wrote in a time window (a long-running operation)",
    "x-feature": "F-MEM-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AgentItemsRetractRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The operation; its result holds the count of retracted items.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/revoke": {
   "post": {
    "operationId": "revokeAgentIdentity",
    "summary": "Revoke the identity and all its tokens; terminal",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The revoked identity.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIdentityView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/tokens": {
   "post": {
    "operationId": "issueAgentToken",
    "summary": "Issue the identity's token; the secret is shown once",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AgentTokenIssueRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The token view and, only in this answer, the plaintext secret.",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string",
         "enum": [
          "no-store"
         ]
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIssuedToken"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/tokens/rotate": {
   "post": {
    "operationId": "rotateAgentToken",
    "summary": "Issue a new token and keep the old one for the overlap",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AgentTokenIssueRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new token view and its secret, once; the old token's overlapEndsAt is set.",
      "headers": {
       "Cache-Control": {
        "schema": {
         "type": "string",
         "enum": [
          "no-store"
         ]
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIssuedToken"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/tokens/{tokenId}": {
   "delete": {
    "operationId": "revokeAgentToken",
    "summary": "Revoke one token of the identity at once",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     },
     {
      "name": "tokenId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The token is gone (also when it was gone before)."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent-identities/{identityId}/transfer": {
   "post": {
    "operationId": "transferAgentIdentity",
    "summary": "Give the identity to a new owner (an Admin); it comes back paused",
    "x-feature": "F-MEM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/AgentIdentityIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AgentIdentityTransferRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The transferred identity, paused.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentIdentityView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/actions": {
   "post": {
    "operationId": "proposeAgentAction",
    "summary": "Propose a ticket change for a person's exact approval; nothing changes before it",
    "x-feature": "F-AST-19",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AgentActionRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The pending proposal, with the link that a reviewer opens.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentActionView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/actions/{proposalId}": {
   "get": {
    "operationId": "getAgentAction",
    "summary": "The state of the identity's proposal and, after execution, its results",
    "x-feature": "F-AST-19",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "name": "proposalId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The proposal's state.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentActionView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-pages/{pageId}": {
   "get": {
    "operationId": "getAgentDocPage",
    "summary": "One page as Markdown — the published revision, or the head for an identity that may write it",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "name": "source",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "published_revision",
        "head"
       ],
       "default": "published_revision"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocMarkdownView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-pages/{pageId}/body": {
   "put": {
    "operationId": "writeAgentDocPageBody",
    "summary": "Replace a page's body from a named base — written at once or proposed, by the write mode",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocBodyWriteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The outcome.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocBodyWriteResult"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-pages/{pageId}/comments": {
   "post": {
    "operationId": "postAgentDocComment",
    "summary": "Open a page-level thread as the identity",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocCommentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new thread.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocThreadView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-pages/{pageId}/publish-proposals": {
   "post": {
    "operationId": "proposeAgentDocPublication",
    "summary": "Propose the publication of an exact version for a person's approval",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPublishProposalRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The proposal waiting for approval.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPublishProposalView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-search": {
   "get": {
    "operationId": "searchAgentDocs",
    "summary": "Search the pages the identity may read",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "spaceId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of hits.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/DocSearchHit"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-spaces": {
   "get": {
    "operationId": "listAgentDocSpaces",
    "summary": "The spaces the identity may read",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of spaces.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocSpaceRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-spaces/{spaceId}/page-index": {
   "get": {
    "operationId": "listAgentDocSpacePageIndex",
    "summary": "The pages of one space that the identity may read, in tree order",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of the index.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/DocSpacePageIndexItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/doc-spaces/{spaceId}/pages": {
   "post": {
    "operationId": "createAgentDocPage",
    "summary": "Create a page from Markdown or rich text — written at once or proposed, by the write mode",
    "x-feature": "F-DOC-24",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocAgentPageRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The outcome (written with the page and version, or proposed with the change).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocBodyWriteResult"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/meetings": {
   "post": {
    "operationId": "submitAgentMeeting",
    "summary": "Deliver one meeting (contract version 1) into a project's memory",
    "description": "The meeting's segment (segmentKey, else the fallbacks of F-MEM-13.R08) must be in the identity's segments ∩ the owner's readable segments; otherwise 422 validation.failed with memory.segment_not_allowed, and nothing is stored.",
    "x-feature": "F-MEM-09",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MeetingIntakeV1"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The stored result of the same revision and digest, or of a higher revision applied to the items.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MeetingIntakeResult"
          }
         }
        }
       }
      }
     },
     "201": {
      "description": "The items of a new meeting.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MeetingIntakeResult"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/item-types": {
   "get": {
    "operationId": "listAgentItemTypes",
    "summary": "The item-type registry with the tenant's active types",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "responses": {
     "200": {
      "description": "The type catalogue.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeTypeCatalogue"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/items": {
   "get": {
    "operationId": "searchAgentKnowledgeItems",
    "summary": "Search or list the knowledge items that the identity may read",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     },
     {
      "name": "mode",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "keyword",
        "semantic"
       ],
       "default": "keyword"
      }
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 10,
       "items": {
        "$ref": "#/components/schemas/KnowledgeItemTypeKey"
       }
      }
     },
     {
      "name": "tag",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 10,
       "items": {
        "type": "string",
        "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
       }
      }
     },
     {
      "name": "linkedTicketKey",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/TicketKey"
      }
     },
     {
      "name": "updatedFrom",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Instant"
      }
     },
     {
      "name": "mine",
      "in": "query",
      "required": false,
      "description": "Only the items that this identity wrote.",
      "schema": {
       "type": "boolean",
       "default": false
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of up to 50 rows (20 in semantic mode).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/KnowledgeItemRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/KnowledgeSearchMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createAgentKnowledgeItem",
    "summary": "Add a knowledge item as the identity",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AgentKnowledgeItemInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The existing item of the same external id and body (R10).",
      "headers": {
       "X-Kanso-Existing-Item": {
        "description": "True when the answer is an existing item of the same external id and body.",
        "schema": {
         "type": "boolean",
         "enum": [
          true
         ]
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "201": {
      "description": "The new item, active (direct mode) or proposed (review mode).",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/items/{itemKey}": {
   "get": {
    "operationId": "getAgentKnowledgeItem",
    "summary": "One knowledge item with its provenance and visible links",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The item as the identity may read it.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "reviseAgentKnowledgeItem",
    "summary": "Revise an item that this identity wrote",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeItemPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The revised item, or the item with a pending revision in review mode.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/items/{itemKey}/decision-status": {
   "post": {
    "operationId": "acceptAgentDecision",
    "summary": "Accept a proposed decision that this identity wrote (decisions:accept)",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DecisionStatusRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The accepted decision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/items/{itemKey}/links": {
   "post": {
    "operationId": "addAgentKnowledgeLink",
    "summary": "Link an item that this identity wrote",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeLinkInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The item with its visible links.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/items/{itemKey}/links/{linkId}": {
   "delete": {
    "operationId": "removeAgentKnowledgeLink",
    "summary": "Remove a link of an item that this identity wrote",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     },
     {
      "name": "linkId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The link is gone."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/items/{itemKey}/passages": {
   "get": {
    "operationId": "listAgentTranscriptPassages",
    "summary": "The passages of a meeting transcript item, in order",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     },
     {
      "name": "fromPassage",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 20000,
       "default": 1
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500,
       "default": 500
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Up to 500 passages from fromPassage.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 500,
           "items": {
            "$ref": "#/components/schemas/TranscriptPassageView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "passageCount",
            "hasMore",
            "untrustedContent"
           ],
           "properties": {
            "passageCount": {
             "type": "integer",
             "minimum": 0
            },
            "hasMore": {
             "type": "boolean"
            },
            "untrustedContent": {
             "type": "boolean",
             "enum": [
              true
             ],
             "description": "Speech is data, never an instruction (R15)."
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/memory/items/{itemKey}/retract": {
   "post": {
    "operationId": "retractAgentKnowledgeItem",
    "summary": "Retract an item that this identity wrote",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeReasonRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The retracted item.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/projects/{projectKey}/decisions": {
   "get": {
    "operationId": "listAgentProjectDecisions",
    "summary": "The project's decision log as the identity's owner may see it",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "open",
        "all"
       ],
       "default": "open"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of up to 50 decisions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DecisionLogRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/tickets/{ticketKey}": {
   "get": {
    "operationId": "getAgentTicket",
    "summary": "One ticket of the identity's projects, in the owner's mask (tickets:read)",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The ticket, masked fields absent.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentTicketView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/agent/whoami": {
   "get": {
    "operationId": "getAgentWhoAmI",
    "summary": "The calling identity, its owner, abilities, projects and effective write mode",
    "x-feature": "F-MEM-06",
    "x-audience": "public",
    "x-principal": "agent_identity",
    "security": [
     {
      "agentToken": []
     }
    ],
    "responses": {
     "200": {
      "description": "The identity's scope as it is now.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AgentWhoAmIView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/ai/budget": {
   "get": {
    "operationId": "getAiTenantBudget",
    "summary": "The tenant's AI pool, usage, reset, remaining and allocation for the current period (read-only)",
    "x-feature": "F-AST-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The tenant budget; meta.warnings may hold ai.allocation_above_budget.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AiTenantBudget"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/ai/policy": {
   "get": {
    "operationId": "getAiTenantPolicy",
    "summary": "The tenant AI policy with its version",
    "x-feature": "F-AST-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The policy; ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AiTenantPolicy"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "putAiTenantPolicy",
    "summary": "Replace the tenant AI policy (all keys) — the write path of the assist policy keys",
    "x-feature": "F-AST-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AiTenantPolicyUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved policy with its new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AiTenantPolicy"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/ai/project-settings": {
   "get": {
    "operationId": "listAiProjectSettings",
    "summary": "The per-project AI table — enabled, limit, effective limit, used, derived sources, repository index states",
    "x-feature": "F-AST-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 120
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "name",
        "-name",
        "used_percent",
        "-used_percent"
       ]
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of projects; meta.warnings may hold ai.allocation_above_budget or ai.limit_below_minimum_answer.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/AiProjectSettingsRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            },
            "warnings": {
             "type": "array",
             "maxItems": 10,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/approval-requests": {
   "get": {
    "operationId": "listPendingApprovals",
    "summary": "The workspace's pending client approvals and the requests that need action",
    "x-feature": "F-POR-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[segment]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "pending",
        "needs_action"
       ],
       "default": "pending"
      }
     },
     {
      "name": "filter[projectKey]",
      "in": "query",
      "required": false,
      "description": "One project's requests; an unknown key and a project the reader cannot see both answer an empty list (hidden ≡ missing, REV-POR2-09).",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "filter[requestedBy]",
      "in": "query",
      "required": false,
      "description": "me for the caller's own requests.",
      "schema": {
       "type": "string",
       "enum": [
        "me"
       ]
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "G-CP-01 (XM-1315): 2–120 characters, case-insensitive: the ticket key starts with the text, or the ticket title that the reader sees contains it. The segment counts do not apply q.",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 120
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "description": "G-CP-03 (XM-1315): waiting = overdue first, then the oldest request (the default); requestedAt / -requestedAt = the oldest / the newest request first; ticket / -ticket = by project key, then ticket number. The cursor is bound to q and sort.",
      "schema": {
       "type": "string",
       "enum": [
        "waiting",
        "requestedAt",
        "-requestedAt",
        "ticket",
        "-ticket"
       ],
       "default": "waiting"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Rows in the order of sort (default overdue first then oldest first), with the segment counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/PendingApprovalRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "counts"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "counts": {
             "type": "object",
             "required": [
              "pending",
              "needsAction"
             ],
             "properties": {
              "pending": {
               "type": "integer",
               "minimum": 0
              },
              "needsAction": {
               "type": "integer",
               "minimum": 0
              }
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/approval-requests/{requestId}/remind": {
   "post": {
    "operationId": "remindApprovalReviewers",
    "summary": "Remind the request's eligible reviewers (at most once per cooldown)",
    "x-feature": "F-POR-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The request with its updated reminders.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ApprovalRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/approval-requests/{requestId}/withdraw": {
   "post": {
    "operationId": "withdrawApproval",
    "summary": "Withdraw an open approval request",
    "x-feature": "F-POR-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The withdrawn request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ApprovalRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/approvals": {
   "get": {
    "operationId": "listAssistApprovals",
    "summary": "The caller's AI proposals across projects — waiting (pending) or decided — no access to the initiator's conversation follows from it",
    "x-feature": "F-AST-13",
    "x-audience": "spa",
    "x-assist-contract": "decide",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[view]",
      "in": "query",
      "required": false,
      "description": "R16 (XM-1085): waiting = the pending proposals the caller may decide, soonest expiry first; decided = the proposals that are no longer pending and name the caller as a reviewer, the newest state change first. The cursor is bound to the view.",
      "schema": {
       "type": "string",
       "enum": [
        "waiting",
        "decided"
       ],
       "default": "waiting"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The rows of the view, 25 per page, with the counts of both views (R16).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/AssistApprovalInboxRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/AssistApprovalsMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/budget/me": {
   "get": {
    "operationId": "getMyAssistantBudget",
    "summary": "The person's assistant tokens of the current month",
    "x-feature": "F-AST-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Used, reserved and the limit (never above the tenant pool), and when the month resets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistantBudget"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/conversation": {
   "get": {
    "operationId": "getMyAssistantConversation",
    "summary": "The person's current workspace conversation with the assistant, or null",
    "x-feature": "F-AST-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "before",
      "in": "query",
      "required": false,
      "description": "The cursor of older turns (from links.older).",
      "schema": {
       "type": "string",
       "maxLength": 80
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The newest 50 turns, oldest first; data is null when the person has no current conversation.",
      "headers": {
       "ETag": {
        "description": "G256 — the conversation version in quotes, when data is not null.",
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "oneOf": [
            {
             "type": "null"
            },
            {
             "$ref": "#/components/schemas/AssistantConversation"
            }
           ]
          },
          "meta": {
           "type": "object",
           "properties": {
            "hasMore": {
             "type": "boolean"
            }
           }
          },
          "links": {
           "type": "object",
           "properties": {
            "older": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/conversations": {
   "post": {
    "operationId": "startAssistantConversation",
    "summary": "Start a new workspace conversation (\"New conversation\")",
    "x-feature": "F-AST-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "201": {
      "description": "The new, empty conversation; it is the person's current one.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistantConversation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/conversations/{conversationId}/messages": {
   "post": {
    "operationId": "sendAssistantMessage",
    "summary": "Send a message to the assistant; the answer arrives through the run's events",
    "x-feature": "F-AST-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "conversationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistantMessageRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The run that answers; messageId is the person's message, replyId the assistant's answer.",
      "headers": {
       "Location": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistantMessageStarted"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/conversations/{conversationId}/messages/{messageId}/edit": {
   "post": {
    "operationId": "editAssistantMessage",
    "summary": "Edit a person message — the conversation from it on is replaced, and the assistant answers again (G256, F-AST-21.R12)",
    "x-feature": "F-AST-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "conversationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "messageId",
      "in": "path",
      "required": true,
      "description": "The person message to edit (a turn with editable true).",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistantMessageEditRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The run that answers the new message; messageId is the new person message, replyId the new answer.",
      "headers": {
       "Location": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistantMessageStarted"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/conversations/{conversationId}/messages/{messageId}/retry": {
   "post": {
    "operationId": "retryAssistantAnswer",
    "summary": "Retry the answer — a new run for the same person message (G188, F-AST-21.R10)",
    "x-feature": "F-AST-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "conversationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "messageId",
      "in": "path",
      "required": true,
      "description": "The assistant answer to retry (the conversation's newest answer).",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "202": {
      "description": "The new run; messageId is the same person message, replyId the new answer.",
      "headers": {
       "Location": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistantMessageStarted"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/doc-spaces/{spaceId}/conversation": {
   "get": {
    "operationId": "getDocSpaceAssistConversation",
    "summary": "The caller's current conversation with one tenant or team space",
    "x-feature": "F-DOC-23",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The conversation, its messages re-authorised.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistConversation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/doc-spaces/{spaceId}/conversations": {
   "post": {
    "operationId": "startDocSpaceAssistConversation",
    "summary": "Start a new, empty conversation with one tenant or team space",
    "x-feature": "F-DOC-23",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "201": {
      "description": "The new conversation with no messages.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistConversation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/doc-spaces/{spaceId}/messages": {
   "post": {
    "operationId": "askDocSpaceQuestion",
    "summary": "Ask one tenant or team space — a run whose answer arrives through the run's events",
    "x-feature": "F-DOC-23",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistQuestionRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The run, its answer message and its events URL.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistStartedRun"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/pages": {
   "get": {
    "operationId": "findAssistPages",
    "summary": "The Youniton pages that the caller can open and that match a question — for the assistant's navigation answers",
    "x-feature": "F-AST-24",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "find_page",
     "kind": "navigate",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [],
     "description": "Find the Youniton pages that you can open and that match what you look for (a setting, a list, a screen). Each row has a direct link."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "description": "What the person looks for, in their words.",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 120
      }
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "description": "The project of the panel's page context — a hint only; used only when the caller can see it and the page's gate holds.",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "At most 5 pages, best match first; an empty list when no page that the caller can open matches.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 5,
           "items": {
            "type": "object",
            "required": [
             "routeId",
             "title",
             "place",
             "placeText",
             "href"
            ],
            "additionalProperties": false,
            "properties": {
             "routeId": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{1,79}$"
             },
             "title": {
              "type": "string",
              "maxLength": 80
             },
             "place": {
              "type": "array",
              "minItems": 1,
              "maxItems": 4,
              "items": {
               "type": "string",
               "maxLength": 80
              }
             },
             "placeText": {
              "type": "string",
              "maxLength": 330
             },
             "href": {
              "type": "string",
              "maxLength": 300,
              "pattern": "^/[^/]"
             }
            }
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "catalogueVersion",
            "contentHash"
           ],
           "properties": {
            "catalogueVersion": {
             "type": "integer",
             "minimum": 1
            },
            "contentHash": {
             "type": "string",
             "pattern": "^sha256:[0-9a-f]{64}$"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/projects/{projectKey}/budget": {
   "get": {
    "operationId": "getAssistBudgetLine",
    "summary": "The project's AI budget line for the current period — the same counters as AI limits",
    "x-feature": "F-AST-04",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "Used, reserved, limit, the reset instant and whether the project is in cache-only mode.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistBudgetLine"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/projects/{projectKey}/conversation": {
   "get": {
    "operationId": "getAssistConversation",
    "summary": "The caller's current conversation in the project — messages re-authorised, the derived scope",
    "x-feature": "F-AST-01",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The newest 50 messages (older ones by cursor); text only where released or not required and still valid.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistConversation"
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/projects/{projectKey}/conversations": {
   "post": {
    "operationId": "startAssistConversation",
    "summary": "Start a new, empty current conversation in the project (D-100)",
    "x-feature": "F-AST-10",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistConversationStart"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new conversation with no messages.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistConversation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/projects/{projectKey}/messages": {
   "post": {
    "operationId": "askProjectQuestion",
    "summary": "The project-chat facade — start a project_question run in the conversation; the answer arrives through the run's events",
    "x-feature": "F-AST-01",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistQuestionRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The run, its answer message and its events URL.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistStartedRun"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/projects/{projectKey}/runs": {
   "get": {
    "operationId": "listAssistRuns",
    "summary": "The project's run history for the caller — their own runs; every run's summary for an Admin",
    "x-feature": "F-AST-12",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "25 runs per page, newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/AssistRunHistoryRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/projects/{projectKey}/suggestions": {
   "get": {
    "operationId": "listAssistSuggestions",
    "summary": "The suggestion chips the caller may use in this project now",
    "x-feature": "F-AST-02",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "0–3 chips; disabled in cache-only mode; empty for client askers.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 3,
           "items": {
            "$ref": "#/components/schemas/AssistSuggestion"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/projects/{projectKey}/workflows": {
   "get": {
    "operationId": "listAssistWorkflows",
    "summary": "The workflows the caller may start in this project, with their parameters, intended outcome and proposed actions",
    "x-feature": "F-AST-11",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The catalogue entries for this caller; unavailable ones carry the reason.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 10,
           "items": {
            "$ref": "#/components/schemas/AssistWorkflowOption"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/proposals/{proposal}": {
   "get": {
    "operationId": "getAssistProposalById",
    "summary": "The reviewer's projection of one proposal by its id alone — the notification deep link (R17)",
    "x-feature": "F-AST-13",
    "x-audience": "spa",
    "x-assist-contract": "decide",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistProposalIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The same projection as getAssistProposal; a superseded proposal names its newer version (supersededBy).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistProposalReview"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs": {
   "post": {
    "operationId": "createAssistRun",
    "summary": "Create a durable run of a workflow; 202 only after the run and its dispatch intent committed",
    "x-feature": "F-AST-11",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistRunRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The run exists; Location is /api/v1/assist/runs/{run}; follow eventsUrl.",
      "headers": {
       "Location": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistStartedRun"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}": {
   "get": {
    "operationId": "getAssistRun",
    "summary": "The authorised snapshot of a run — status, progress, pending proposal, receipts, outcome; text only for its actor",
    "x-feature": "F-AST-12",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The snapshot; sequence is the cursor to continue the stream from.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistRunSnapshot"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/cancel": {
   "post": {
    "operationId": "cancelAssistRun",
    "summary": "Persist the cancel intent, fence new effects and answer 202 with the run's status; safe to repeat",
    "x-feature": "F-AST-14",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     }
    ],
    "responses": {
     "202": {
      "description": "The cancel intent is recorded (CG-26) — the run's status and status version after it (cancelling, cancelled, or its terminal status if it had already ended); the run's events and snapshot report the end.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistRunCancelled"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/compensations": {
   "post": {
    "operationId": "requestAssistCompensation",
    "summary": "Request the catalogue's compensating action for one committed receipt, as a linked run that needs its own approval",
    "x-feature": "F-AST-15",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistCompensationRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The compensation run; it proposes the inverse for approval.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistStartedRun"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/events": {
   "get": {
    "operationId": "streamAssistRunEvents",
    "summary": "The run's events after a cursor — text/event-stream, or paged JSON with Accept application/json",
    "x-feature": "F-AST-12",
    "x-audience": "spa",
    "x-assist-contract": "observe",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/AssistEventsAfter"
     },
     {
      "$ref": "#/components/parameters/AssistLastEventId"
     }
    ],
    "responses": {
     "200": {
      "description": "SSE (Cache-Control no-store, X-Accel-Buffering no) — run.status first, stored events in order, unavailable markers on replay, resync for a lost cursor, ping every 15 s; or a JSON page.",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       },
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/AssistRunEventEnvelope"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "after",
            "hasMore",
            "ended"
           ],
           "properties": {
            "after": {
             "type": "integer"
            },
            "hasMore": {
             "type": "boolean"
            },
            "ended": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/proposals/{proposal}": {
   "get": {
    "operationId": "getAssistProposal",
    "summary": "The reviewer's projection of one exact proposal — items, targets with versions, before/after, recipients, expiry, state",
    "x-feature": "F-AST-13",
    "x-audience": "spa",
    "x-assist-contract": "decide",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/AssistProposalIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The proposal as this reviewer may see it; can tells whether they may approve or reject and which step-up is needed.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistProposalReview"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/proposals/{proposal}/card": {
   "get": {
    "operationId": "getAssistantProposalCard",
    "summary": "The confirmation card of the assistant's write, from its record",
    "x-feature": "F-AST-23",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/AssistProposalIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The proposal's state and the card; only the initiator reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistantProposalCard"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/proposals/{proposal}/decision": {
   "post": {
    "operationId": "decideAssistProposal",
    "summary": "Approve or reject the exact proposal version and digest; a rejection always records",
    "x-feature": "F-AST-13",
    "x-audience": "spa",
    "x-assist-contract": "decide",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/AssistProposalIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AssistDecisionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The recorded decision; for an approval the run is queued to resume (it may wait for a slot or a budget).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistDecisionResult"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/proposals/{proposal}/renew": {
   "post": {
    "operationId": "renewAssistProposal",
    "summary": "Prepare a fresh proposal for an expired or stale one — the run resumes and re-plans from current evidence",
    "x-feature": "F-AST-15",
    "x-audience": "spa",
    "x-assist-contract": "decide",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/AssistProposalIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The run's snapshot, queued to prepare the new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistRunSnapshot"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/proposals/{proposal}/start-again": {
   "post": {
    "operationId": "startAssistProposalAgain",
    "summary": "Start a linked run again after a rejected proposal; nothing of the rejected proposal executes (R18)",
    "x-feature": "F-AST-13",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/AssistProposalIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "202": {
      "description": "The linked run (restart_of); follow its events URL.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistStartedRun"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/runs/{run}/retry": {
   "post": {
    "operationId": "retryAssistRun",
    "summary": "Start a linked run of a failed, retryable run; committed receipts of the chain are never repeated",
    "x-feature": "F-AST-14",
    "x-audience": "spa",
    "x-assist-contract": "create_run",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AssistRunIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "202": {
      "description": "The linked run; follow its events URL.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AssistStartedRun"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/assist/suggestions": {
   "get": {
    "operationId": "listAssistantSuggestions",
    "summary": "Four starting points of the assistant panel",
    "x-feature": "F-AST-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Words only; a suggestion grants nothing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 4,
           "items": {
            "type": "object",
            "required": [
             "id",
             "text"
            ],
            "properties": {
             "id": {
              "type": "string",
              "maxLength": 10
             },
             "text": {
              "type": "string",
              "maxLength": 120
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/attachments/{attachmentId}": {
   "delete": {
    "operationId": "removeAttachment",
    "summary": "Move an attachment to the trash",
    "x-feature": "F-WRK-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "attachmentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Trashed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/attachments/{attachmentId}/restore": {
   "post": {
    "operationId": "restoreAttachment",
    "summary": "Restore a trashed attachment within the retention",
    "x-feature": "F-WRK-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "attachmentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The attachment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AttachmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/attachments/{attachmentId}/sharing": {
   "put": {
    "operationId": "setAttachmentSharing",
    "summary": "Switch an attachment between Internal and Shared with client for the current client version",
    "x-feature": "F-WRK-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "attachmentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AttachmentSharingRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The attachment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AttachmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/audit-events": {
   "get": {
    "operationId": "listAuditEvents",
    "summary": "The tenant audit log, newest first, 50 per batch",
    "x-feature": "F-AUD-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[actor]",
      "in": "query",
      "required": false,
      "description": "anyone (default), operators, system, or member:<memberId>.",
      "schema": {
       "type": "string",
       "pattern": "^(anyone|operators|system|member:[0-9a-f-]{36})$"
      }
     },
     {
      "name": "filter[category]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "members_and_roles",
        "client_sharing",
        "security",
        "integrations",
        "ai",
        "support_access",
        "projects_and_boards",
        "relationships",
        "messaging",
        "automation",
        "finance"
       ]
      }
     },
     {
      "name": "filter[type]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 80
      }
     },
     {
      "name": "filter[period]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "last_7",
        "last_30",
        "last_90",
        "custom"
       ]
      }
     },
     {
      "name": "filter[from]",
      "in": "query",
      "required": false,
      "description": "First day of a custom range, in the viewer's profile time zone (D-128).",
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[to]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 120
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One batch of events with the matching count and the retention caption.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AuditEventRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/AuditListMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/audit-events/categories": {
   "get": {
    "operationId": "listAuditCategories",
    "summary": "The audit type registry's categories and types for the Event type filter",
    "x-feature": "F-AUD-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Categories with their types and display names in the caller's language.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/AuditCategoryView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/audit-events/export": {
   "post": {
    "operationId": "exportAuditEvents",
    "summary": "Export the filtered audit list as CSV — streamed up to 100,000 rows, otherwise an operation",
    "x-feature": "F-AUD-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AuditExportRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The CSV file (Content-Disposition attachment), UTF-8 with a byte-order mark.",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "202": {
      "description": "A large export runs as an operation; Location points to it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/audit-events/new-count": {
   "get": {
    "operationId": "countNewAuditEvents",
    "summary": "The number of events recorded after the reader read the list, under the list's filters (at most 100)",
    "description": "F-AUD-01.R14 (XM-1136, XM-1155). Send the same filters as the list and `seen`, the list's `meta.seenCursor`. The count is of the records that the log recorded after the list's first batch was read, also when their time is older (a mirrored record). Without `seen`, every match counts. The `audit.changed` envelope only starts this read.",
    "x-feature": "F-AUD-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "seen",
      "in": "query",
      "required": false,
      "description": "The `meta.seenCursor` of the list's first batch, for the same filters.",
      "schema": {
       "type": "string",
       "maxLength": 512
      }
     },
     {
      "name": "filter[actor]",
      "in": "query",
      "required": false,
      "description": "anyone (default), operators, system, or member:<memberId>.",
      "schema": {
       "type": "string",
       "pattern": "^(anyone|operators|system|member:[0-9a-f-]{36})$"
      }
     },
     {
      "name": "filter[category]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "members_and_roles",
        "client_sharing",
        "security",
        "integrations",
        "ai",
        "support_access",
        "projects_and_boards",
        "relationships",
        "messaging",
        "automation",
        "finance"
       ]
      }
     },
     {
      "name": "filter[type]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 80
      }
     },
     {
      "name": "filter[period]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "last_7",
        "last_30",
        "last_90",
        "custom"
       ]
      }
     },
     {
      "name": "filter[from]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[to]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 120
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The capped number of new events.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AuditNewEventCount"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/audit-events/{eventId}": {
   "get": {
    "operationId": "getAuditEvent",
    "summary": "One audit event with its prose, structured record and contextual actions",
    "x-feature": "F-AUD-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "eventId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The event.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AuditEventDetail"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/audit-events/{eventId}/export": {
   "get": {
    "operationId": "exportAuditEvent",
    "summary": "Download one audit record as JSON with its schema version",
    "x-feature": "F-AUD-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "eventId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The record as a JSON attachment.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AuditRecordDocument"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/audit-events/{eventId}/prompt": {
   "get": {
    "operationId": "getAuditEventPrompt",
    "summary": "The prompt text behind a sensitive ai.prompt record (\"Show prompt\"), through Assist's access-controlled read, or its state",
    "x-feature": "F-AUD-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "eventId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The prompt text while it exists, otherwise its state. Never cached.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AuditPromptContent"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "requestAccountRecovery",
    "summary": "Ask for an independent account recovery (always the same answer)",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountRecoveryStart"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Accepted; an e-mail goes out only for an eligible account."
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/cancel": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "cancelAccountRecoveryByLink",
    "summary": "Cancel with the e-mail's single-use link, without signing in",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountRecoveryCancel"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Cancelled (also when it was already ended)."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/current": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "get": {
    "operationId": "getBoundAccountRecovery",
    "summary": "The open request of this browser (bound with E1), without a session",
    "description": "XM-1024 (G-REC-01). The recovery page reads its request after an E2 provider round trip and on a reload. The answer is the same 204 when no request is open and when the open request belongs to another browser.",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "responses": {
     "200": {
      "description": "The open request of this browser, with the waits and the E2 providers.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountRecoveryView"
          }
         }
        }
       }
      }
     },
     "204": {
      "description": "No open request is bound to this browser."
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/email": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "proveRecoveryEmailControl",
    "summary": "E1 — the token from the e-mail's link binds the request to this browser",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountRecoveryEmailProof"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The request with its evidence and what is missing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountRecoveryView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/{requestId}/cancel": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "cancelBoundAccountRecovery",
    "summary": "Cancel the open request from the recovery browser, without a session",
    "description": "XM-1026 (G-REC-03). Only the browser that the request is bound to can cancel this way. The e-mail's cancel link and a session also cancel.",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "responses": {
     "204": {
      "description": "Cancelled."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/{requestId}/evidence/device": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "recordRecoveryDeviceEvidence",
    "summary": "P1 — the bound browser presents a trusted device of the account",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "responses": {
     "200": {
      "description": "The updated request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountRecoveryView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/{requestId}/evidence/primary": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "recordRecoveryPrimaryEvidence",
    "summary": "E2 — the account's own password, or a Google or Microsoft round trip",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountRecoveryPrimaryEvidence"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated request, or a redirect for a provider round trip.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountRecoveryView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/{requestId}/evidence/token": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "recordRecoveryTokenEvidence",
    "summary": "P3 — a personal access token of the account, compared by hash",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccountRecoveryTokenEvidence"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountRecoveryView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/account-recovery/{requestId}/submit": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "submitAccountRecovery",
    "summary": "Hand the request to Youniton's support for review",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/RecoveryRequestId"
     }
    ],
    "responses": {
     "200": {
      "description": "The submitted request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountRecoveryView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/cancel": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "cancelSignInAttempt",
    "summary": "Abandon the current sign-in attempt",
    "x-feature": "F-IDN-05",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "responses": {
     "204": {
      "description": "The attempt is gone (also when none existed)."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "419": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/enrolment": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "startEnrolmentAtSignIn",
    "summary": "Issue a pending authenticator secret during a sign-in that requires 2FA",
    "x-feature": "F-IDN-09",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "description": "Empty for sign-in, invitation and step-up; the exit attempt adds its codes (F-PLT-09).",
        "properties": {
         "pickupCode": {
          "type": "string",
          "pattern": "^[A-Z0-9]{8}$",
          "writeOnly": true
         },
         "emailCode": {
          "type": "string",
          "pattern": "^[0-9]{6}$",
          "writeOnly": true
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The pending secret as QR code, setup key and URI, valid 10 minutes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AuthenticatorSetup"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/enrolment/confirm": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "confirmEnrolmentAtSignIn",
    "summary": "Confirm the pending secret with a code; returns the recovery codes once and the session (an exit attempt gets its grant, no codes)",
    "x-feature": "F-IDN-09",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AuthenticatorConfirmRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The attempt view and, for every attempt except an exit attempt, the eight recovery codes (shown once). An exit attempt (intent exit_export, R09) answers only the attempt view in state exit_granted; its factor issues no recovery codes (XM-1072).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/EnrolmentConfirmation"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "410": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/exit": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "startExitAttempt",
    "summary": "Start an exit attempt bound to one tenant; the same neutral attempt view for any slug",
    "description": "`404 tenant.not_found` only on a tenant-pinned host (XM-1048: the trusted `X-Kanso-Pinned-Tenant` of its edge proxy): there a slug that does not name the pinned tenant (another tenant's, an unknown one, one that cannot exist) gets this one answer. Every other host answers every slug with the same neutral attempt view.",
    "x-feature": "F-PLT-09",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExitStartRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The attempt view with intent exit_export.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/impersonation/enter": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "enterImpersonation",
    "summary": "Exchange the one-time entry token for an app session as the user",
    "x-feature": "F-PLT-22",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ImpersonationEntryInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The app session now acts as the user; the state for the banner.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ImpersonationState"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/invitations/accept": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "acceptInvitation",
    "summary": "Accept with a password (new or existing account) or with the current session",
    "x-feature": "F-TEN-08",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvitationAcceptRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The sign-in attempt view — pending_enrolment, pending_second_factor or session with its landing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "410": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/invitations/lookup": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "lookUpInvitation",
    "summary": "Resolve an invitation token into the landing card",
    "x-feature": "F-TEN-08",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvitationLookupRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "A usable invitation; Cache-Control no-store.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvitationLandingView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "410": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/oidc/{provider}/callback": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "get": {
    "operationId": "completeOidc",
    "summary": "The provider's redirect back; continues the attempt",
    "x-feature": "F-IDN-03",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "parameters": [
     {
      "name": "provider",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "google",
        "microsoft"
       ]
      }
     },
     {
      "name": "code",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 4096
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 256
      }
     },
     {
      "name": "error",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 256
      }
     }
    ],
    "responses": {
     "303": {
      "description": "To /sign-in/continue (on the console origin, to the console's sign-in page, R10); the outcome is read from GET /auth/state."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/oidc/{provider}/start": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "startOidc",
    "summary": "Start a Google or Microsoft round trip for an intent",
    "x-feature": "F-IDN-03",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "name": "provider",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "google",
        "microsoft"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OidcStartRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The provider's authorization URL for a top-level navigation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RedirectInstruction"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/operator-invitations/accept": {
   "servers": [
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "acceptOperatorInvitation",
    "summary": "Start the console attempt that proves the invited e-mail and enrols TOTP before activation",
    "x-feature": "F-PLT-17",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OperatorInvitationAcceptRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The console attempt view after the password step — pending_second_factor for an enrolled existing account, else pending_enrolment (R04, R12).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/operator-invitations/lookup": {
   "servers": [
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "lookupOperatorInvitation",
    "summary": "Resolve an operator invitation token on the console (one neutral 404 for every invalid token)",
    "x-feature": "F-PLT-17",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OperatorInvitationToken"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The invitation's name, e-mail, role and expiry.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OperatorInvitationView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/password": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "signInWithPassword",
    "summary": "Verify an e-mail and password and continue the sign-in",
    "x-feature": "F-IDN-02",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PasswordSignInRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The attempt view after the evaluation — pending_second_factor, pending_enrolment or session with the landing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "419": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/password-reset": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "requestPasswordReset",
    "summary": "Ask for a password-reset link (always the same answer)",
    "x-feature": "F-IDN-10",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PasswordResetRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Accepted; an e-mail goes out only to an active account with a password."
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/password-reset/complete": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "completePasswordReset",
    "summary": "Set a new password with the token from the link and continue the sign-in",
    "x-feature": "F-IDN-10",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PasswordResetCompleteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The attempt view (pending_second_factor, pending_enrolment or session).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/password-reset/policy": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "readPasswordResetPolicy",
    "summary": "Read the password rules of an open reset link (the minimum of the strictest tenant)",
    "description": "XM-1050 (G-SGN-02; R11). The token goes in the body, never in the address. The answer names no tenant and no account. The completion's limiter applies (per IP, one budget for reads and completions). Every unusable token answers the same `400 password_reset.invalid_token` as the completion. The read writes nothing; the link stays open.",
    "x-feature": "F-IDN-10",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PasswordResetPolicyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The password rules of the link's account.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PasswordResetPolicy"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/reauthenticate": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "reauthenticate",
    "summary": "Record a fresh proof for a re-authentication window",
    "x-feature": "F-IDN-05",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReauthenticateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The stamp's window and validity, or a redirect URL for a provider round trip.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReauthenticationResult"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/recovery-code": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "verifyRecoveryCode",
    "summary": "Complete the pending sign-in with a recovery code",
    "x-feature": "F-IDN-16",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SecondFactorRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The attempt view in state session with recoveryCodesRemaining.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "410": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/saml/continue": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "get": {
    "operationId": "continueSamlSignIn",
    "summary": "Consume the one-time handoff in the browser that started the attempt",
    "x-feature": "F-IDN-04",
    "x-audience": "spa",
    "x-surface": "auth",
    "parameters": [
     {
      "name": "handoff",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9_-]{43}$"
      }
     }
    ],
    "responses": {
     "303": {
      "description": "To /sign-in/continue."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/saml/exit": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "get": {
    "operationId": "handOffExitSaml",
    "summary": "The neutral SAML exit start's one-time hand-off — to the tenant's IdP, or ending like a refused assertion",
    "description": "Register §41.10 (c); S04: `POST /auth/sso` with intent `exit_export` (the e-mail optional, only a login hint; the tenant is the exit attempt's, XM-1072) answers this app-origin URL and an empty tenant name for every slug — unknown, without SAML, with it — so the API answer reveals neither SAML use nor the IdP. Followed once (60 seconds), by the browser that started it only (another browser gets `401 auth.attempt_expired` and its own attempt is untouched; REV-XP11-18): `302` to the tenant's IdP with `ForceAuthn` (or its HTTP-POST page), else `303` to `/sign-in/continue`, the attempt ended `auth.failed` as after an assertion the IdP refused. Following it necessarily shows whoever follows it the tenant's IdP — the credential is entered there; this is inherent to SAML and bounded by the `exit` start limiter (REV-XP11-16, accepted by the coordinator).",
    "x-feature": "F-PLT-09",
    "x-audience": "spa",
    "x-surface": "auth",
    "parameters": [
     {
      "name": "handle",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9_-]{43}$"
      }
     }
    ],
    "responses": {
     "302": {
      "description": "To the tenant's IdP (no-store, no referrer)."
     },
     "303": {
      "description": "To /sign-in/continue, the attempt failed."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/saml/post": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "get": {
    "operationId": "postSamlAuthnRequest",
    "summary": "The one-time page that posts a signed AuthnRequest to an IdP taking only the HTTP-POST binding",
    "description": "XM-34 (SAML bindings §3.5): the redirectUrl of the SSO start, a step-up or a test sign-in when the IdP's metadata offers only HTTP-POST. An HTML form carrying the base64 `SAMLRequest` (enveloped RSA-SHA256 signature), submitted by a nonce'd script; the CSP allows nothing else and `form-action` only the IdP's origin. The handle is single use and lives 60 seconds.",
    "x-feature": "F-IDN-04",
    "x-audience": "spa",
    "x-surface": "auth",
    "parameters": [
     {
      "name": "handle",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z0-9_-]{43}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The auto-submitting form (text/html, no-store).",
      "content": {
       "text/html": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/sign-out": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "signOut",
    "summary": "End the current session (and, for SAML with the tenant's opt-in, start the IdP logout)",
    "x-feature": "F-IDN-13",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "responses": {
     "200": {
      "description": "Signed out locally; continue the identity provider's logout at redirectUrl.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RedirectInstruction"
          }
         }
        }
       }
      }
     },
     "204": {
      "description": "Signed out (or there was no session)."
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "419": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/sso": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "startSsoSignIn",
    "summary": "Resolve the tenant from the work e-mail and start its SAML sign-in",
    "description": "sign_in and invitation need the work e-mail. With intent exit_export (F-PLT-09.R08; XM-1072) the tenant is the browser's started exit attempt's (POST /auth/exit); the e-mail is optional and only the IdP's login hint. That start answers the neutral hand-off of handOffExitSaml and an empty tenant name for every exit slug, and 401 auth.attempt_expired without a started exit attempt. Every intent answers 503 service.unavailable while the service provider is not configured.",
    "x-feature": "F-IDN-04",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SsoStartRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The tenant's name and the IdP redirect URL.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RedirectInstruction"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "410": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/state": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "get": {
    "operationId": "getAuthState",
    "summary": "The current attempt, or the signed-in landing",
    "x-feature": "F-IDN-05",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "responses": {
     "200": {
      "description": "The attempt view, or state session with the landing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "204": {
      "description": "Neither an attempt nor a session."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/auth/step-up": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "startStepUp",
    "summary": "Start a step-up for a tenant whose policy the session does not yet satisfy",
    "x-feature": "F-IDN-05",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StepUpRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The step-up attempt view (pending_second_factor, pending_enrolment) or, for `reason` saml, the IdP redirect (F-IDN-04.R05 rule 4; XM-34).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "oneOf": [
            {
             "$ref": "#/components/schemas/SignInAttemptView"
            },
            {
             "$ref": "#/components/schemas/RedirectInstruction"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/auth/totp": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    },
    {
     "url": "/",
     "description": "console.<apex> — the console's own sign-in (/auth)"
    }
   ],
   "post": {
    "operationId": "verifyTotpCode",
    "summary": "Verify the authenticator code of the pending sign-in or step-up",
    "x-feature": "F-IDN-07",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-origin": "app-and-console",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SecondFactorRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The attempt view in state session with the landing (or the completed step-up).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInAttemptView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "410": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules": {
   "get": {
    "operationId": "listAutomationRules",
    "summary": "Rules the caller may read — tenant rules (Admins) and project rules (members with the project in scope)",
    "x-feature": "F-AUT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[scope]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/AutomationRuleScopeKey"
      }
     },
     {
      "name": "filter[projectKey]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "draft",
        "enabled",
        "paused",
        "archived"
       ],
       "default": "active"
      }
     },
     {
      "name": "filter[module]",
      "in": "query",
      "required": false,
      "description": "G-HD-13 (XM-1286; owner §230 add. 102): only the rules and flows whose trigger or any step needs the module (the help-desk area's flow list); the counts follow it.",
      "schema": {
       "type": "string",
       "enum": [
        "help_desk"
       ]
      }
     },
     {
      "name": "filter[templateKey]",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 10,
       "items": {
        "$ref": "#/components/schemas/AutomationTemplateKey"
       }
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 100
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of rules, 50 at most.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AutomationRuleSummary"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "counts": {
             "type": "object",
             "description": "The status tab counts (owner, 22 Nov 2026, A1): the rules the reader sees under the same scope, project, template and search filters, whatever filter[status] is. active = enabled + paused + draft.",
             "required": [
              "active",
              "draft",
              "enabled",
              "paused",
              "archived"
             ],
             "properties": {
              "active": {
               "type": "integer",
               "minimum": 0
              },
              "draft": {
               "type": "integer",
               "minimum": 0
              },
              "enabled": {
               "type": "integer",
               "minimum": 0
              },
              "paused": {
               "type": "integer",
               "minimum": 0
              },
              "archived": {
               "type": "integer",
               "minimum": 0
              }
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createAutomationRule",
    "summary": "Create a rule (blank or from a template) as a draft owned by the caller",
    "x-feature": "F-AUT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationRuleCreateInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new draft rule.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}": {
   "get": {
    "operationId": "getAutomationRule",
    "summary": "A rule with its active definition and draft, projected through the reader's access",
    "x-feature": "F-AUT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The rule.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeAutomationRuleDetails",
    "summary": "Rename a rule or change its description",
    "x-feature": "F-AUT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         },
         "description": {
          "type": "string",
          "maxLength": 500
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Changed.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "archiveAutomationRule",
    "summary": "Archive a rule — it stops at once, for good; versions and history stay",
    "x-feature": "F-AUT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Archived (or already archived)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/activate": {
   "post": {
    "operationId": "activateAutomationRuleVersion",
    "summary": "Activate the draft as a new immutable version; binds the caller's access and makes the caller the owner",
    "x-feature": "F-AUT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Activated.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/draft": {
   "put": {
    "operationId": "saveAutomationRuleDraft",
    "summary": "Save the rule's draft definition, validated against the editor's own access; answers validation sentences",
    "x-feature": "F-AUT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationRuleDefinition"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Saved; warnings may be present.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "discardAutomationRuleDraft",
    "summary": "Discard the rule's draft",
    "x-feature": "F-AUT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Discarded (or there was none)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/dry-run": {
   "post": {
    "operationId": "dryRunAutomationRule",
    "summary": "Simulate the draft or the active version on a sample; nothing is written, emitted, sent or started",
    "x-feature": "F-AUT-06",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationDryRunRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The simulation result.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationDryRunResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/enable": {
   "post": {
    "operationId": "enableAutomationRule",
    "summary": "Enable a paused rule; binds the caller's access to the active version and makes the caller the owner",
    "x-feature": "F-AUT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Enabled.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/flow": {
   "get": {
    "operationId": "getAutomationFlow",
    "summary": "The rule as a flow, with its draft, validation and AI block states",
    "x-feature": "F-AUT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "name": "version",
      "in": "query",
      "required": false,
      "description": "One version of the rule in place of the active one, with no draft, through the same projection — the run view paints the boxes of the version that the run used (F-AUT-24 §13; XM-1295, G-AUA-16). An unknown version is 404.",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The flow.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationFlowView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/flow-draft": {
   "put": {
    "operationId": "saveAutomationFlowDraft",
    "summary": "Save the flow's draft, validated against the editor's own access; answers validation sentences",
    "x-feature": "F-AUT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationFlowDefinition"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Saved; warnings may be present.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationFlowView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/flow-test": {
   "post": {
    "operationId": "testAutomationFlow",
    "summary": "Walk a flow on a sample; nothing is written, emitted or sent; a test run may call the model",
    "x-feature": "F-AUT-23",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationFlowTestRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The walk.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationFlowTestResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/owner": {
   "put": {
    "operationId": "transferAutomationRuleOwnership",
    "summary": "Designate a new owner (Admins); the rule pauses until that member enables it with their own access",
    "x-feature": "F-AUT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "memberId"
        ],
        "additionalProperties": false,
        "properties": {
         "memberId": {
          "$ref": "#/components/schemas/Uuid"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Designated; the rule is paused waiting for its new owner.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/pause": {
   "post": {
    "operationId": "pauseAutomationRule",
    "summary": "Pause an enabled rule",
    "x-feature": "F-AUT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Paused (or already paused).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRuleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/presence": {
   "post": {
    "operationId": "relayAutomationFlowPresence",
    "summary": "Relay one content-free signal on the rule's presence channel: which step of the flow the person edits (owner, 23 Nov 2026)",
    "description": "`{activity: editing, stepId}` or `{activity: idle}`. An internal reader of the rule; `editing` needs the right to change it (`manage_automation` on a project rule, `administer` on a tenant rule). One signal per person per rule in the platform's relay window (`429`, `limiter: presence-relay`); an `idle` that ends an activity is exempt. Nothing is stored. Receivers get `RealtimePresenceFlow` (the Pusher event `presence`, to the others).",
    "x-feature": "F-AUT-14",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "name": "X-Socket-ID",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[0-9]{1,20}\\.[0-9]{1,20}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/FlowPresenceSignal"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Relayed, or nothing to end."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/realtime": {
   "get": {
    "operationId": "getAutomationRulePresenceChannel",
    "summary": "The rule's presence channel — who has the flow open (owner, 23 Nov 2026 — real-time; ADR-033)",
    "description": "A project rule's `presence-tenant.{t}.project.{p}.flow.{r}.v{n}` (the project's team epoch) or a tenant rule's `presence-tenant.{t}.automation.{r}.v{n}` (the tenant's team epoch: the tenant channel's epoch plus the tenant's team epoch). The SPA reads it when it opens the flow editor and again on `channels.rotated`. Internal readers of the rule only; anyone else 404. Presence only: the member's id, name, initials and colour.",
    "x-feature": "F-AUT-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The channel to join.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "presenceChannel"
           ],
           "properties": {
            "presenceChannel": {
             "type": "string",
             "maxLength": 190,
             "pattern": "^presence-tenant\\.[0-9a-f-]{36}\\.(project\\.[0-9a-f-]{36}\\.flow|automation)\\.[0-9a-f-]{36}\\.v[1-9][0-9]{0,17}$"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/run": {
   "post": {
    "operationId": "runAutomationRuleNow",
    "summary": "Run a schedule rule now (a manual run of the active version; a schema 1 rule or a flow on the schedule trigger)",
    "x-feature": "F-AUT-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "202": {
      "description": "The run is queued.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRunSummary"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/runs": {
   "get": {
    "operationId": "listAutomationRuleRuns",
    "summary": "A rule's run history, newest first",
    "x-feature": "F-AUT-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 9,
       "items": {
        "$ref": "#/components/schemas/AutomationRunStatusKey"
       }
      }
     },
     {
      "name": "filter[ticketKey]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/TicketKey"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of runs.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AutomationRunSummary"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/sample-events": {
   "get": {
    "operationId": "listAutomationRuleSampleEvents",
    "summary": "The last 50 matching events of the last 30 days that the caller (and, for the active version, the owner) can see",
    "x-feature": "F-AUT-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "name": "target",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "draft",
        "active"
       ],
       "default": "draft"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Sample events, newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AutomationSampleEvent"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/schedule": {
   "get": {
    "operationId": "getAutomationRuleSchedule",
    "summary": "A schedule rule's zone, next five occurrences and the last 50 missed occurrences",
    "x-feature": "F-AUT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The schedule view.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationScheduleView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/start": {
   "post": {
    "operationId": "startAutomationFlow",
    "summary": "Start a flow that has a manual trigger, with typed inputs",
    "x-feature": "F-AUT-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationFlowStartInput"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The run exists and will run.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRunSummary"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/versions": {
   "get": {
    "operationId": "listAutomationRuleVersions",
    "summary": "The rule's versions, newest first",
    "x-feature": "F-AUT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "Versions (at most 100 per page, newest first).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/AutomationVersionSummary"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-rules/{ruleId}/versions/{versionNumber}": {
   "get": {
    "operationId": "getAutomationRuleVersion",
    "summary": "One version's definition, projected through the reader's access",
    "x-feature": "F-AUT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRuleIdPath"
     },
     {
      "name": "versionNumber",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "version",
            "definition"
           ],
           "properties": {
            "version": {
             "$ref": "#/components/schemas/AutomationVersionSummary"
            },
            "definition": {
             "$ref": "#/components/schemas/AutomationRuleDefinition"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-runs/{runId}": {
   "get": {
    "operationId": "getAutomationRun",
    "summary": "One run with its steps, effects and attempts",
    "x-feature": "F-AUT-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRunIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The run.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRunView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-runs/{runId}/cancel": {
   "post": {
    "operationId": "cancelAutomationRun",
    "summary": "End a run that has not ended",
    "x-feature": "F-AUT-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRunIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The run ended.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRunView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-runs/{runId}/retry": {
   "post": {
    "operationId": "retryAutomationRun",
    "summary": "Retry a failed, partially failed or refused admitted run — a new attempt of the same run; succeeded steps are never repeated",
    "x-feature": "F-AUT-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRunIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "202": {
      "description": "The attempt is queued.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationRunView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation-runs/{runId}/steps": {
   "get": {
    "operationId": "listAutomationRunSteps",
    "summary": "The steps of a flow run, in order",
    "x-feature": "F-AUT-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/AutomationRunIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of the steps.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/AutomationFlowRunStep"
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/approvals": {
   "get": {
    "operationId": "listAutomationApprovals",
    "summary": "The approvals that name the caller as an eligible approver (\"My approvals\")",
    "x-feature": "F-AUT-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "description": "XM-1293 (G-AUA-12): pending (default) = pending and stale, \"Waiting for me\"; decided = approved, rejected, expired and void.",
      "schema": {
       "type": "string",
       "enum": [
        "pending",
        "decided"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The approvals, oldest first, with the counts of both segments.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AutomationApprovalView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "counts"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "counts": {
             "type": "object",
             "required": [
              "pending",
              "decided"
             ],
             "properties": {
              "pending": {
               "type": "integer",
               "minimum": 0
              },
              "decided": {
               "type": "integer",
               "minimum": 0
              }
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/automation/approvals/{approvalId}": {
   "get": {
    "operationId": "getAutomationApproval",
    "summary": "One approval through the reader's projection",
    "x-feature": "F-AUT-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/FlowApprovalIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The approval.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationApprovalView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/approvals/{approvalId}/decision": {
   "post": {
    "operationId": "decideAutomationApproval",
    "summary": "Approve or reject the exact proposal",
    "x-feature": "F-AUT-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/FlowApprovalIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationApprovalDecisionInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The decision is recorded.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationApprovalView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/flow-schema": {
   "get": {
    "operationId": "getAutomationFlowSchema",
    "summary": "The block registry, triggers, actions and limits for a scope and the caller",
    "x-feature": "F-AUT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "description": "Omitted for tenant flows.",
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The schema.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationFlowSchemaView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/flow-templates": {
   "get": {
    "operationId": "listAutomationFlowTemplates",
    "summary": "The flow templates by goal, with what each one needs",
    "x-feature": "F-AUT-25",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The templates.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/AutomationFlowTemplateView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/automation/inbound-endpoints": {
   "get": {
    "operationId": "listInboundEndpoints",
    "summary": "The tenant's inbound endpoints",
    "x-feature": "F-AUT-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The endpoints.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/InboundEndpointView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createInboundEndpoint",
    "summary": "Register an endpoint; the answer holds the secret, once",
    "x-feature": "F-AUT-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InboundEndpointInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InboundEndpointSecretView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/inbound-endpoints/{endpointId}": {
   "get": {
    "operationId": "getInboundEndpoint",
    "summary": "One endpoint, without its secret",
    "x-feature": "F-AUT-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/InboundEndpointIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The endpoint.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InboundEndpointView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeInboundEndpoint",
    "summary": "Change the name, availability, address ranges or status",
    "x-feature": "F-AUT-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/InboundEndpointIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InboundEndpointInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Changed.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InboundEndpointView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteInboundEndpoint",
    "summary": "Delete an endpoint that no enabled or paused flow names",
    "x-feature": "F-AUT-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/InboundEndpointIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/inbound-endpoints/{endpointId}/calls": {
   "get": {
    "operationId": "listInboundCalls",
    "summary": "The call log of an endpoint",
    "x-feature": "F-AUT-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/InboundEndpointIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The calls, newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/InboundCallView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/inbound-endpoints/{endpointId}/rotate-secret": {
   "post": {
    "operationId": "rotateInboundSecret",
    "summary": "Issue a new secret, shown once; the previous one stays valid for 24 hours",
    "x-feature": "F-AUT-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/InboundEndpointIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Rotated.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InboundEndpointSecretView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/schema": {
   "get": {
    "operationId": "getAutomationSchema",
    "summary": "The registries for the builder — triggers, attributes, operators, actions, placeholders — for a scope and the caller",
    "x-feature": "F-AUT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "description": "Omitted for tenant rules.",
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The schema.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationSchemaView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/tasks": {
   "get": {
    "operationId": "listAutomationTasks",
    "summary": "The open tasks of the caller",
    "x-feature": "F-AUT-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The tasks, by due time.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AutomationHumanTaskView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/automation/tasks/{taskId}": {
   "get": {
    "operationId": "getAutomationTask",
    "summary": "One task through the reader's projection",
    "x-feature": "F-AUT-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/HumanTaskIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The task.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationHumanTaskView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/tasks/{taskId}/complete": {
   "post": {
    "operationId": "completeAutomationTask",
    "summary": "Complete a task with its typed values",
    "x-feature": "F-AUT-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/HumanTaskIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AutomationHumanTaskInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The task is done.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationHumanTaskView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/templates": {
   "get": {
    "operationId": "listAutomationTemplates",
    "summary": "The template gallery — code-versioned rule definitions with their default instantiation",
    "x-feature": "F-AUT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The templates.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AutomationTemplateView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/automation/usage": {
   "get": {
    "operationId": "getAutomationUsage",
    "summary": "The tenant's automation usage against its plan limits — enabled rules, runs today, webhook endpoints",
    "x-feature": "F-AUT-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Usage lines.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AutomationUsageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/automation/waiting-runs": {
   "get": {
    "operationId": "listWaitingAutomationRuns",
    "summary": "The runs that wait, oldest first; tenant-wide for an Admin, one flow for its manager",
    "x-feature": "F-AUT-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "ruleId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "delay",
        "until",
        "event",
        "approval",
        "task",
        "ai_run",
        "sub_flow"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of runs.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/AutomationWaitingRunRow"
           }
          },
          "meta": {
           "type": "object",
           "description": "The flows that have waiting runs (the \"Flow\" filter, with the kind filter applied), and the page (XM-1294; G-AUA-15, G-AUA-18).",
           "required": [
            "flows",
            "page"
           ],
           "properties": {
            "flows": {
             "type": "array",
             "maxItems": 500,
             "items": {
              "type": "object",
              "required": [
               "id",
               "name",
               "waiting"
              ],
              "properties": {
               "id": {
                "$ref": "#/components/schemas/Uuid"
               },
               "name": {
                "type": "string",
                "maxLength": 120
               },
               "waiting": {
                "type": "integer",
                "minimum": 1
               }
              }
             }
            },
            "page": {
             "type": "object",
             "required": [
              "size",
              "hasMore"
             ],
             "properties": {
              "size": {
               "type": "integer",
               "enum": [
                50
               ]
              },
              "hasMore": {
               "type": "boolean"
              }
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/client-organisations": {
   "get": {
    "operationId": "listClientOrganisations",
    "summary": "The directory and the organisation picker",
    "x-feature": "F-REL-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "all"
       ],
       "default": "active"
      }
     },
     {
      "name": "filter[pinned]",
      "in": "query",
      "required": false,
      "description": "F-REL-01.R20: true keeps only the organisations that the reader pinned (`/me/client-pins`).",
      "schema": {
       "type": "string",
       "enum": [
        "true",
        "false"
       ],
       "default": "false"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 25
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The visible organisations with totals and segment counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/ClientDirectoryRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/ClientDirectoryMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createClientOrganisation",
    "summary": "Create a client organisation",
    "x-feature": "F-REL-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientOrganisationCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new organisation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientDirectoryRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/client-organisations/{organisationId}": {
   "get": {
    "operationId": "getClientCard",
    "summary": "The client card — details, counts and the reader's projects",
    "x-feature": "F-REL-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The card; the ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientCardView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateClientOrganisation",
    "summary": "Rename an organisation or change its website",
    "x-feature": "F-REL-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ClientOrganisationPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated organisation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientDirectoryRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteClientOrganisation",
    "summary": "Delete an organisation that nothing refers to",
    "x-feature": "F-REL-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/client-organisations/{organisationId}/archive": {
   "post": {
    "operationId": "archiveClientOrganisation",
    "summary": "Archive an organisation — hidden from pickers, every reference kept",
    "x-feature": "F-REL-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived organisation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientDirectoryRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/client-organisations/{organisationId}/contacts": {
   "get": {
    "operationId": "listOrganisationContacts",
    "summary": "The contacts of an organisation with their portal status — the card's table",
    "x-feature": "F-REL-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "all"
       ],
       "default": "active"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 25
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of contacts by name.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ContactPage"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createContact",
    "summary": "Add a contact to an organisation",
    "x-feature": "F-REL-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ContactCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new contact.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/client-organisations/{organisationId}/projects": {
   "get": {
    "operationId": "listClientProjects",
    "summary": "The projects of an organisation in the reader's scope, past the card's first 25",
    "x-feature": "F-REL-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of at most 50 projects by name.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ClientProjectPage"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/client-organisations/{organisationId}/restore": {
   "post": {
    "operationId": "restoreClientOrganisation",
    "summary": "Restore an archived organisation",
    "x-feature": "F-REL-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ClientOrganisationIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The restored organisation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientDirectoryRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/client-sharing/projects": {
   "get": {
    "operationId": "listClientSharingSummaries",
    "summary": "The tenant's Client sharing list — each visible active project's sharing summary, by key",
    "description": "XM-1469 (F-ACC-09.R15). Needs `administer` on Administration › Client sharing. One keyset page of the visible active projects in key order, then the facts of the page's projects only. `meta.totals.projects` is the number of projects that `q` matches. `meta.totals.projectsWithGuests` is the number of visible active projects with a client guest, whatever `q`.",
    "x-feature": "F-ACC-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "description": "The name contains it (case-insensitive) or the key starts with it; 1–120 characters after trimming.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        10,
        25,
        50,
        100
       ],
       "default": 10
      }
     },
     {
      "name": "page[cursor]",
      "in": "query",
      "description": "The cursor of `links.next`; it is bound to `q`.",
      "schema": {
       "type": "string",
       "maxLength": 512
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of projects with their sharing summary, and the list's figures.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/ClientSharingSummaryRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "totals"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "totals": {
             "type": "object",
             "required": [
              "projects",
              "projectsWithGuests"
             ],
             "properties": {
              "projects": {
               "type": "integer",
               "minimum": 0
              },
              "projectsWithGuests": {
               "type": "integer",
               "minimum": 0
              }
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/comments/{commentId}": {
   "patch": {
    "operationId": "editComment",
    "summary": "Edit one's own comment within the tenant's edit window",
    "x-feature": "F-WRK-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/CommentPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The comment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteComment",
    "summary": "Delete a comment (soft, audited)",
    "x-feature": "F-WRK-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/comments/{commentId}/reactions/{emoji}": {
   "put": {
    "operationId": "addCommentReaction",
    "summary": "Add the caller's own reaction with one emoji to a comment (idempotent)",
    "x-feature": "F-WRK-38",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "emoji",
      "in": "path",
      "required": true,
      "description": "The emoji, percent-encoded; a catalogue entry (F-WRK-38.R02).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 64
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The comment as the caller now reads it, with its reactions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeCommentReaction",
    "summary": "Remove the caller's own reaction with one emoji from a comment (idempotent)",
    "x-feature": "F-WRK-38",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "emoji",
      "in": "path",
      "required": true,
      "description": "The emoji, percent-encoded; a catalogue entry (F-WRK-38.R02).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 64
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The comment as the caller now reads it, with its reactions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/comments/{commentId}/reopen": {
   "post": {
    "operationId": "reopenComment",
    "summary": "Reopen a resolved top-level comment (F-WRK-21.R19; idempotent)",
    "x-feature": "F-WRK-21",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The comment, open (also when it was open already; then nothing changed).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/comments/{commentId}/replies": {
   "get": {
    "operationId": "listCommentReplies",
    "summary": "The replies of a top-level comment, oldest first (F-WRK-21.R16)",
    "x-feature": "F-WRK-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of at most 100 replies, oldest first; links.next names the later page while one exists. A reply has no replies (an empty page).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/CommentReplyView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/comments/{commentId}/resolve": {
   "post": {
    "operationId": "resolveComment",
    "summary": "Resolve a top-level comment (F-WRK-21.R19; idempotent)",
    "x-feature": "F-WRK-21",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The comment, resolved (also when it was resolved already; then nothing changed).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts": {
   "get": {
    "operationId": "searchContacts",
    "summary": "The contact picker across the organisations the caller may see",
    "x-feature": "F-REL-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "filter[organisationId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[projectKey]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "all"
       ],
       "default": "active"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 10
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matching contacts with their organisation.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ContactPickerPage"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts/export": {
   "post": {
    "operationId": "exportContacts",
    "summary": "CSV of a selection of contacts or of a filtered set",
    "x-feature": "F-REL-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ContactExportRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "A streamed text/csv attachment (up to 100,000 rows); the audit record was committed before the first byte.",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "202": {
      "description": "An export operation for larger sets; its result is the file id and row count, read with GET /operations/{id}.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts/{contactId}": {
   "get": {
    "operationId": "getContact",
    "summary": "The contact panel",
    "x-feature": "F-REL-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ContactIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The contact with its organisation, linked guest and portal entries; the ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateContact",
    "summary": "Edit a contact — name and e-mail only while unlinked",
    "x-feature": "F-REL-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ContactIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ContactPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated contact.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts/{contactId}/archive": {
   "post": {
    "operationId": "archiveContact",
    "summary": "Archive a contact — hidden from pickers, link and access kept",
    "x-feature": "F-REL-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ContactIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived contact.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts/{contactId}/erase": {
   "post": {
    "operationId": "eraseContact",
    "summary": "Erase a contact — irreversible",
    "x-feature": "F-REL-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ContactIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The erased contact's pseudonym and whether the certificate has been recorded; a repeat returns the same.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactErasureResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts/{contactId}/invite": {
   "post": {
    "operationId": "inviteContactToPortal",
    "summary": "Invite a contact to a project's client portal",
    "x-feature": "F-REL-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ContactIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ContactInviteRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The invitation was created, or resent.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactInviteResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts/{contactId}/invite-options": {
   "get": {
    "operationId": "getContactInviteOptions",
    "summary": "The projects a contact can be invited to, with their client versions and the contact's state on each",
    "x-feature": "F-REL-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ContactIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "Eligibility, the reason when there is none, and the eligible projects.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactInviteOptions"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/contacts/{contactId}/restore": {
   "post": {
    "operationId": "restoreContact",
    "summary": "Restore an archived contact",
    "x-feature": "F-REL-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ContactIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The restored contact.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContactRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations": {
   "get": {
    "operationId": "listConversations",
    "summary": "The Messages inbox",
    "x-feature": "F-MSG-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[kind]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "array",
       "items": {
        "$ref": "#/components/schemas/ConversationKind"
       }
      },
      "style": "form",
      "explode": true
     },
     {
      "name": "filter[unread]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived"
       ],
       "default": "active"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        25,
        50,
        100
       ],
       "default": 25
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The member's conversations by last activity, with unread counts.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ConversationPage"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "startConversation",
    "summary": "Start a direct conversation (200 when the pair exists) or create a group",
    "x-feature": "F-MSG-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConversationStartRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The existing direct conversation of the pair.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ConversationView"
          }
         }
        }
       }
      }
     },
     "201": {
      "description": "The new conversation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ConversationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/unread-summary": {
   "get": {
    "operationId": "getUnreadSummary",
    "summary": "The sidebar badge — conversations with unread messages",
    "x-feature": "F-MSG-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The number of conversations with unread messages, capped, split by kind.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/UnreadSummary"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}": {
   "get": {
    "operationId": "getConversation",
    "summary": "One conversation with its channel, roster and permissions",
    "x-feature": "F-MSG-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The conversation document; the ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ConversationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "renameConversation",
    "summary": "Rename a group",
    "x-feature": "F-MSG-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ConversationPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The renamed group.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ConversationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}/archive": {
   "post": {
    "operationId": "archiveConversation",
    "summary": "Archive a group — read-only from now on",
    "x-feature": "F-MSG-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived group.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ConversationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}/leave": {
   "post": {
    "operationId": "leaveConversation",
    "summary": "Leave a group",
    "x-feature": "F-MSG-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Left; the group is gone from the caller's inbox."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}/messages": {
   "get": {
    "operationId": "listConversationMessages",
    "summary": "A page of messages by sequence (latest page without parameters)",
    "x-feature": "F-MSG-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     },
     {
      "name": "after",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     },
     {
      "name": "before",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 50
      }
     },
     {
      "name": "period",
      "in": "query",
      "required": false,
      "description": "A client period number of a project conversation, internal readers only.",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Messages ascending by sequence with tombstones and attachment statuses.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MessagePage"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "postConversationMessage",
    "summary": "Post a message in a conversation",
    "x-feature": "F-MSG-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MessagePostRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The posted message.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MessageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}/mute": {
   "put": {
    "operationId": "muteConversation",
    "summary": "Mute or unmute a conversation for the caller",
    "x-feature": "F-MSG-07",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MuteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The caller's read state for the conversation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReadStateView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}/participants": {
   "post": {
    "operationId": "addConversationParticipants",
    "summary": "Add members to a group",
    "x-feature": "F-MSG-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ParticipantAddRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The group with its new roster.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ConversationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}/participants/{memberId}": {
   "delete": {
    "operationId": "removeConversationParticipant",
    "summary": "Remove a participant from a group — access ends at once",
    "x-feature": "F-MSG-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     },
     {
      "$ref": "#/components/parameters/ParticipantMemberIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Removed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/conversations/{conversationId}/read": {
   "put": {
    "operationId": "markConversationRead",
    "summary": "Move the caller's read marker (monotonic)",
    "x-feature": "F-MSG-07",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ConversationIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReadMarkRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The caller's read state for the conversation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReadStateView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/custom-fields": {
   "get": {
    "operationId": "listCustomFields",
    "summary": "The tenant's custom-field library",
    "x-feature": "F-PRJ-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "Keeps the fields whose name contains this text, in any case (F-PRJ-13.R13). 1–120 characters after normalisation.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "all"
       ],
       "default": "all"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        25,
        50,
        100
       ],
       "default": 50
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Fields with their project counts, active first by name, then archived; deleting fields marked.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/CustomFieldView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "activeCount"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            },
            "activeCount": {
             "type": "integer",
             "minimum": 0
            },
            "limit": {
             "type": "integer",
             "minimum": 0
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createCustomField",
    "summary": "Define a custom field",
    "x-feature": "F-PRJ-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CustomFieldCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The created field.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomFieldView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/custom-fields/{fieldId}": {
   "get": {
    "operationId": "getCustomField",
    "summary": "One field with its value and project counts",
    "x-feature": "F-PRJ-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/CustomFieldIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The field; ETag carries its version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomFieldView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateCustomField",
    "summary": "Change name, description, configuration, options or client class; key and type never change",
    "x-feature": "F-PRJ-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/CustomFieldIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/CustomFieldPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed field.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomFieldView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/custom-fields/{fieldId}/archive": {
   "post": {
    "operationId": "archiveCustomField",
    "summary": "Archive a field — hidden everywhere, values kept",
    "x-feature": "F-PRJ-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/CustomFieldIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived field.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomFieldView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/custom-fields/{fieldId}/delete": {
   "post": {
    "operationId": "deleteCustomField",
    "summary": "Delete a field and purge its values; with dryRun only the counts and references",
    "x-feature": "F-PRJ-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/CustomFieldIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "dryRun",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The counts and references; deleted false for a dry run, true once the field entered deleting.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomFieldDeletion"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/custom-fields/{fieldId}/restore": {
   "post": {
    "operationId": "restoreCustomField",
    "summary": "Restore an archived field within the plan limit",
    "x-feature": "F-PRJ-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/CustomFieldIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The active field.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomFieldView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/dashboard": {
   "get": {
    "operationId": "getDashboard",
    "summary": "The member's home — counts, My work, the pinned panel and Needs attention, all under the member's access",
    "x-feature": "F-WSP-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The Dashboard read model.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DashboardView"
          },
          "meta": {
           "type": "object",
           "description": "F-WSP-05.R13–R15 — the reader's widgets (view `dashboard`, F-WRK-41). Absent when the read failed.",
           "properties": {
            "viewPreference": {
             "$ref": "#/components/schemas/ViewPreference"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/dashboard/needs-attention": {
   "get": {
    "operationId": "listNeedsAttention",
    "summary": "The full Needs attention list — over-estimate and approval-pending tickets in the member's scope",
    "x-feature": "F-WSP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 25 with the total.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/NeedsAttentionPage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/delivery-roles": {
   "get": {
    "operationId": "listDeliveryRoles",
    "summary": "The tenant's delivery roles (names only, no rates)",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[archived]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The roles in their order. The active list holds at most 200 roles. The archived list holds every archived role and can be longer, up to the bound of 10,000 roles for one tenant (archived roles are never deleted); above that bound the answer is 409 limit.reached (dimension delivery_roles). The ETag is the list's version (fix round 24 Nov 2026, F1).",
      "headers": {
       "ETag": {
        "description": "The list's version in quotes (meta.version).",
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 10000,
           "items": {
            "$ref": "#/components/schemas/DeliveryRoleView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/DeliveryRoleListMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "replaceDeliveryRoles",
    "summary": "Replace the list of delivery roles — add, rename, reorder and archive",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "If-Match",
      "in": "header",
      "required": false,
      "description": "OPTIONAL (fix round 24 Nov 2026, F1, the lost updates): the version of the list in quotes (meta.version of the read). A different version answers 412 stale-version with currentVersion, and nothing changes; absent compares nothing.",
      "schema": {
       "type": "string",
       "pattern": "^\"[0-9]+\"$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DeliveryRolesReplaceRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The roles; the ETag is the list's new version.",
      "headers": {
       "ETag": {
        "description": "The list's version in quotes (meta.version).",
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/DeliveryRoleView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/DeliveryRoleListMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-activity": {
   "get": {
    "operationId": "getDocActivity",
    "summary": "The team's doc edits of the last 7 days and the 7 days before, with the latest edited pages (the Documents sidebar)",
    "x-feature": "F-DOC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The edit summary under the reader's draft read.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocActivitySummary"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-agent-changes/{changeId}/decision": {
   "post": {
    "operationId": "decideDocAgentChange",
    "summary": "Apply or reject an agent's pending change",
    "x-feature": "F-DOC-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "changeId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocAgentChangeDecision"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The change after the decision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocAgentChangeView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-backlinks": {
   "get": {
    "operationId": "listDocBacklinksForTarget",
    "summary": "The readable pages that link to a ticket, a knowledge item, an opportunity or a request",
    "x-feature": "F-DOC-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "targetKind",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "ticket",
        "knowledge_item",
        "opportunity",
        "help_desk_request"
       ]
      }
     },
     {
      "name": "targetRef",
      "in": "query",
      "required": true,
      "description": "A ticket key, a knowledge item key, an opportunity id or a request key.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 60
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of backlinks.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocBacklinkView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-comment-threads/{threadId}": {
   "get": {
    "operationId": "getDocCommentThread",
    "summary": "One thread with its comments, 100 per page",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocThreadIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The thread.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocThreadView"
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-comment-threads/{threadId}/comments": {
   "post": {
    "operationId": "postDocComment",
    "summary": "Reply in a thread (and reopen a resolved one when asked)",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocThreadIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocCommentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new comment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocCommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-comment-threads/{threadId}/reopen": {
   "post": {
    "operationId": "reopenDocCommentThread",
    "summary": "Reopen a resolved thread",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocThreadIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The thread, open or orphaned.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocThreadView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-comment-threads/{threadId}/resolve": {
   "post": {
    "operationId": "resolveDocCommentThread",
    "summary": "Resolve a thread",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocThreadIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The resolved thread.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocThreadView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-comments/{commentId}": {
   "patch": {
    "operationId": "editDocComment",
    "summary": "Edit an own comment",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocCommentIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocCommentRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The edited comment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocCommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteDocComment",
    "summary": "Delete an own comment, or remove one as a space admin",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocCommentIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "The comment is a tombstone."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}": {
   "get": {
    "operationId": "getDocPage",
    "summary": "The page for the reading pane — head version (or published revision), tag, publication and affordances",
    "x-feature": "F-DOC-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The page; ETag carries its aggregate version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "renameDocPage",
    "summary": "Change the title, meeting date or child order (never the body)",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/DocPagePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The page; a title change carries the retitle version as the head when one was recorded.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteDocPage",
    "summary": "Move the node and its children to the trash, exactly as previewed",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "previewed",
      "in": "query",
      "required": false,
      "description": "The comma-separated page ids of the deletion preview (1–501). Exactly one of previewed and previewDigest; previewDigest is required above 501 pages (Spec DS-1, F-DOC-13.R20). Neither, both or more than 501 ids answer 422 validation.failed with doc_page.preview_missing; a malformed id or a list form answers 400 query.invalid.",
      "schema": {
       "type": "string",
       "maxLength": 18600
      }
     },
     {
      "name": "previewDigest",
      "in": "query",
      "required": false,
      "description": "Spec DS-1 — the previewDigest of the deletion preview (F-DOC-13.R20), as the preview gives it. A malformed digest or a list form answers 400 query.invalid.",
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-f]{64}$"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The batch is in the trash."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/admin-access": {
   "post": {
    "operationId": "openDocPageAsAdmin",
    "summary": "A tenant Admin opens a page outside its audience — an explicit act, audited with a reason (register §76)",
    "x-feature": "F-DOC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocResetRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The page as the Admin may read it for this purpose.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/attachments": {
   "get": {
    "operationId": "listDocPageAttachments",
    "summary": "The files attached to a page, with their state and where they are used",
    "x-feature": "F-DOC-17",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The attachments.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/DocAttachmentView"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "attachFileToDocPage",
    "summary": "Bind an uploaded file (purpose attachment, target doc_page) to the page",
    "x-feature": "F-DOC-17",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocAttachRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The file was already attached; the existing attachment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocAttachmentView"
          }
         }
        }
       }
      }
     },
     "201": {
      "description": "The attachment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocAttachmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/attachments/{fileId}": {
   "delete": {
    "operationId": "detachFileFromDocPage",
    "summary": "Detach a file that no current published revision references",
    "x-feature": "F-DOC-17",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The file is detached."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/backlinks": {
   "get": {
    "operationId": "listDocPageBacklinks",
    "summary": "The readable pages that link to this page",
    "x-feature": "F-DOC-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of backlinks.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocBacklinkView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/body": {
   "put": {
    "operationId": "writeDocPageBody",
    "summary": "Apply a new body (rich text or Markdown) to a page's draft as one recorded version, from a named base",
    "x-feature": "F-DOC-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocBodyWriteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The outcome and the recorded version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocBodyWriteResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/client-tag": {
   "get": {
    "operationId": "getDocClientTagConsequence",
    "summary": "What tagging this page would show to which client, now",
    "x-feature": "F-DOC-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The current client organisation and version, whether a revision becomes visible at once, and the guest count.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocClientTagConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "setDocClientTag",
    "summary": "Share the page with the project's client (stamped) or stop sharing it",
    "x-feature": "F-DOC-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocClientTagRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The page with its tag state; unchanged when the request matched the current state.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/collab-sessions": {
   "post": {
    "operationId": "openDocSession",
    "summary": "Open a document session (write or watch) and receive a short-lived token for the collaboration server",
    "x-feature": "F-DOC-06",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocSessionRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The grant; mode may be narrower than requested, with the reason.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSessionGrant"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/collab-sessions/{sessionId}/renew": {
   "post": {
    "operationId": "renewDocSession",
    "summary": "Re-decide access and receive a fresh single-use token with the current mode",
    "x-feature": "F-DOC-07",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/DocSessionIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "A fresh grant; the mode may be narrower than before.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSessionGrant"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/comment-threads": {
   "get": {
    "operationId": "listDocCommentThreads",
    "summary": "A page's comment threads by state, newest activity first",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "open",
        "resolved",
        "orphaned",
        "all"
       ],
       "default": "open"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of threads.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocThreadView"
           }
          },
          "meta": {
           "allOf": [
            {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            {
             "type": "object",
             "properties": {
              "nextCursor": {
               "type": "string"
              },
              "commentCount": {
               "type": "integer",
               "minimum": 0,
               "description": "The live comments of the page's threads that are not resolved: the number on the Comments button."
              },
              "can": {
               "type": "object",
               "required": [
                "comment"
               ],
               "properties": {
                "comment": {
                 "type": "boolean",
                 "description": "The reader may open a thread or reply now."
                }
               }
              }
             }
            }
           ]
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "openDocCommentThread",
    "summary": "Open a page-level or an inline comment thread with its first comment",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocThreadCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new thread; an inline thread is open, and orphaned when a recorded version does not hold its mark.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocThreadView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/copy": {
   "post": {
    "operationId": "copyDocPage",
    "summary": "Copy a page, with or without its children, to a parent of any space the member can edit",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocCopyRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The copy's root page and the page count; subtreeJob is present when a job finishes a large copy.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocCopyResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/deletion-preview": {
   "get": {
    "operationId": "previewDocPageDeletion",
    "summary": "The exact pages a delete would trash that the reader can read, with the tagged count, the restore deadline and the blockers",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The preview.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocDeletePreview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/draft/reset": {
   "post": {
    "operationId": "resetDocDraft",
    "summary": "Admin repair — start a new epoch of the draft from the head version, fencing the old one",
    "x-feature": "F-DOC-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocResetRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The epoch advanced and sessions closed; the reset version follows when the server confirms.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/duplicate": {
   "post": {
    "operationId": "duplicateDocPage",
    "summary": "Duplicate a page: the page alone as \"<title> (copy)\", right after the original",
    "description": "Owner Q5 (24 Nov 2026, register §230 add. 100). The edit right on the page; a page only (409 doc_page.not_duplicable for a section or a whiteboard). The copy is not shared with a client and not published (register §75); it has no comments, versions, watchers or attachments of the original; its creator watches it. Its body — the original's current body, with copies of the files the body shows — arrives after the commit.",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "201": {
      "description": "The copy, untagged and without a version yet.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/git-conflict": {
   "get": {
    "operationId": "getDocGitConflict",
    "summary": "One page's Git conflict with the Git body",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The conflict.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocGitConflictView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/git-conflict/resolve": {
   "post": {
    "operationId": "resolveDocGitConflict",
    "summary": "Keep Youniton's or Git's content for a page in conflict",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocGitConflictResolution"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The page after the resolution.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/git-exclusion": {
   "put": {
    "operationId": "setDocPageGitExclusion",
    "summary": "Keep a page and its subtree out of Git sync, or let them back in — the page owner or a project admin (register §76)",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocGitExclusionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The visibility view with keepOutOfGit.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageRestrictionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/links": {
   "get": {
    "operationId": "listDocPageLinks",
    "summary": "The outgoing links of a page's latest version, each in its state for the reader",
    "x-feature": "F-DOC-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The links; truncated is true when the version had more than 1,000 targets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 1000,
           "items": {
            "$ref": "#/components/schemas/DocLinkView"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "truncated": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/markdown": {
   "get": {
    "operationId": "getDocPageMarkdown",
    "summary": "A page's latest version or published revision as Markdown",
    "x-feature": "F-DOC-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "name": "source",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "head",
        "published_revision"
       ],
       "default": "head"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The page as Markdown.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocMarkdownView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/move-preview": {
   "get": {
    "operationId": "previewDocPageMove",
    "summary": "What a move of the page and its subtree would change — size, audience, blockers and depth",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "name": "spaceId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "parentId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The preview.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocMovePreview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/owner": {
   "put": {
    "operationId": "transferDocPageOwner",
    "summary": "Hand a page to another owner — the page owner or a project admin",
    "x-feature": "F-DOC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPageOwnerRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The visibility view with the new owner.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageRestrictionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/position": {
   "put": {
    "operationId": "moveDocPage",
    "summary": "Move a node to a parent (or the top level) between two neighbours",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPagePositionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The node with its new parent and position.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTreeNode"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/public": {
   "put": {
    "operationId": "setDocPagePublic",
    "summary": "Set or clear one page's public flag",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPublicFlagRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The flag and whether the page is on the internet now.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPublicFlagView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/publish": {
   "post": {
    "operationId": "publishDocPage",
    "summary": "Publish exactly the named version whose digest the dialog showed",
    "x-feature": "F-DOC-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPublishRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new revision (200 with the current revision when that version is already published).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocRevisionSummary"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/realtime": {
   "get": {
    "operationId": "getDocPagePresenceChannel",
    "summary": "The doc page's presence channel, with the project's audience epoch (F-WRK-37)",
    "description": "`presence-tenant.{t}.project.{p}.doc.{page}.v{n}.a{m}` (R03a), opened like the page's read (`DocsGate::page`): a hidden page, a client audience or the Docs module off answer as the read does. Docs builds it.",
    "x-feature": "F-WRK-37",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The channel to join.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "presenceChannel"
           ],
           "properties": {
            "presenceChannel": {
             "$ref": "#/components/schemas/PresenceChannelName"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/restore": {
   "post": {
    "operationId": "restoreDocPage",
    "summary": "Restore the trashed batch this page belongs to",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "requestBody": {
     "required": false,
     "description": "Spec DS-1 — the acknowledgement of a restore that broadens the audience or opens a client path (F-DOC-13.R17).",
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocTrashRestoreRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The restored nodes in their places that the restorer can read now (Spec DS-1, F-DOC-13.R21); empty with meta.subtreeJob when a subtree job finishes the restore.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 501,
           "items": {
            "$ref": "#/components/schemas/DocTreeNode"
           }
          },
          "meta": {
           "type": "object",
           "properties": {
            "subtreeJob": {
             "$ref": "#/components/schemas/DocSubtreeJobView"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/revisions": {
   "get": {
    "operationId": "listDocRevisions",
    "summary": "The page's published revisions, newest first",
    "x-feature": "F-DOC-09",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of revisions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocRevisionPage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/versions": {
   "get": {
    "operationId": "listDocPageVersions",
    "summary": "The page's retained versions, newest first, with the revisions that bind them",
    "x-feature": "F-DOC-04",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of versions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocVersionPage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "recordDocVersionNow",
    "summary": "Record a version of the draft now for the Publish dialog and answer it with its diff and outcome",
    "x-feature": "F-DOC-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The answered version (recorded, unchanged, covered, or the head when superseded) with its diff against the current revision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocRecordNowResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/versions/compare": {
   "get": {
    "operationId": "compareDocPageVersions",
    "summary": "The block diff and the title change between two versions of a page",
    "x-feature": "F-DOC-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The diff.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocVersionDiff"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/versions/{number}": {
   "get": {
    "operationId": "getDocPageVersion",
    "summary": "One version's frozen title and body",
    "x-feature": "F-DOC-04",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/DocVersionNumberPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocVersionView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/versions/{number}/restore": {
   "post": {
    "operationId": "restoreDocPageVersion",
    "summary": "Apply a version to the live draft as a new version, optionally publishing the result",
    "x-feature": "F-DOC-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/DocVersionNumberPath"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocRestoreRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The recording outcome, the answered version and whether it was published.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocRestoreResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/visibility": {
   "get": {
    "operationId": "getDocPageVisibility",
    "summary": "A page's owner, own and inherited audience, edit restriction and client setting",
    "x-feature": "F-DOC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The visibility view.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageRestrictionView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "setDocPageAudience",
    "summary": "Set a page's audience (kind view) or edit restriction (kind edit) — the page owner or a project admin, or a tenant Admin with an override reason",
    "x-feature": "F-DOC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocRestrictionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The visibility view; subtreeJob is present when a job rewrites a large subtree.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageRestrictionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/watch": {
   "put": {
    "operationId": "watchDocPage",
    "summary": "Watch a page",
    "description": "The caller (an internal member who can read the page) starts to watch it; idempotent by state, no If-Match and no Idempotency-Key. A hidden, foreign, trashed or unknown page and a client answer 404 doc_page.not_found; a preview answers 403 preview.read_only.",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The member's watch state for the page and its space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocWatchState"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unwatchDocPage",
    "summary": "Stop watching a page",
    "description": "The caller stops watching the page; idempotent by state. The refusals are the ones of watchDocPage.",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The member's watch state.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocWatchState"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-pages/{pageId}/withdraw-publication": {
   "post": {
    "operationId": "withdrawDocPublication",
    "summary": "Hide the page from clients until the next publication",
    "x-feature": "F-DOC-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The page with its publication state withdrawn.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-search": {
   "get": {
    "operationId": "searchDocs",
    "summary": "Find pages by their words in one space or in every space the reader can read",
    "x-feature": "F-DOC-18",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "search_docs",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [],
     "description": "Search the document pages that you can read."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "spaceId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "lastEditorId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "updatedFrom",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "updatedTo",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of hits; meta.limitReached is true when more than 200 results exist.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/DocSearchHit"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "size",
            "hasMore"
           ],
           "properties": {
            "size": {
             "type": "integer",
             "minimum": 1,
             "maximum": 20
            },
            "hasMore": {
             "type": "boolean"
            },
            "limitReached": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-shared-pages": {
   "get": {
    "operationId": "listDocSharedPages",
    "summary": "The pages shared with clients across every project that the reader may see (the Documents sidebar)",
    "x-feature": "F-DOC-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 1024
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The shared pages, newest share first, 50 per page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocSharedPageItem"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "total",
            "totalCapped"
           ],
           "properties": {
            "total": {
             "type": "integer",
             "minimum": 0,
             "maximum": 1000
            },
            "totalCapped": {
             "type": "boolean"
            },
            "nextCursor": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces": {
   "get": {
    "operationId": "listDocSpaces",
    "summary": "The spaces the reader can read, with the reader's level",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DocSpaceKind"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "A part of the space's name, without regard to case. It applies in every lifecycle (live, archived and trash).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 80
      }
     },
     {
      "name": "lifecycle",
      "in": "query",
      "required": false,
      "description": "live (the active spaces) by default; archived lists the archived spaces and trash the deleted spaces that the reader administers (owner, 23 Nov 2026).",
      "schema": {
       "type": "string",
       "enum": [
        "live",
        "archived",
        "trash"
       ],
       "default": "live"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of spaces.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocSpaceRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/DocSpaceListMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createDocSpace",
    "summary": "Create a tenant or team space with its default grants and its home page",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocSpaceCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}": {
   "get": {
    "operationId": "getDocSpace",
    "summary": "One space with its settings, counts and the reader's possible actions",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateDocSpace",
    "summary": "Change a space's key, name, description, home page or default template (the access settings are setDocSpaceAccessSettings)",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/DocSpacePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteDocSpace",
    "summary": "Move a tenant or team space and all its pages to the trash, exactly as previewed",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "pageCount",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     },
     {
      "name": "clientVisibleCount",
      "in": "query",
      "required": false,
      "description": "0 for a company or team space (no client-visible page in this form).",
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     },
     {
      "name": "publicCount",
      "in": "query",
      "required": false,
      "description": "0 for a company or team space (no public page in this form).",
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The space and its pages are in the trash."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/access-settings": {
   "put": {
    "operationId": "setDocSpaceAccessSettings",
    "summary": "Change the space settings that decide who sees what — the default audience, the reader source and client comments",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocSpaceAccessSettingsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/activity": {
   "get": {
    "operationId": "listDocSpaceActivity",
    "summary": "The space's recent changes for the pages the reader can read",
    "x-feature": "F-DOC-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "created",
        "version",
        "published",
        "withdrawn",
        "moved",
        "trashed",
        "restored",
        "commented"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of activity rows.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocActivityItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/agent-changes": {
   "get": {
    "operationId": "listDocAgentChanges",
    "summary": "The pending agent changes of a space for the members who can apply them",
    "x-feature": "F-DOC-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "pending",
        "applied",
        "rejected",
        "expired"
       ],
       "default": "pending"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of agent changes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocAgentChangeView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/archive": {
   "post": {
    "operationId": "archiveDocSpace",
    "summary": "Make a space read-only",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/client-links": {
   "get": {
    "operationId": "listDocSpaceClientLinks",
    "summary": "The projects whose portals a tenant or team space is linked to, with each link's state",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The links.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocClientLinkView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/client-links/{projectKey}": {
   "put": {
    "operationId": "linkDocSpaceToProject",
    "summary": "Link (or re-link) a tenant or team space to a project's portal for the confirmed client version",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocClientLinkRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The current link.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocClientLinkView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unlinkDocSpaceFromProject",
    "summary": "Remove a space's link to a project's portal",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "204": {
      "description": "The link is removed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/client-links/{projectKey}/consequence": {
   "get": {
    "operationId": "getDocClientLinkConsequence",
    "summary": "What linking the space to the project's portal would show to the client",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The consequence and the client version to confirm.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocClientLinkConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/deletion-preview": {
   "get": {
    "operationId": "previewDocSpaceDeletion",
    "summary": "What a delete of the space would hide, with the restore deadline and any blocker",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The preview.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceDeletionPreview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/exports": {
   "post": {
    "operationId": "exportDocSpace",
    "summary": "Export the pages of a space that the requester can read as a ZIP of Markdown files",
    "x-feature": "F-DOC-25",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
         "includeComments": {
          "type": "boolean",
          "default": false
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The export operation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/git-sync": {
   "get": {
    "operationId": "getDocGitSync",
    "summary": "The space's Git sync and its status",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The sync.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocGitSyncView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "configureDocGitSync",
    "summary": "Create or change the space's Git sync (branch, folder, direction, content)",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocGitSyncRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The sync; an initial or reconcile run is queued.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocGitSyncView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "disconnectDocGitSync",
    "summary": "Stop the space's Git sync (the repository's files stay)",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "The sync is disconnected."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/git-sync/conflicts": {
   "get": {
    "operationId": "listDocGitConflicts",
    "summary": "The pages that changed in Git and in Youniton since the last sync",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of conflicts (without the Git body; read one page's conflict for it).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocGitConflictView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/git-sync/runs": {
   "get": {
    "operationId": "listDocGitRuns",
    "summary": "The sync's runs, newest first, for 90 days",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of runs.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocGitRunView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "requestDocGitRun",
    "summary": "Start a reconcile run now",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "202": {
      "description": "The queued run.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocGitRunView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/grants": {
   "get": {
    "operationId": "getDocSpaceGrants",
    "summary": "The grants of a tenant or team space with the principals' current names",
    "x-feature": "F-DOC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The grants and the version to send back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceGrantList"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "replaceDocSpaceGrants",
    "summary": "Replace the grants of a tenant or team space",
    "x-feature": "F-DOC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocSpaceGrantsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new grants.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceGrantList"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/page-index": {
   "get": {
    "operationId": "listDocSpacePageIndex",
    "summary": "Every page of a space the reader can read, in tree order, 200 per page",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of the index.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/DocSpacePageIndexItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/pages": {
   "get": {
    "operationId": "listDocSpaceTreeLevel",
    "summary": "One level of a space's tree (the top level, or one parent's children)",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "name": "parentId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The level.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceTreeLevel"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createDocSpacePage",
    "summary": "Create a page or a section in a space, at any allowed depth, from a template or empty",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocSpacePageCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/public-pages": {
   "get": {
    "operationId": "listDocPublicPages",
    "summary": "The pages of the space that carry the public flag",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of public pages.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/DocSpacePageIndexItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "setDocPagesPublic",
    "summary": "Set or clear the public flag of up to 200 named pages",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPublicBulkRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The counts of changed and unchanged pages.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPublicBulkResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/public-site": {
   "get": {
    "operationId": "getDocPublicSite",
    "summary": "The space's public site, its status, address and domain",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The site.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPublicSiteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "configureDocPublicSite",
    "summary": "Create or change the space's public site configuration (draft until published)",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPublicSiteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The site.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPublicSiteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/public-site/domain": {
   "put": {
    "operationId": "setDocSiteDomain",
    "summary": "Add or replace the site's custom domain (pending until verified)",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocSiteDomainRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The domain with the DNS records to create.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSiteDomainView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeDocSiteDomain",
    "summary": "Remove the site's custom domain",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "The domain is removed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/public-site/domain/verify": {
   "post": {
    "operationId": "verifyDocSiteDomain",
    "summary": "Check the domain's DNS records now",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The domain's state after the check.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSiteDomainView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/public-site/publish": {
   "post": {
    "operationId": "publishDocPublicSite",
    "summary": "Put the public site on the internet",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The published site.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPublicSiteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/public-site/unpublish": {
   "post": {
    "operationId": "unpublishDocPublicSite",
    "summary": "Take the public site off the internet",
    "x-feature": "F-DOC-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The unpublished site.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPublicSiteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/publish-batch": {
   "post": {
    "operationId": "publishDocPageBatch",
    "summary": "Publish up to 50 pages of a space at once, each by its exact version and digest — all or none",
    "x-feature": "F-DOC-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPublishBatchRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "One new revision per page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocPublishBatchResultItem"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/realtime": {
   "get": {
    "operationId": "getDocSpaceRealtimeChannel",
    "summary": "The channel of a company or team space's doc_space.changed (realtime, owner 23 Nov 2026)",
    "description": "`private-tenant.{t}.doc-space.{s}.v{n}.m{audience}` — `n` is the audience epoch: it moves when a membership, a role or a sign-in of the tenant narrows. The audience is a team space's member fingerprint or `all` for a company space, so a removal from the team renames it. Opened as the space's read: another team's space, a client and an unknown id answer 404. The SPA joins it while the space is on screen and reads the tree, the trash and the open page again on `doc_space.changed`, and the name again on `channels.rotated`.",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The channel to join.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "channel"
           ],
           "properties": {
            "channel": {
             "type": "string",
             "maxLength": 140,
             "pattern": "^private-tenant\\.[0-9a-f-]{36}\\.doc-space\\.[0-9a-f-]{36}\\.v[1-9][0-9]{0,17}\\.m(all|[0-9a-f]{16})$"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/repository-connections": {
   "post": {
    "operationId": "connectDocSpaceRepository",
    "summary": "Connect the chosen repository to the space with a consumed token check",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "checkId",
         "repositoryId"
        ],
        "additionalProperties": false,
        "properties": {
         "checkId": {
          "type": "string",
          "minLength": 22,
          "maxLength": 64
         },
         "repositoryId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
         },
         "rotationDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 365
         },
         "webhookMode": {
          "$ref": "#/components/schemas/WebhookModeKey"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Connected; a manual hook's URL and secret are returned once.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RepositoryConnectionView"
          },
          "manualWebhook": {
           "$ref": "#/components/schemas/ManualWebhookSetup"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "502": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/repository-token-checks": {
   "post": {
    "operationId": "checkDocSpaceRepositoryToken",
    "summary": "Verify a pasted token for a space's Git sync (write access) and list the repositories it can write",
    "x-feature": "F-DOC-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "provider",
         "token",
         "acknowledgeDestination"
        ],
        "additionalProperties": false,
        "properties": {
         "provider": {
          "$ref": "#/components/schemas/AllowedProviderKey"
         },
         "instanceId": {
          "$ref": "#/components/schemas/Uuid"
         },
         "token": {
          "type": "string",
          "minLength": 20,
          "maxLength": 512,
          "writeOnly": true
         },
         "acknowledgeDestination": {
          "type": "boolean",
          "description": "The member confirmed the destination notice (R02)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The verified token's facts and repositories; never the token.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TokenCheckView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "502": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/restore": {
   "post": {
    "operationId": "restoreDocSpace",
    "summary": "Restore a deleted space with the pages of its delete batch",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The restored space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/trash": {
   "get": {
    "operationId": "listDocSpaceTrash",
    "summary": "The trashed pages of a space that the reader may see, newest first, with their restore deadline",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of trashed pages; a page that the reader could not read when it was trashed is left out without a count.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocTrashItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "emptyDocSpaceTrash",
    "summary": "Empty trash of a company or team space — every trashed page of the space deleted forever (space admins; at most 500 per call)",
    "description": "As built (owner #45 and owner Q18; DocSpaceController::emptyTrash, PurgeDocTrashHandler): the space's `administer` (a tenant admin outside the team is audited, owner Q10); an archived space's trash is read-only (F-DOC-11.R10). Per page exactly what docs:purge-trash does, as F-DOC-05's emptyDocTrash; each page is audited doc.deleted_forever. hasMore true asks for another call.",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The pages deleted forever and whether the trash holds more.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTrashPurgeResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/trash/{pageId}": {
   "delete": {
    "operationId": "purgeDocSpaceTrashPage",
    "summary": "Delete forever one trashed page of a company or team space with its trashed subpages (space admins)",
    "description": "As built (owner #45 and owner Q18; DocSpaceController::purge, PurgeDocTrashHandler): the space's `administer`; a page that is not in this space's trash answers 404 doc_page.not_found; an archived space's trash is read-only (F-DOC-11.R10). The evidence guard of docs:purge-trash applies; each page is audited doc.deleted_forever.",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The pages deleted forever (the page and its trashed subpages).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTrashPurgeResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/unarchive": {
   "post": {
    "operationId": "unarchiveDocSpace",
    "summary": "Make an archived space writable again",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The active space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/unpublished-changes": {
   "get": {
    "operationId": "listDocUnpublishedChanges",
    "summary": "The space's pages whose latest version is not published",
    "x-feature": "F-DOC-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of pages with unpublished changes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocUnpublishedChange"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-spaces/{spaceId}/watch": {
   "put": {
    "operationId": "watchDocSpace",
    "summary": "Watch every page of a space",
    "description": "The caller (an internal member who can read the space) starts to watch every page of it; idempotent by state. Until F-DOC-11 the space is the project's own space: spaceId is the project id (getProjectDocSpace answers it as id), and a project outside the caller's scope, of another tenant or unknown answers 404 project.not_found, as getProjectDocSpace does; the Docs module off answers 403 feature.unavailable, a preview 403 preview.read_only.",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The watch state (page is false).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocWatchState"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unwatchDocSpace",
    "summary": "Stop watching a space",
    "description": "The caller stops watching the space; idempotent by state. The refusals are the ones of watchDocSpace.",
    "x-feature": "F-DOC-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The watch state.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocWatchState"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-subtree-jobs/{jobId}": {
   "get": {
    "operationId": "getDocSubtreeJob",
    "summary": "The progress of a large move, restriction, client-setting change, copy or restore — its starter and the project admins of its root only, as a percentage",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "jobId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The job.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSubtreeJobView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-templates": {
   "get": {
    "operationId": "listDocTemplates",
    "summary": "The templates offered for one space — the space's, the tenant's and the built-in ones",
    "x-feature": "F-DOC-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "spaceId",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "category",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DocTemplateCategory"
      }
     },
     {
      "name": "includeArchived",
      "in": "query",
      "required": false,
      "description": "Template managers only; archived templates are listed after the live ones.",
      "schema": {
       "type": "boolean",
       "default": false
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of templates.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/DocTemplateSummary"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/DocTemplateListMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createDocTemplate",
    "summary": "Save a page as a space or tenant template, or replace a template's body from a page (owner Q15)",
    "x-feature": "F-DOC-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "If-Match",
      "in": "header",
      "required": false,
      "description": "As built (owner Q15, 24 November 2026; DocTemplateController::create, IfMatch::optional): \"Replace <name>\" (`replaceId`) sends the template's version in quotes. A different version answers 412 stale-version, and nothing changes; a replace without it answers 422 (`/expectedVersion`). \"Save as template\" sends none.",
      "schema": {
       "type": "string",
       "pattern": "^\"[0-9]+\"$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocTemplateCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "As built (owner Q15, 24 November 2026; DocTemplateController::create): the template's id and its current version — 1 for a new template, the next version for a replace.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTemplateSaved"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-templates/builtins": {
   "get": {
    "operationId": "listDocBuiltinTemplates",
    "summary": "The built-in templates with their \"Offered\" switch — the registry key docs.templates.builtins (owner Q15; a tenant admin)",
    "x-feature": "F-DOC-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Every built-in; Blank page is locked on. `meta.version` is the `If-Match` of a change.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DocBuiltinTemplateSwitches"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "changeDocBuiltinTemplates",
    "summary": "Set the built-ins that New page offers (Blank page is always kept)",
    "x-feature": "F-DOC-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "offered"
        ],
        "properties": {
         "offered": {
          "type": "array",
          "maxItems": 20,
          "items": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The switches after the change.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DocBuiltinTemplateSwitches"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-templates/managed": {
   "get": {
    "operationId": "listManagedDocTemplates",
    "summary": "The saved templates a manager sees — every live template for a tenant admin, or one space's for its admin (owner Q15)",
    "x-feature": "F-DOC-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "spaceId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The live saved templates, by name.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/DocTemplateSummary"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-templates/{templateId}": {
   "patch": {
    "operationId": "updateDocTemplate",
    "summary": "Rename, describe, recategorise, archive or unarchive a template",
    "x-feature": "F-DOC-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/DocTemplateIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/DocTemplatePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "As built (owner Q15, 24 November 2026; DocTemplateController::update): `{name}` renamed the template; its id and current version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTemplateSaved"
          }
         }
        }
       }
      }
     },
     "204": {
      "description": "As built (owner Q15, 24 November 2026): `{deleted: true}` deleted the template for good; no body."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-trash": {
   "get": {
    "operationId": "listDocTenantTrash",
    "summary": "The trashed pages of the active company and team spaces whose trash the reader may read, newest first",
    "description": "The Documents home's Trash tab (owner, 24 Nov 2026; register §230 add. 99). A space adds rows only when the reader passes the two checks of listDocSpaceTrash (view and edit_docs on the space). The answer has no total. Restore and purge use the operations of the row's space.",
    "x-feature": "F-DOC-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of trashed pages with their spaces.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocTenantTrashItem"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/doc-usage": {
   "get": {
    "operationId": "listDocSpaceUsage",
    "summary": "Usage per space for Admins — pages, versions, attachment bytes, comments, public pages",
    "x-feature": "F-DOC-25",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of usage rows.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocUsageRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/email-deliverability/clear": {
   "post": {
    "operationId": "clearEmailDeliverability",
    "summary": "Mark a suppressed address of the tenant as working again (Admins)",
    "x-feature": "F-NOT-07",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/EmailDeliverabilityClearRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The address's deliverability after clearing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/EmailDeliverabilityView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/exit": {
   "get": {
    "operationId": "getExitGrant",
    "summary": "The exit grant's view — tenant, administrator, expiry and the tenant's exports",
    "x-feature": "F-PLT-09",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The grant view.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExitGrantView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/exit/exports": {
   "post": {
    "operationId": "requestExitExport",
    "summary": "Request a fresh tenant export (an export-class operation that runs during the suspension)",
    "description": "Exempt from `Idempotency-Key` (REV-XP11-10): one export runs per tenant at a time, so a retry after a lost `202` cannot start a second one — it answers `409 exit.export_in_progress`, and `GET /exit` lists the running export to continue with.",
    "x-feature": "F-PLT-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "responses": {
     "202": {
      "description": "The export in state queued or generating.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantExportView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/exit/exports/{exportId}": {
   "get": {
    "operationId": "getExitExport",
    "summary": "State and manifest summary of one export of the grant's tenant",
    "x-feature": "F-PLT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "exportId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The export; Retry-After while generating.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantExportView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/exit/exports/{exportId}/download": {
   "get": {
    "operationId": "downloadExitExport",
    "summary": "Redirect to a 60-second signed download URL (at most five per grant)",
    "x-feature": "F-PLT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "exportId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "302": {
      "description": "To the signed URL with Content-Disposition attachment."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/exit/sign-out": {
   "post": {
    "operationId": "signOutExitGrant",
    "summary": "Revoke the exit grant and clear its cookie",
    "x-feature": "F-PLT-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "responses": {
     "204": {
      "description": "The grant is revoked."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/expenses/{expenseId}": {
   "get": {
    "operationId": "getExpense",
    "summary": "One expense with its decision and links",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ExpenseIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The expense (ETag is its version).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExpenseView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/expenses/{expenseId}/decision": {
   "post": {
    "operationId": "decideExpense",
    "summary": "Approve or reject a recorded expense",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ExpenseIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExpenseDecisionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The decided expense.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExpenseView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/expenses/{expenseId}/receipts": {
   "get": {
    "operationId": "listExpenseReceipts",
    "summary": "The receipts of an expense",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ExpenseIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The receipts, oldest first; download each through Files.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 5,
           "items": {
            "$ref": "#/components/schemas/ExpenseReceiptView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "attachExpenseReceipt",
    "summary": "Attach a completed upload (target expense_receipt) as a receipt",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ExpenseIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExpenseReceiptAttachRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The receipt.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExpenseReceiptView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/expenses/{expenseId}/receipts/{fileId}": {
   "delete": {
    "operationId": "removeExpenseReceipt",
    "summary": "Remove a receipt from a recorded expense",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ExpenseIdPath"
     },
     {
      "$ref": "#/components/parameters/ExpenseReceiptFileIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Removed; Files deletes the file."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/expenses/{expenseId}/reversal": {
   "post": {
    "operationId": "reverseExpense",
    "summary": "Reverse an approved expense with a reason; a corrected expense then names it",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ExpenseIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExpenseReasonRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The reversed expense.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExpenseView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/expenses/{expenseId}/withdrawal": {
   "post": {
    "operationId": "withdrawExpense",
    "summary": "The recorder withdraws a recorded expense",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ExpenseIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The withdrawn expense.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExpenseView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/files/{fileId}": {
   "get": {
    "operationId": "getStoredFile",
    "summary": "A file's metadata and status (the uploader before ownership; afterwards the owner's read policy)",
    "x-feature": "F-FIL-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The file.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/StoredFileView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/files/{fileId}/download": {
   "get": {
    "operationId": "downloadFile",
    "summary": "Redirect to a 60-second signed URL of the file after the owner's decision (browser navigation)",
    "x-feature": "F-FIL-04",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "tenant",
      "in": "query",
      "required": true,
      "description": "The tenant id, checked like X-Kanso-Tenant (a navigation cannot send headers).",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "disposition",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "attachment",
        "inline"
       ],
       "default": "attachment"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "F-FIL-04.R12 — only when the request accepts application/vnd.kanso.signed-url+json; the same signed URL as JSON, with the headers of the 302.",
      "content": {
       "application/vnd.kanso.signed-url+json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignedUrlView"
          }
         }
        }
       }
      }
     },
     "302": {
      "description": "Location is a signed URL valid 60 seconds; Cache-Control no-store, Referrer-Policy no-referrer, X-Content-Type-Options nosniff."
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/files/{fileId}/preview": {
   "get": {
    "operationId": "getFilePreview",
    "summary": "Redirect to a 60-second URL of a preview variant after the owner's decision (browser navigation)",
    "x-feature": "F-FIL-03",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "variant",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "thumb",
        "view"
       ]
      }
     },
     {
      "name": "tenant",
      "in": "query",
      "required": true,
      "description": "The tenant id, checked like X-Kanso-Tenant (a navigation cannot send headers).",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "F-FIL-04.R12 — only when the request accepts application/vnd.kanso.signed-url+json; the same signed URL as JSON.",
      "content": {
       "application/vnd.kanso.signed-url+json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignedUrlView"
          }
         }
        }
       }
      }
     },
     "302": {
      "description": "Location is a signed URL of the preview, valid 60 seconds, inline disposition, Cache-Control no-store."
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/access": {
   "get": {
    "operationId": "getFinanceAccess",
    "summary": "What finance the caller may see and do — flags only, never amounts",
    "x-feature": "F-FIN-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The caller's finance access.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/FinanceAccessView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/budgets": {
   "get": {
    "operationId": "listTenantBudgets",
    "summary": "The tenant Finance overview: each readable project's budget, spent so far, used and people cost, and the totals (owner, 22 Nov 2026)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "list_project_budgets",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [],
     "confirm": "never",
     "pages": [],
     "description": "The budget of every project whose finance you can see, in EUR: budget (null: none), spent so far, left, used percent and status, and the totals. Use it for a project's budget and what it spent."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The rows by project key and the totals in EUR.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantBudgetsView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/cashflow": {
   "get": {
    "operationId": "listCashflowMonths",
    "summary": "The months of the cashflow with the lines behind them; EUR totals (R10–R12)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "get_cashflow",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [],
     "confirm": "never",
     "pages": [],
     "description": "The cashflow by month (YYYY-MM, at most 60): money in, money out, the closing balance, the money out by category (outsByCategory) and the lines behind each month with their category, person and project (null: Global). Sum the lines only for a view by person or project."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "The first month. Default the starting month (else three months back), at most 60 months before to.",
      "schema": {
       "$ref": "#/components/schemas/YearMonth"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "The last month. Default two months after the current month.",
      "schema": {
       "$ref": "#/components/schemas/YearMonth"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The months. Without view_cashflow the page is hidden (404 route.not_found).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CashflowView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/cashflow/settings": {
   "get": {
    "operationId": "getCashflowSettings",
    "summary": "The starting money with its month and the VAT rates of the invoice dialog (§6)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The cashflow settings.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CashflowSettingsView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "changeCashflowSettings",
    "summary": "Set the starting money with its month, the VAT rates, or both (manage_cashflow; §6)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CashflowSettingsChange"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The cashflow settings, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CashflowSettingsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/currencies": {
   "get": {
    "operationId": "listFinanceCurrencies",
    "summary": "The currency registry with the tenant's enabled and base flags",
    "x-feature": "F-FIN-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[enabled]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The currencies, ordered by code.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/CurrencyView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/finance/exchange-rates": {
   "get": {
    "operationId": "listExchangeRates",
    "summary": "The exchange-rate versions, newest effective date first",
    "x-feature": "F-FIN-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[currency]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/CurrencyCode"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 50 versions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/ExchangeRateView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "recordExchangeRate",
    "summary": "Record an exchange rate into the base currency from an effective date, or a correction",
    "x-feature": "F-FIN-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExchangeRateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The recorded version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExchangeRateView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/expense-categories": {
   "get": {
    "operationId": "listExpenseCategories",
    "summary": "The tenant's expense categories (names and kinds, no amounts)",
    "x-feature": "F-FIN-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[archived]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The categories in their order, with the usage of each; the ETag is the list's version.",
      "headers": {
       "ETag": {
        "description": "The list's version in quotes (meta.version).",
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 500,
           "items": {
            "$ref": "#/components/schemas/ExpenseCategoryView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/ExpenseCategoryListMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "put": {
    "operationId": "replaceExpenseCategories",
    "summary": "Replace the list of expense categories — add, rename, reorder and archive",
    "x-feature": "F-FIN-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "If-Match",
      "in": "header",
      "required": false,
      "description": "OPTIONAL (group E1 live connect, 22 Nov 2026): the version of the list in quotes (meta.version of the read). A different version answers 412 stale-version with currentVersion, and nothing changes; absent compares nothing.",
      "schema": {
       "type": "string",
       "pattern": "^\"[0-9]+\"$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExpenseCategoriesReplaceRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The active categories, with the usage of each; the ETag is the list's new version.",
      "headers": {
       "ETag": {
        "description": "The list's version in quotes (meta.version).",
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/ExpenseCategoryView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/ExpenseCategoryListMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/invoices": {
   "get": {
    "operationId": "listInvoices",
    "summary": "The simple invoice list with the VAT rates of the dialog (R16–R18)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The invoices, the newest due date first. Without view_cashflow the page is hidden (404 route.not_found).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvoicesView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addInvoice",
    "summary": "Add an open invoice; the VAT and the total are derived (R16)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvoiceAddRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The invoice, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvoiceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/invoices/{invoiceId}/open": {
   "parameters": [
    {
     "$ref": "#/components/parameters/CashInvoiceIdPath"
    }
   ],
   "post": {
    "operationId": "markInvoiceOpen",
    "summary": "Mark an invoice as open; the paid date is removed (R17)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The invoice, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvoiceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/finance/invoices/{invoiceId}/paid": {
   "parameters": [
    {
     "$ref": "#/components/parameters/CashInvoiceIdPath"
    }
   ],
   "post": {
    "operationId": "markInvoicePaid",
    "summary": "Mark an invoice as paid on a date, today when no date is given (R17)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvoicePaidRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The invoice, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvoiceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/portfolio": {
   "get": {
    "operationId": "listFinancePortfolio",
    "summary": "One row per project where the caller may see finance",
    "x-feature": "F-FIN-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[teamId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[alert]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "none",
        "warning",
        "exceeded"
       ]
      }
     },
     {
      "name": "filter[archived]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "forecast"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 25 projects by key.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/PortfolioRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/spendings": {
   "get": {
    "operationId": "listSpendings",
    "summary": "All spending lines, By person and the EUR totals (the Cashflow page; R08, R09, R12)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "list_spendings",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [],
     "confirm": "never",
     "pages": [],
     "description": "List the spending lines (id, what, category, kind, amount, from, until, active, person, project; project null: Global) and their EUR totals. Narrow it with q (a part of the name), category, project (a key or global) or active. Call it first when the person names a spending or a person."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "Only the lines whose name holds this text (any case).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "category",
      "in": "query",
      "required": false,
      "description": "Only the lines of this category (any case).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 60
      }
     },
     {
      "name": "project",
      "in": "query",
      "required": false,
      "description": "Only the lines of this project key, or global for the lines without a project.",
      "schema": {
       "type": "string",
       "pattern": "^([A-Za-z][A-Za-z0-9]{1,9}|global)$"
      }
     },
     {
      "name": "active",
      "in": "query",
      "required": false,
      "description": "true: only the lines that cost now; false: only the others.",
      "schema": {
       "type": "string",
       "enum": [
        "true",
        "false"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The lines as they are now. Without view_cashflow the page is hidden (404 route.not_found).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingsView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addSpending",
    "summary": "Add a spending on the Cashflow page; the project is optional (R07)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "add_spending",
     "kind": "write",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [],
     "confirm": "always",
     "pages": [],
     "description": "Add a spending: one_time, monthly or yearly, from a month (YYYY-MM), optionally for a person, a project and a category. The amount is above 0. The person confirms it first."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpendingAddRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new line, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingLineView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/spendings/{itemId}": {
   "parameters": [
    {
     "$ref": "#/components/parameters/SpendingItemIdPath"
    }
   ],
   "delete": {
    "operationId": "removeSpending",
    "summary": "Remove a line that has one row (R15); with=history deletes it with all its rows (R15a)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "remove_spending",
     "kind": "write",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [
      "itemId"
     ],
     "confirm": "always",
     "pages": [],
     "description": "Remove a whole spending line: a one-time line with all its months, or a line added by mistake (one row). with=history only when the person asks to delete a line with its earlier amounts too. Find the id with list_spendings first. The person confirms it."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/OptionalIdempotencyKeyHeader"
     },
     {
      "name": "with",
      "in": "query",
      "required": false,
      "description": "history: delete the line with every row it has (R15a, owner Q39). Another value answers 400 query.invalid.",
      "schema": {
       "type": "string",
       "enum": [
        "history"
       ]
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The item and its rows are deleted."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/spendings/{itemId}/category": {
   "parameters": [
    {
     "$ref": "#/components/parameters/SpendingItemIdPath"
    }
   ],
   "put": {
    "operationId": "moveSpendingCategory",
    "summary": "Move a line to a category — every row, no new row (R22)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpendingCategoryRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The line, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingLineView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/spendings/{itemId}/changes": {
   "parameters": [
    {
     "$ref": "#/components/parameters/SpendingItemIdPath"
    }
   ],
   "post": {
    "operationId": "changeSpendingFrom",
    "summary": "A new amount from a month on, or a correction of the newest row in its own month (R03, R14)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "change_spending",
     "kind": "write",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [
      "itemId"
     ],
     "confirm": "always",
     "pages": [],
     "description": "Change the amount (above 0, never 0) of a spending line from a month (YYYY-MM) on. A one-time line: only its own month (another month: set_spending_month). To end a line: stop_spending (monthly, yearly), remove_spending (one time). Find the id with list_spendings. The person confirms it."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpendingChangeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The line, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingLineView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/spendings/{itemId}/months/{month}": {
   "parameters": [
    {
     "$ref": "#/components/parameters/SpendingItemIdPath"
    },
    {
     "$ref": "#/components/parameters/SpendingMonthPath"
    }
   ],
   "put": {
    "operationId": "setSpendingMonth",
    "summary": "Change the amount of ONE month of a line; the line and the other months do not change (R23, OF-15); a one-time line takes any month (R10a)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "set_spending_month",
     "kind": "write",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [
      "itemId",
      "month"
     ],
     "confirm": "always",
     "pages": [],
     "description": "Set the amount of ONE month (YYYY-MM) of a line; the other months stay. Monthly or yearly: 0 = nothing in that month. One time: one more payment on the same row, in any month, above 0. Find the id with list_spendings first. The person confirms it first."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpendingMonthRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The line, read back; the ETag is its new monthsVersion.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingLineView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "resetSpendingMonth",
    "summary": "The month uses the amount of the line again (R23, OF-15)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "reset_spending_month",
     "kind": "write",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [
      "itemId",
      "month"
     ],
     "confirm": "always",
     "pages": [],
     "description": "Take away the own amount of ONE month (YYYY-MM): a monthly or yearly line uses its amount again; a one-time line loses that month's payment. Find the id with list_spendings first. The person confirms it first."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The line, read back; the ETag is its new monthsVersion.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingLineView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/finance/spendings/{itemId}/stop": {
   "parameters": [
    {
     "$ref": "#/components/parameters/SpendingItemIdPath"
    }
   ],
   "post": {
    "operationId": "stopSpendingFrom",
    "summary": "Stop a repeating line from a month on (R04)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "stop_spending",
     "kind": "write",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [
      "itemId"
     ],
     "confirm": "always",
     "pages": [],
     "description": "Stop a monthly or yearly spending line from a month (YYYY-MM) on: no cost from that month. Never a one-time line (remove_spending, or reset_spending_month for one month). Find the line and its id with list_spendings first. The person confirms it first."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpendingStopRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The line, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingLineView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections": {
   "get": {
    "operationId": "listHelpDeskConnections",
    "summary": "The tenant's help-desk connections",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "paused",
        "revoked",
        "all"
       ],
       "default": "all"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 25, newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/HelpDeskConnectionView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createHelpDeskConnection",
    "summary": "Connect a client organisation's system to one project",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/HelpDeskConnectionInput"
         },
         {
          "type": "object",
          "required": [
           "projectKey"
          ],
          "properties": {
           "projectKey": {
            "$ref": "#/components/schemas/ProjectKey"
           }
          }
         }
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new connection, without a token.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskConnectionView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}": {
   "get": {
    "operationId": "getHelpDeskConnection",
    "summary": "One connection with its tokens (never secrets)",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The connection; ETag of its version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskConnectionView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "editHelpDeskConnection",
    "summary": "Change a connection's abilities, scope, ranges, limits, webhook, role or name",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskConnectionInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed connection.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskConnectionView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}/pause": {
   "post": {
    "operationId": "pauseHelpDeskConnection",
    "summary": "Stop token calls and webhook deliveries until resumed",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The paused connection.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskConnectionView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}/resume": {
   "post": {
    "operationId": "resumeHelpDeskConnection",
    "summary": "Resume a paused connection",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The active connection.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskConnectionView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}/revoke": {
   "post": {
    "operationId": "revokeHelpDeskConnection",
    "summary": "End a connection and revoke its tokens",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The revoked connection.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskConnectionView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}/tokens": {
   "post": {
    "operationId": "issueHelpDeskToken",
    "summary": "Issue the connection's first token; the secret is shown once",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskTokenCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The token and its plaintext secret (only now).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTokenIssued"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}/tokens/rotate": {
   "post": {
    "operationId": "rotateHelpDeskToken",
    "summary": "Issue a new token and keep the old one for the overlap",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskTokenCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new token and its plaintext secret (only now).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTokenIssued"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}/tokens/{tokenId}": {
   "delete": {
    "operationId": "revokeHelpDeskToken",
    "summary": "Revoke one token at once",
    "x-feature": "F-HLP-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "tokenId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Revoked; the next call with it answers 401."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/connections/{connectionId}/webhook-test": {
   "post": {
    "operationId": "testHelpDeskWebhook",
    "summary": "Send a ping to the connection's webhook endpoint",
    "x-feature": "F-HLP-06",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "connectionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The outcome of the test delivery.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "delivered"
           ],
           "properties": {
            "delivered": {
             "type": "boolean"
            },
            "statusCode": {
             "type": "integer",
             "minimum": 100,
             "maximum": 599
            },
            "failure": {
             "type": "string",
             "maxLength": 60
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/form": {
   "get": {
    "operationId": "getIntakeForm",
    "summary": "The current request form of the connection's project",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "responses": {
     "200": {
      "description": "Categories, fields, intro and accepted file types, without internal mapping.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskFormView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/reporter-erasures": {
   "post": {
    "operationId": "eraseHelpDeskReporter",
    "summary": "Erase an external reporter's data on every request of the tenant",
    "x-feature": "F-HLP-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "minProperties": 1,
        "properties": {
         "email": {
          "$ref": "#/components/schemas/EmailAddress"
         },
         "externalId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         },
         "connectionId": {
          "$ref": "#/components/schemas/Uuid"
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The erasure operation; poll it at its Location.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/requests": {
   "get": {
    "operationId": "listIntakeRequests",
    "summary": "The requests that the connection can read, oldest update first",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "name": "changeCursor",
      "in": "query",
      "required": false,
      "description": "The meta.changeCursor of the previous answer (help desk §3.12). The only cursor of this list; it pages and it polls. Not with updatedSince.",
      "schema": {
       "type": "string",
       "maxLength": 512
      }
     },
     {
      "name": "updatedSince",
      "in": "query",
      "required": false,
      "description": "Starts a first sync; inclusive.",
      "schema": {
       "$ref": "#/components/schemas/Instant"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "open",
        "closed",
        "all"
       ],
       "default": "all"
      }
     },
     {
      "name": "externalReference",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50, oldest change first, without the changes of the last 30 seconds (the settle window).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/HelpDeskClientRequestRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "changeCursor",
            "hasMore"
           ],
           "properties": {
            "changeCursor": {
             "type": "string",
             "maxLength": 512,
             "description": "The position after the last listed row; send it for the next page or the next poll. Present also on an empty page."
            },
            "hasMore": {
             "type": "boolean",
             "description": "True when more settled rows follow; send changeCursor at once. False when the client's system waits before its next poll."
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createIntakeRequest",
    "summary": "Create a request from the client's system",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskApiRequestDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "A request with the same external reference and the same body exists; it is returned.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "201": {
      "description": "The new request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/requests/{requestKey}": {
   "get": {
    "operationId": "getIntakeRequest",
    "summary": "One request as the connection reads it",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The client projection with the external reference.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/requests/{requestKey}/files/{fileId}/download": {
   "get": {
    "operationId": "downloadIntakeRequestFile",
    "summary": "Redirect to a 60-second signed URL of a file that the connection can read",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     },
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "302": {
      "description": "Location is a signed URL valid 60 seconds, disposition attachment; Cache-Control no-store, Referrer-Policy no-referrer."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/requests/{requestKey}/messages": {
   "get": {
    "operationId": "listIntakeRequestMessages",
    "summary": "The client-visible messages, oldest first",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/HelpDeskMessageView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "postIntakeRequestMessage",
    "summary": "Reply on a request from the client's system",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/HelpDeskMessageDraft"
         },
         {
          "type": "object",
          "properties": {
           "reporter": {
            "$ref": "#/components/schemas/HelpDeskReporter"
           }
          }
         }
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The request with the new message.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/requests/{requestKey}/withdraw": {
   "post": {
    "operationId": "withdrawIntakeRequest",
    "summary": "Withdraw a request that this connection created",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The withdrawn request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/uploads": {
   "post": {
    "operationId": "startIntakeUpload",
    "summary": "Start an upload for a new request or a reply (one presigned PUT)",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskUploadRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The pending file with its presigned PUT, valid 15 minutes (strategy single).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/UploadIntentView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/help-desk/uploads/{fileId}/complete": {
   "post": {
    "operationId": "completeIntakeUpload",
    "summary": "Complete an upload of this connection; the scan starts",
    "x-feature": "F-HLP-05",
    "x-audience": "public",
    "x-principal": "help_desk_connection",
    "security": [
     {
      "serviceToken": []
     }
    ],
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The file, now checking.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskFileView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/imports": {
   "post": {
    "operationId": "startJiraImport",
    "summary": "Start a Jira CSV import into one project (beta, behind the jira_csv_import flag)",
    "x-feature": "F-INT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "projectKey"
        ],
        "additionalProperties": false,
        "properties": {
         "projectKey": {
          "$ref": "#/components/schemas/ProjectKey"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "A draft import; upload the CSV with purpose import_source and target import(id).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/JiraImportView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/imports/{importId}": {
   "get": {
    "operationId": "getJiraImport",
    "summary": "The import's state, progress, counts and first row errors",
    "x-feature": "F-INT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "importId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The import.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/JiraImportView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/imports/{importId}/cancel": {
   "post": {
    "operationId": "cancelJiraImport",
    "summary": "Cancel a queued or running import or dry run; committed batches stay",
    "x-feature": "F-INT-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "importId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Cancelled (or already finished — the current state is returned).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/JiraImportView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/imports/{importId}/dry-run": {
   "post": {
    "operationId": "checkJiraImport",
    "summary": "Check the uploaded CSV against the mapping — counts and row errors, nothing written",
    "description": "XM-1241: the request reads its files within integrations.import.checkTimeBudgetSeconds (one parse of the CSV, the options of the fields to create, the archive's directory); when the budget is spent, 422 integration.import_check_too_large (budgetSeconds) before anything is created — split the export. One check at a time per import and integrations.import.checksPerMinute per tenant (429 rate_limit.exceeded, limiter jira-check-import or jira-check, Retry-After; 503 service.unavailable when the counter store fails). An archive that holds none of the attachment ids the export names is 422 integration.import_file_invalid (reason layout) at /attachmentsFileId.",
    "x-feature": "F-INT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "importId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/JiraImportDryRunInput"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The dry run is queued.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/JiraImportView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/imports/{importId}/profile": {
   "get": {
    "operationId": "getJiraImportProfile",
    "summary": "The profile of a file uploaded for the import, for the mapping step — rows, statuses, custom-field columns (R13; XM-1080)",
    "description": "Read on each request from the import's own file and never stored. Holds cell values: operators are refused (403 proposal.not_proposable) before the file is opened. One profile at a time per import and integrations.import.profilesPerMinute per tenant (429 rate_limit.exceeded, limiter jira-profile-import or jira-profile, Retry-After; 503 service.unavailable when the counter store fails). The file is read once within integrations.import.profileTimeBudgetSeconds; when the budget is spent, 422 integration.import_profile_too_large (reason time, budgetSeconds); an answer larger than integrations.import.profileAnswerMaxBytes is 422 integration.import_profile_too_large (reason size, maxBytes) — the dry run still takes the file (XM-1080 fix rounds 1 and 2). One column for each field name, compared case-insensitively; unlistedColumns counts the later spellings.",
    "x-feature": "F-INT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "importId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "fileId",
      "in": "query",
      "required": true,
      "description": "The import_source file uploaded for import(importId).",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "source",
      "in": "query",
      "required": false,
      "description": "F-INT-09.R14 (XM-1387): the format the Admin chose in the Format choice. Absent: the source is detected by the upload's shape. No adapter, more than one, or a chosen format that does not recognise the upload answers 422 integration.import_file_invalid (reason source_unknown, source_ambiguous or source_mismatch, with candidates).",
      "schema": {
       "type": "string",
       "enum": [
        "jira_csv",
        "jira_rest_export"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The profile (Cache-Control no-store).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/JiraImportSourceProfile"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/imports/{importId}/report": {
   "get": {
    "operationId": "getJiraImportReport",
    "summary": "The whole row report as CSV (row, jira_key, column, code, reason, worklog_id, date, minutes) under the exports' CSV safety rule (XM-112, XM-1387)",
    "x-feature": "F-INT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "importId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The CSV file (Content-Disposition attachment), UTF-8 with a byte-order mark, lines ended by CRLF; every cell guarded against spreadsheet formulas. Made from the import's row, so it is gone 30 days after the import ended.",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/imports/{importId}/run": {
   "post": {
    "operationId": "runJiraImport",
    "summary": "Run the import checked by the last dry run (same file and mapping), optionally fetching attachments",
    "x-feature": "F-INT-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "importId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/JiraImportRunInput"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The import is queued.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/JiraImportView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/integrations/provider-settings": {
   "get": {
    "operationId": "getProviderSettings",
    "summary": "The tenant's allowed Git providers, self-managed instances, rotation default and linking switch",
    "x-feature": "F-INT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The provider settings with in-use counts.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProviderSettingsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "putProviderSettings",
    "summary": "Replace the provider settings (allowed providers, instances, rotation default and lead, linking by ticket key)",
    "x-feature": "F-INT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProviderSettingsInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Saved (or unchanged); the new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProviderSettingsView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/invitations": {
   "post": {
    "operationId": "sendInvitationBatch",
    "summary": "Send the batch — create invitations and resend existing ones, all or nothing",
    "x-feature": "F-TEN-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvitationBatchRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The invitations created and resent, and the skipped addresses.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvitationBatchResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/invitations/options": {
   "get": {
    "operationId": "getInvitationOptions",
    "summary": "What the Invite people dialog may offer the caller",
    "x-feature": "F-TEN-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "description": "The preset project of the entry point (Client sharing, project People).",
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Grantable roles, team choice, seat usage, expiry and the two-factor policy.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvitationOptions"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/invitations/project-candidates": {
   "get": {
    "operationId": "listInvitationProjectCandidates",
    "summary": "Typeahead of the projects the caller may invite into (at most 20)",
    "x-feature": "F-TEN-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      }
     },
     {
      "name": "audience",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "internal",
        "client"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matching projects in the caller's scope, with eligibility for a client invitation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/InvitationProjectCandidate"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/invitations/validate": {
   "post": {
    "operationId": "validateInvitationBatch",
    "summary": "Dry run — classify every address without sending",
    "x-feature": "F-TEN-07",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InvitationBatchRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Per-address statuses, totals and seat usage; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InvitationBatchValidation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/invitations/{invitationId}/resend": {
   "post": {
    "operationId": "resendInvitation",
    "summary": "Issue a new link and expiry for a pending or expired invitation",
    "x-feature": "F-TEN-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "invitationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The invitation's row after the resend.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PendingInvitationRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/invitations/{invitationId}/revoke": {
   "post": {
    "operationId": "revokeInvitation",
    "summary": "Revoke a pending or expired invitation; its link stops working at once",
    "x-feature": "F-TEN-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "invitationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The invitation's row in state revoked.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PendingInvitationRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-item-types": {
   "get": {
    "operationId": "listKnowledgeItemTypes",
    "summary": "The item-type registry with the tenant's active types",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Every registry entry, with enabled, clientShareable and the allowed sources.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeTypeCatalogue"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}": {
   "get": {
    "operationId": "getKnowledgeItem",
    "summary": "One knowledge item with the links that the reader can see",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The item, its visible links and the reader's can flags.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "reviseKnowledgeItem",
    "summary": "Revise the title, the body, the tags or the time of an item",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeItemPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The revised item.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/accept": {
   "post": {
    "operationId": "acceptProposedKnowledge",
    "summary": "Accept the item's proposal — the proposed item, or its pending revision",
    "x-feature": "F-MEM-08",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeReasonRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The item, active, with the accepted text.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/decision-status": {
   "post": {
    "operationId": "changeDecisionStatus",
    "summary": "Accept a proposed decision, or reverse a decision with a reason",
    "x-feature": "F-MEM-02",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DecisionStatusRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The decision with its new status.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/links": {
   "post": {
    "operationId": "addKnowledgeLink",
    "summary": "Link the item to a ticket, an item, a doc page, an opportunity, a request or an external URL",
    "x-feature": "F-MEM-03",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeLinkInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The item with its visible links.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/links/{linkId}": {
   "delete": {
    "operationId": "removeKnowledgeLink",
    "summary": "Remove one link of the item",
    "x-feature": "F-MEM-03",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     },
     {
      "name": "linkId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The link is gone (also when it was gone before)."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/redact-text": {
   "post": {
    "operationId": "redactKnowledgeItemText",
    "summary": "Replace one exact text in every revision and in the current text of an item; the records stay",
    "x-feature": "F-MEM-10",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "text",
         "category"
        ],
        "properties": {
         "text": {
          "type": "string",
          "minLength": 3,
          "maxLength": 2000,
          "description": "The exact text to remove; never stored, logged or audited."
         },
         "category": {
          "type": "string",
          "enum": [
           "secret",
           "personal_data",
           "other"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The counts; replaced is 0 when the text does not occur.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "replaced",
            "revisions"
           ],
           "properties": {
            "replaced": {
             "type": "integer",
             "minimum": 0
            },
            "revisions": {
             "type": "array",
             "maxItems": 10000,
             "items": {
              "type": "integer",
              "minimum": 1
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/reject": {
   "post": {
    "operationId": "rejectProposedKnowledge",
    "summary": "Reject the item's proposal — the proposed item, or its pending revision",
    "x-feature": "F-MEM-08",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeReasonRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The item — rejected, or active without the pending revision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/restore": {
   "post": {
    "operationId": "restoreKnowledgeItem",
    "summary": "Restore a retracted item within the retention window",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The restored item (state active).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/retract": {
   "post": {
    "operationId": "retractKnowledgeItem",
    "summary": "Take an item out of use; it stays restorable for a setting's days",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeReasonRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The retracted item (state retracted).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/revisions": {
   "get": {
    "operationId": "listKnowledgeItemRevisions",
    "summary": "The item's revisions, newest first",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50 revisions, newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/KnowledgeRevisionView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/revisions/{revisionNo}/redact": {
   "post": {
    "operationId": "redactKnowledgeRevision",
    "summary": "Replace the text of one revision, for example a pasted secret; the record stays",
    "x-feature": "F-MEM-10",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     },
     {
      "name": "revisionNo",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "category"
        ],
        "properties": {
         "category": {
          "type": "string",
          "enum": [
           "secret",
           "personal_data",
           "other"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The redacted revision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeRevisionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/segment": {
   "put": {
    "operationId": "changeKnowledgeItemSegment",
    "summary": "Move an item to another segment (\"Who can see this\")",
    "x-feature": "F-MEM-13",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ItemSegmentRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The item with its new access classification.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/knowledge-items/{itemKey}/visibility": {
   "put": {
    "operationId": "setKnowledgeItemVisibility",
    "summary": "Share an item with the project's current client, or make it internal again",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeVisibilityRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The item with its new visibility.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me": {
   "get": {
    "operationId": "getAccountDocument",
    "summary": "The signed-in account, its preferences and memberships",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The account document; ETag is the account version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountDocument"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/account-recovery": {
   "get": {
    "operationId": "getMyAccountRecovery",
    "summary": "The account's open recovery request, if any",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The open request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountRecoveryView"
          }
         }
        }
       }
      }
     },
     "204": {
      "description": "No open request."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "cancelMyAccountRecovery",
    "summary": "Cancel the open recovery request from a session",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "responses": {
     "204": {
      "description": "Cancelled."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/avatar": {
   "get": {
    "operationId": "getMyAvatar",
    "summary": "The account's own avatar image (R11)",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "If-None-Match",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 200
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The 256 px WebP image; a strong ETag; Cache-Control private, no-store.",
      "content": {
       "image/webp": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "304": {
      "description": "The image did not change."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "uploadMyAvatar",
    "summary": "Upload the account's avatar — scanned, cropped to the centre square and stored as a 256 px WebP (R10)",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary",
          "description": "A PNG, JPEG or WebP image of at most 2 MiB."
         },
         "cropX": {
          "type": "integer",
          "minimum": 0,
          "description": "Owner #36 (22 Nov 2026), the square the person framed in the photo editor — its left edge in pixels of the file. Send cropX, cropY and cropSize together, or none (the centre square). A square that is not inside the image answers `422 avatar.crop_invalid`."
         },
         "cropY": {
          "type": "integer",
          "minimum": 0
         },
         "cropSize": {
          "type": "integer",
          "minimum": 16,
          "maximum": 8000
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The stored avatar.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountAvatarView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "reframeMyAvatar",
    "summary": "Frame the avatar again from the kept original — no new upload (R13)",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "cropX",
         "cropY",
         "cropSize"
        ],
        "properties": {
         "cropX": {
          "type": "integer",
          "minimum": 0
         },
         "cropY": {
          "type": "integer",
          "minimum": 0
         },
         "cropSize": {
          "type": "integer",
          "minimum": 16,
          "maximum": 8000
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The avatar rendered again from the kept original; the version moves on.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountAvatarView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeMyAvatar",
    "summary": "Remove the account's avatar (R10); nothing to remove is no error",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "responses": {
     "204": {
      "description": "The avatar is removed; the initials show again."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/avatar/framing": {
   "get": {
    "operationId": "getMyAvatarFraming",
    "summary": "The kept original's size and the current framing, for the framing view (R13)",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The framing of the account's own avatar.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AvatarFramingView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/avatar/original": {
   "get": {
    "operationId": "getMyAvatarOriginal",
    "summary": "The kept original of the account's own avatar (WebP, no metadata) — no other person can read it (R13)",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The kept original (at most 2 048 px a side); Cache-Control private, no-store.",
      "content": {
       "image/webp": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/calendar-feed": {
   "put": {
    "operationId": "rotateCalendarFeed",
    "summary": "Create the member's calendar feed URL in this tenant, or replace it (the old URL stops at once)",
    "x-feature": "F-INT-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The feed URL, shown once.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CalendarFeedView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "revokeCalendarFeed",
    "summary": "Revoke the member's calendar feed in this tenant",
    "x-feature": "F-INT-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Revoked (or none existed)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/client-pins": {
   "get": {
    "operationId": "getClientShortcuts",
    "summary": "The member's pinned and recent client organisations (the Clients sidebar)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The client shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientShortcuts"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/client-pins/{organisationId}": {
   "put": {
    "operationId": "pinClient",
    "summary": "Pin a client organisation for the member (idempotent)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "organisationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated client shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unpinClient",
    "summary": "Unpin a client organisation for the member (idempotent)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "organisationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated client shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/client-visits": {
   "post": {
    "operationId": "recordClientVisit",
    "summary": "Record that the member opened a client organisation (the recent clients only)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientVisitRequest"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Recorded."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/connected-apps": {
   "get": {
    "operationId": "listConnectedApps",
    "summary": "The account's person-level grants across its tenants (v1 — the calendar feeds)",
    "x-feature": "F-INT-08",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The grants.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/ConnectedAppView"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/connected-apps/{connectedAppId}": {
   "delete": {
    "operationId": "disconnectConnectedApp",
    "summary": "Disconnect a connected app — revokes the calendar feed at once",
    "x-feature": "F-INT-08",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "connectedAppId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Disconnected (or already gone)."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/doc-page-visits": {
   "post": {
    "operationId": "recordDocPageVisit",
    "summary": "Record that the member opened a doc page (the recent pages only)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPageVisitRequest"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Recorded."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/doc-shortcuts": {
   "get": {
    "operationId": "getDocShortcuts",
    "summary": "The member's starred and recent doc pages (the Documents sidebar)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The doc shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocShortcuts"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/doc-stars/{pageId}": {
   "put": {
    "operationId": "starDocPage",
    "summary": "Star a doc page for the member (idempotent)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "pageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated doc shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unstarDocPage",
    "summary": "Remove the member's star from a doc page (idempotent)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "pageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated doc shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/features": {
   "get": {
    "operationId": "getMyFeatures",
    "summary": "The feature-switch keys the signed-in account may see (no tenant)",
    "x-feature": "F-PLT-15",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The visible keys of the portal and account surfaces (R12, R13), in the catalogue's order. A hidden key, or a key of another shell, is absent. A switched-off feature is NOT refused by the API until XM-1333.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "features"
           ],
           "properties": {
            "features": {
             "$ref": "#/components/schemas/VisibleFeatureList"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/impersonation": {
   "get": {
    "operationId": "getMyImpersonation",
    "summary": "The impersonation of this app session, or null (the banner of the workspace and the portal)",
    "x-feature": "F-PLT-22",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The state, or null for a normal session.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "oneOf": [
            {
             "type": "null"
            },
            {
             "$ref": "#/components/schemas/ImpersonationState"
            }
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/impersonation/exit": {
   "post": {
    "operationId": "exitMyImpersonation",
    "summary": "End the impersonation of this app session (the banner's Exit)",
    "x-feature": "F-PLT-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "responses": {
     "204": {
      "description": "Ended; the app session is destroyed."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/logging-periods": {
   "get": {
    "operationId": "listMyLoggingPeriods",
    "summary": "The closed and announced logging periods that reach the caller in a range",
    "x-feature": "F-TIM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "On or after `from`; the range is at most 400 days.",
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The closed and announced periods that reach the caller, in start order.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/LoggingPeriods"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/memberships": {
   "get": {
    "operationId": "listMembershipCards",
    "summary": "One page of the signed-in account's membership cards — the tenant chooser and the tenant switcher (F-IDN-21.R08)",
    "x-feature": "F-IDN-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 25,
       "default": 20
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of cards, by last use (never used last), then by tenant id.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/AccountMembershipCard"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/notification-preferences": {
   "get": {
    "operationId": "getNotificationPreferences",
    "summary": "The matrix with effective values and their source, the digest schedule, hour and quiet hours",
    "x-feature": "F-NOT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The caller's preferences with their ETag.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/NotificationPreferencesView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "put": {
    "operationId": "updateNotificationPreferences",
    "summary": "Save the matrix, the digest schedule, its hour and quiet hours in one command",
    "x-feature": "F-NOT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NotificationPreferencesUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The preferences after the save.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/NotificationPreferencesView"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "A refusal. In an impersonation, every request answers `impersonation.blocked_surface` with `surface` `account` and `fields`, also with `X-Kanso-Tenant`: the preferences are one row of the account, and they control the delivery in every tenant (`ImpersonationAccountWriteProblem`; F-PLT-22.R08, XM-1488). The other refusals are a Problem.",
      "content": {
       "application/problem+json": {
        "schema": {
         "anyOf": [
          {
           "$ref": "#/components/schemas/ImpersonationAccountWriteProblem"
          },
          {
           "$ref": "#/components/schemas/Problem"
          }
         ]
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/password": {
   "put": {
    "operationId": "changePassword",
    "summary": "Change the password, or set a first one",
    "x-feature": "F-IDN-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PasswordChangeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated methods overview (Password row with its new date).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInMethodsOverview"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/pins": {
   "get": {
    "operationId": "getProjectShortcuts",
    "summary": "The member's pinned and recent projects and the count of accessible projects",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectShortcuts"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/pins/{projectKey}": {
   "put": {
    "operationId": "pinProject",
    "summary": "Pin a project for the member (idempotent)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unpinProject",
    "summary": "Unpin a project for the member (idempotent)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated shortcuts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/portal-visits": {
   "post": {
    "operationId": "recordPortalVisit",
    "summary": "Remember the portal the client opened",
    "x-feature": "F-POR-02",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PortalVisitRequest"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "The visit was recorded."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/portals": {
   "get": {
    "operationId": "listMyPortals",
    "summary": "The account's portals across tenants, the last used first",
    "x-feature": "F-POR-02",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "Every portal the rule admits now; empty for an account without client memberships.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/PortalRef"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "count",
            "truncated",
            "realtime"
           ],
           "properties": {
            "count": {
             "type": "integer",
             "minimum": 0
            },
            "truncated": {
             "type": "boolean"
            },
            "realtime": {
             "$ref": "#/components/schemas/PortalRealtimeConnection"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/preferences": {
   "patch": {
    "operationId": "updatePreferences",
    "summary": "Save one or more personal preferences (week start, time format, theme, default project)",
    "x-feature": "F-IDN-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/PreferencesUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated account document.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountDocument"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "description": "A refusal. In an impersonation, a request with `weekStart`, `timeFormat` or `theme` answers `impersonation.blocked_surface` with `surface` `account` and `fields`, and nothing is written (`ImpersonationAccountWriteProblem`; F-PLT-22.R08, XM-1488). The other refusals are a Problem.",
      "content": {
       "application/problem+json": {
        "schema": {
         "anyOf": [
          {
           "$ref": "#/components/schemas/ImpersonationAccountWriteProblem"
          },
          {
           "$ref": "#/components/schemas/Problem"
          }
         ]
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/presence": {
   "put": {
    "operationId": "setPresence",
    "summary": "Set Available, Focus or Away",
    "x-feature": "F-IDN-19",
    "x-audience": "spa",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PresenceUpdate"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Saved."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "description": "A refusal. In an impersonation, every request answers `impersonation.blocked_surface` with `surface` `account` and `fields`: the presence is the account's, and every tenant shows it (`ImpersonationAccountWriteProblem`; F-PLT-22.R08, XM-1488). The other refusals are a Problem.",
      "content": {
       "application/problem+json": {
        "schema": {
         "anyOf": [
          {
           "$ref": "#/components/schemas/ImpersonationAccountWriteProblem"
          },
          {
           "$ref": "#/components/schemas/Problem"
          }
         ]
        }
       }
      }
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/profile": {
   "patch": {
    "operationId": "updateProfile",
    "summary": "Save the Profile panel — name, time zone, language and the current membership's job title",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ProfileUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated account document.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AccountDocument"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "description": "A refusal. In an impersonation, a request with `name`, `timeZone` or `language` answers `impersonation.blocked_surface` with `surface` `account` and `fields`, and nothing is written (`ImpersonationAccountWriteProblem`; F-PLT-22.R08, XM-1488). The other refusals are a Problem.",
      "content": {
       "application/problem+json": {
        "schema": {
         "anyOf": [
          {
           "$ref": "#/components/schemas/ImpersonationAccountWriteProblem"
          },
          {
           "$ref": "#/components/schemas/Problem"
          }
         ]
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/project-visits": {
   "post": {
    "operationId": "recordProjectVisit",
    "summary": "Record that the member opened a project (the recent list only)",
    "x-feature": "F-WSP-02",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectVisitRequest"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Recorded."
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/report-deliveries": {
   "get": {
    "operationId": "listMyReportDeliveries",
    "summary": "The caller's own deliveries, newest first",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 25 deliveries with their files while they live.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/ReportDeliveryView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/me/sessions": {
   "get": {
    "operationId": "listMySessions",
    "summary": "The account's live sessions",
    "x-feature": "F-IDN-18",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "Sessions, the current one first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/AccountSessionRow"
           }
          },
          "meta": {
           "type": "object",
           "description": "XM-272 (register §58) — the GeoIP database's credit, present when the active driver asks for one.",
           "properties": {
            "locationAttribution": {
             "$ref": "#/components/schemas/GeoAttributionView"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/sessions/revoke-others": {
   "post": {
    "operationId": "revokeMyOtherSessions",
    "summary": "Sign out of all other sessions and clear trusted devices",
    "x-feature": "F-IDN-18",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "How many sessions and trusted devices were revoked.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "sessionsRevoked",
            "trustedDevicesRevoked"
           ],
           "properties": {
            "sessionsRevoked": {
             "type": "integer",
             "minimum": 0
            },
            "trustedDevicesRevoked": {
             "type": "integer",
             "minimum": 0,
             "maximum": 10
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/sessions/{sessionId}": {
   "delete": {
    "operationId": "revokeMySession",
    "summary": "Sign out one other session",
    "x-feature": "F-IDN-18",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "sessionId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Revoked."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/sign-in-methods": {
   "get": {
    "operationId": "getSignInMethods",
    "summary": "The account's sign-in methods and their usability in the route's tenant",
    "x-feature": "F-IDN-17",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Password, Google, Microsoft and SAML rows.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInMethodsOverview"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/sign-in-methods/{identityId}": {
   "delete": {
    "operationId": "unlinkSignInMethod",
    "summary": "Unlink a Google or Microsoft identity",
    "x-feature": "F-IDN-17",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "identityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Unlinked."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "description": "The problem `sign_in_method.last_usable` with its extension `tenants`, a list of `{id, name}` (R03; XM-577, XM-580).",
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/SignInMethodLastUsableProblem"
        }
       }
      }
     }
    }
   }
  },
  "/me/tenant": {
   "get": {
    "operationId": "getWorkspaceSession",
    "summary": "The tenant session document — member, teams, areas, capabilities, availability, realtime and displayed settings",
    "x-feature": "F-WSP-01",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "get_my_session",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [],
     "description": "Read your own session in this tenant: your name and role, the areas and administration sections you can open, your tenant-level rights and the features that are on."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The session document.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorkspaceSessionDocument"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/tickets": {
   "get": {
    "operationId": "listMyTickets",
    "summary": "The member's open tickets across projects by due date — searchable and paged",
    "x-feature": "F-WSP-08",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "list_my_tickets",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [
      "my-tickets"
     ],
     "description": "List the tickets assigned to you across the projects that you can open."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      }
     },
     {
      "name": "due",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "overdue",
        "this_week",
        "next_week",
        "none"
       ]
      }
     },
     {
      "name": "filter[projectKey]",
      "in": "query",
      "required": false,
      "style": "deepObject",
      "explode": true,
      "description": "XM-1114 (R07) — a comma list of 1–20 project keys; a key that names no project the member can see matches nothing. XM-1166 G-MT-08 — or an object of operator rules (FacetRulesInput), with at most 20 different keys for all rules.",
      "schema": {
       "oneOf": [
        {
         "type": "string",
         "maxLength": 420
        },
        {
         "$ref": "#/components/schemas/FacetRulesInput"
        }
       ]
      }
     },
     {
      "name": "filter[stageKind]",
      "in": "query",
      "required": false,
      "style": "deepObject",
      "explode": true,
      "description": "XM-1114 (R07) — a comma list of stage kinds (todo, in_progress, in_review, done). XM-1166 G-MT-08 — or an object of operator rules (FacetRulesInput).",
      "schema": {
       "oneOf": [
        {
         "type": "string",
         "maxLength": 60
        },
        {
         "$ref": "#/components/schemas/FacetRulesInput"
        }
       ]
      }
     },
     {
      "name": "filter[priority]",
      "in": "query",
      "required": false,
      "style": "deepObject",
      "explode": true,
      "description": "XM-1114 (R07) — a comma list of 1–20 priority keys of the tenant's vocabulary (XM-1098); an unknown key matches nothing. XM-1166 G-MT-08 — or an object of operator rules (FacetRulesInput).",
      "schema": {
       "oneOf": [
        {
         "type": "string",
         "maxLength": 840
        },
        {
         "$ref": "#/components/schemas/FacetRulesInput"
        }
       ]
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "description": "XM-1114 (R07) — one of dueDate (the default), priority, updatedAt, key; XM-1171 (G-MT-07) adds title, project, loggedMinutes and stage; a leading `-` for descending.",
      "schema": {
       "type": "string",
       "enum": [
        "dueDate",
        "-dueDate",
        "priority",
        "-priority",
        "updatedAt",
        "-updatedAt",
        "key",
        "-key",
        "title",
        "-title",
        "project",
        "-project",
        "loggedMinutes",
        "-loggedMinutes",
        "stage",
        "-stage"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 25 with the total.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MyTicketsPage"
          },
          "meta": {
           "type": "object",
           "description": "F-WRK-41.R10 (XM-943) — on the first page only.",
           "properties": {
            "viewPreference": {
             "$ref": "#/components/schemas/ViewPreference"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/time-summary": {
   "get": {
    "operationId": "getMyTimeSummary",
    "summary": "Today's total and target, the current period's total and capacity, and the logging streak",
    "x-feature": "F-TIM-08",
    "x-audience": "public",
    "x-assistant": {
     "tool": "get_my_time_summary",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [
      "time",
      "dashboard"
     ],
     "description": "Read your own logged time today and this week."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The member's own summary.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimeSummary"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/time/series": {
   "get": {
    "operationId": "listTimeSeries",
    "summary": "The member's repeat series of time entries (F-TIM-02.R17; XM-960)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The member's own series, newest start first; a series whose project or ticket the member can no longer log to is missing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/WorklogSeriesView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createTimeSeries",
    "summary": "Repeat a time entry — every occurrence through the horizon is a real entry (F-TIM-02.R17; XM-960)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WorklogSeriesCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The series; its occurrences are in listWorklogs and the week grid.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorklogSeriesView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/time/series/{seriesId}": {
   "parameters": [
    {
     "$ref": "#/components/parameters/TenantHeader"
    },
    {
     "name": "seriesId",
     "in": "path",
     "required": true,
     "schema": {
      "$ref": "#/components/schemas/Uuid"
     }
    },
    {
     "name": "scope",
     "in": "query",
     "required": false,
     "description": "\"All entries\" (`all`, the default) or \"This and following\" (`following`, with `from`). \"This entry\" is editWorklog / clearWorklog on the occurrence.",
     "schema": {
      "type": "string",
      "enum": [
       "all",
       "following"
      ]
     }
    },
    {
     "name": "from",
     "in": "query",
     "required": false,
     "description": "The first occurrence date that `following` changes or deletes; a date on or before the start is `all`.",
     "schema": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   ],
   "put": {
    "operationId": "changeTimeSeries",
    "summary": "Change all entries of a repeat series, or this and the following ones (F-TIM-02.R17; XM-960)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WorklogSeriesChangeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The series after the change — for `following`, the new series that holds the entries from `from`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorklogSeriesView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteTimeSeries",
    "summary": "Delete all entries of a repeat series, or this and the following ones (F-TIM-02.R17; XM-960)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/time/starred-tickets/{ticketKey}": {
   "parameters": [
    {
     "$ref": "#/components/parameters/TenantHeader"
    },
    {
     "name": "ticketKey",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string",
      "maxLength": 40
     }
    }
   ],
   "put": {
    "operationId": "starTimeTicket",
    "summary": "Star a ticket for time logging (F-TIM-02.R15; XM-957)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The shortcuts after the change; a ticket already starred changes nothing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimeTicketShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unstarTimeTicket",
    "summary": "Remove the star of a ticket (F-TIM-02.R15; XM-957)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The shortcuts after the change; a star that is not there changes nothing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimeTicketShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/me/time/ticket-shortcuts": {
   "get": {
    "operationId": "getTimeTicketShortcuts",
    "summary": "The member's starred and recent tickets for time logging (F-TIM-02.R15, R16; XM-957, XM-958)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The tickets the member can still see and log to; hidden ones are missing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimeTicketShortcuts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/me/time/ticket-visits": {
   "post": {
    "operationId": "recordTimeTicketVisit",
    "summary": "The member opened a ticket — it becomes their most recent ticket (F-TIM-02.R16; XM-958)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TimeTicketVisit"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Recorded."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/tokens": {
   "get": {
    "operationId": "listMyTokens",
    "summary": "The member's tokens in the current tenant",
    "x-feature": "F-IDN-26",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Tokens without secrets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/PersonalAccessTokenView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "policy"
           ],
           "additionalProperties": false,
           "description": "XM-1015 (G-ACC-06) — the tenant's token policy that the creation dialog obeys.",
           "properties": {
            "policy": {
             "$ref": "#/components/schemas/MemberTokenPolicyView"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createMyToken",
    "summary": "Create a token; the secret is shown once",
    "x-feature": "F-IDN-26",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PersonalAccessTokenCreate"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The token and its plaintext secret (only now).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PersonalAccessTokenCreated"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/tokens/{tokenId}": {
   "delete": {
    "operationId": "revokeMyToken",
    "summary": "Revoke one of the member's tokens",
    "x-feature": "F-IDN-26",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "tokenId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Revoked; the next call with it answers 401."
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/tutorial": {
   "get": {
    "operationId": "getTutorial",
    "summary": "The member's Getting started tour — current step, step states and visibility",
    "x-feature": "F-WSP-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The tour.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TutorialView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/tutorial/actions": {
   "post": {
    "operationId": "recordTutorialAction",
    "summary": "Report a completing action the server cannot observe (opening a ⌘K result — step 5)",
    "x-feature": "F-WSP-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TutorialActionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The tour after the action.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TutorialView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/tutorial/skip": {
   "post": {
    "operationId": "skipTutorial",
    "summary": "Skip one step (\"Next\") or, without a step, skip the whole tour (Dismiss, Skip tour)",
    "x-feature": "F-WSP-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TutorialSkipRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The tour after the skip.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TutorialView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/two-factor": {
   "get": {
    "operationId": "getTwoFactorOverview",
    "summary": "The account's 2FA state and the route tenant's requirement",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/OptionalTenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Enrolment, requirement and recovery-code count.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TwoFactorOverview"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "turnOffTwoFactor",
    "summary": "Turn 2FA off where no tenant requires it",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "responses": {
     "204": {
      "description": "Enrolment, recovery codes and trusted devices removed."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/two-factor/confirm": {
   "post": {
    "operationId": "confirmAuthenticatorSetup",
    "summary": "Confirm the pending secret; first enrolment returns recovery codes once",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AuthenticatorConfirmRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new 2FA state, and the eight codes on a first enrolment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "twoFactor"
           ],
           "properties": {
            "twoFactor": {
             "$ref": "#/components/schemas/TwoFactorOverview"
            },
            "recoveryCodes": {
             "$ref": "#/components/schemas/RecoveryCodesIssued"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/two-factor/recovery-codes": {
   "get": {
    "operationId": "getRecoveryCodeStatus",
    "summary": "Which codes are used and how many remain (never the codes)",
    "x-feature": "F-IDN-16",
    "x-audience": "spa",
    "responses": {
     "200": {
      "description": "The status of the current set.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RecoveryCodeStatus"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/two-factor/recovery-codes/regenerate": {
   "post": {
    "operationId": "regenerateRecoveryCodes",
    "summary": "Replace the set; the new codes are shown once",
    "x-feature": "F-IDN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "201": {
      "description": "Eight new codes (shown once); every earlier code is revoked.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RecoveryCodesIssued"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/two-factor/setup": {
   "post": {
    "operationId": "startAuthenticatorSetup",
    "summary": "Issue a pending secret to add or replace the authenticator",
    "x-feature": "F-IDN-15",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "responses": {
     "201": {
      "description": "The pending secret, valid 10 minutes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AuthenticatorSetup"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/whats-new": {
   "get": {
    "operationId": "getWhatsNew",
    "summary": "Release notes, newest first, with the member's unseen count and the help centre URL",
    "x-feature": "F-WSP-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The panel's content.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WhatsNewView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/me/whats-new/seen": {
   "post": {
    "operationId": "markWhatsNewSeen",
    "summary": "Mark every current release note as seen by the member",
    "x-feature": "F-WSP-11",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Marked."
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/member-avatars": {
   "get": {
    "operationId": "listMemberAvatars",
    "summary": "The members of the tenant that have an avatar, with each version (R12) — the UI asks an image only for these",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "An internal member gets the active internal members with an avatar; a client guest gets only themself (or nothing). Ids and versions only.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberAvatarIndexView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members": {
   "get": {
    "operationId": "listMembers",
    "summary": "The member directory — members, client guests and pending invitations",
    "x-feature": "F-TEN-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[segment]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "all",
        "members",
        "clients",
        "pending"
       ],
       "default": "all"
      }
     },
     {
      "name": "filter[audience]",
      "in": "query",
      "required": false,
      "description": "XM-1470 (F-TEN-04.R12) — only the members and the invitations of this audience, with AND on the segment and the other filters. `client` with the `all` segment lists the active client guests and the client invitations (pending and expired). Without it, the rows are those of the segment.",
      "schema": {
       "type": "string",
       "enum": [
        "internal",
        "client"
       ]
      }
     },
     {
      "name": "filter[role]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[team]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[twoFactor]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "on",
        "off"
       ]
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 100
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "-lastActive",
        "lastActive",
        "name",
        "-name",
        "role",
        "-role",
        "twoFactor",
        "-twoFactor"
       ],
       "default": "-lastActive"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 25
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of rows with exact segment counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/MemberDirectoryRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "counts"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            },
            "counts": {
             "$ref": "#/components/schemas/MemberDirectoryCounts"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/bulk": {
   "post": {
    "operationId": "bulkMemberAction",
    "summary": "Change role, remove or remind up to 100 members — all or nothing",
    "x-feature": "F-TEN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemberBulkRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The affected members with their versions, and skipped targets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberBulkResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/export": {
   "post": {
    "operationId": "exportMembers",
    "summary": "CSV of the selection or of the filtered directory",
    "x-feature": "F-TEN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemberExportRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "A streamed text/csv attachment (up to 100,000 rows); the audit record was committed before the first byte.",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "202": {
      "description": "An export operation of kind member_export for larger sets (XM-17); its result is the file id and row count, read with GET /operations/{id}.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}": {
   "get": {
    "operationId": "getMember",
    "summary": "The Manage panel of one member or client guest",
    "x-feature": "F-TEN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The member's detail with `can` flags; the ETag is the member's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberDetail"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateMember",
    "summary": "Change a member's role, job title or weekly capacity",
    "x-feature": "F-TEN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/MemberUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated detail.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberDetail"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeMember",
    "summary": "Remove a member from the tenant",
    "x-feature": "F-TEN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed (or already removed — a removed member needs no version check)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/access": {
   "get": {
    "operationId": "getMemberAccess",
    "summary": "A member's role, extra permissions and every effective permission with its source",
    "x-feature": "F-ACC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The access view (\"Developer + 2 extra permissions\") with Explain access.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberAccessView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/access-extensions": {
   "post": {
    "operationId": "grantAccessExtension",
    "summary": "Grant one extra permission to an internal member",
    "x-feature": "F-ACC-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AccessExtensionRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The member's access view with the new extension.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberAccessView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/account-recovery-request": {
   "post": {
    "operationId": "requestMemberAccountRecovery",
    "summary": "Open an independent account recovery for a member who lost their authenticator",
    "x-feature": "F-TEN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "202": {
      "description": "The request is open; the person must continue it (F-IDN-15).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "state",
            "initiatorKind"
           ],
           "properties": {
            "state": {
             "type": "string",
             "enum": [
              "requested"
             ]
            },
            "initiatorKind": {
             "type": "string",
             "enum": [
              "tenant_admin",
              "operator"
             ]
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/avatar": {
   "get": {
    "operationId": "getMemberAvatar",
    "summary": "A member's avatar image for an img element of the tenant (R11)",
    "x-feature": "F-IDN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "tenant",
      "in": "query",
      "required": true,
      "description": "The tenant id, checked like X-Kanso-Tenant (an img element cannot send headers).",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "If-None-Match",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 200
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The 256 px WebP image; a strong ETag; Cache-Control private, no-store.",
      "content": {
       "image/webp": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "304": {
      "description": "The image did not change."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/delivery-role-assignments": {
   "post": {
    "operationId": "assignDeliveryRole",
    "summary": "Give a member a delivery role from an effective date, or end it",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/FinanceMemberIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RoleAssignmentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The recorded assignment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleAssignmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/finance-profile": {
   "get": {
    "operationId": "getMemberFinanceProfile",
    "summary": "A member's delivery-role history, project roles and — for view_rates — rates",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/FinanceMemberIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The profile; rates only for a reader with view_rates (audited).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberFinanceProfileView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/sessions/revoke": {
   "post": {
    "operationId": "revokeMemberSessions",
    "summary": "Sign the member out of this tenant",
    "x-feature": "F-TEN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The number of sessions ended.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "sessionCount"
           ],
           "properties": {
            "sessionCount": {
             "type": "integer",
             "minimum": 0
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/two-factor-reset": {
   "post": {
    "operationId": "resetMemberTwoFactor",
    "summary": "Tenant-scoped Reset 2FA — sign out here, end this tenant's device trust, ask the second factor again here",
    "x-feature": "F-TEN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated detail (`twoFactor.lastResetAt` set, `sessions.activeInTenant` 0).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberDetail"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/members/{memberId}/worklogs": {
   "post": {
    "operationId": "logTimeFor",
    "summary": "Log time for another member in the reach of the actor's log_time_on_behalf right",
    "x-feature": "F-TIM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "description": "The person whose time it is.",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WorklogCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The person's new worklog as the holder reads it; `loggedBy` is the holder.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorklogView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/directories/{directoryId}": {
   "patch": {
    "operationId": "moveMemoryDirectory",
    "summary": "Rename or move a directory with its contents",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemoryDirectoryIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryDirectoryInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The moved directory.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryDirectory"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteMemoryDirectory",
    "summary": "Delete a directory — an empty one, or with everything inside it when recursive",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemoryDirectoryIdPath"
     },
     {
      "name": "recursive",
      "in": "query",
      "required": false,
      "description": "true deletes every subdirectory and entry inside it in one transaction, each audited (owner Q28 b); without it a non-empty directory is 409.",
      "schema": {
       "type": "string",
       "enum": [
        "true",
        "false"
       ],
       "default": "false"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/directories/{directoryId}/client-visibility": {
   "put": {
    "operationId": "setMemoryDirectoryClientVisibility",
    "summary": "Set or clear the directory's mark \"Visible to clients\"; it covers every entry below it (R10, R11)",
    "x-feature": "F-MEM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemoryDirectoryIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryClientVisibilityInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The directory with its new ETag.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryDirectory"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/entries/{entryId}": {
   "get": {
    "operationId": "getMemoryEntry",
    "summary": "One entry with its body",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/MemoryEntryIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The entry.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryEntryView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeMemoryEntry",
    "summary": "Replace the body and/or move the entry to a new path",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemoryEntryIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryEntryPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed entry.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryEntryView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteMemoryEntry",
    "summary": "Delete an entry for good",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemoryEntryIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/entries/{entryId}/client-visibility": {
   "put": {
    "operationId": "setMemoryEntryClientVisibility",
    "summary": "Set or clear the entry's mark \"Visible to clients\" (R10)",
    "x-feature": "F-MEM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemoryEntryIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryClientVisibilityInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The entry with its new ETag; meta.outcome is updated or unchanged.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryEntryView"
          },
          "meta": {
           "type": "object",
           "required": [
            "outcome"
           ],
           "properties": {
            "outcome": {
             "type": "string",
             "enum": [
              "updated",
              "unchanged"
             ]
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/participant-erasures": {
   "post": {
    "operationId": "eraseMeetingParticipant",
    "summary": "Erase a meeting participant who is not a member, tenant-wide (a long-running operation)",
    "x-feature": "F-MEM-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "confirmation",
         "withoutLabelMatch"
        ],
        "properties": {
         "email": {
          "$ref": "#/components/schemas/EmailAddress"
         },
         "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         },
         "withoutLabelMatch": {
          "type": "string",
          "enum": [
           "keep_transcript",
           "erase_transcript"
          ],
          "description": "For a matched meeting where no speaker label matches (R06 step 4)."
         },
         "confirmation": {
          "type": "string",
          "enum": [
           "ERASE"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The operation; its result holds the counts of meetings, meetings without a label match, participant rows, passages and named fields.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/participant-exports": {
   "post": {
    "operationId": "exportMeetingParticipant",
    "summary": "Export the data of a meeting participant who is not a member (a long-running operation with a file)",
    "x-feature": "F-MEM-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "email": {
          "$ref": "#/components/schemas/EmailAddress"
         },
         "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The operation; its result holds the file id and the counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/segments": {
   "get": {
    "operationId": "listMemorySegments",
    "summary": "The tenant's segments; an Admin sees all with grants, a member sees the segments that the member reads",
    "x-feature": "F-MEM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "At most 100 segments (`memory.segments.maxPerTenant`), by name (the registry is bounded; no cursor).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/MemorySegmentView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createMemorySegment",
    "summary": "Create a segment with its grants (an Admin)",
    "x-feature": "F-MEM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemorySegmentInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The segment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemorySegmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/segments/{segmentKey}": {
   "patch": {
    "operationId": "changeMemorySegment",
    "summary": "Change a segment's name, description, grants, client sharing or meeting intake (an Admin)",
    "x-feature": "F-MEM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemorySegmentKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/MemorySegmentPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed segment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemorySegmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/memory/segments/{segmentKey}/archive": {
   "post": {
    "operationId": "archiveMemorySegment",
    "summary": "Archive a segment; its items stay readable for its grantees and it takes no new item",
    "x-feature": "F-MEM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/MemorySegmentKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived segment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemorySegmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/messages/search": {
   "get": {
    "operationId": "searchMessages",
    "summary": "Search the caller's visible messages",
    "x-feature": "F-MSG-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 120
      }
     },
     {
      "name": "filter[conversationId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Up to 20 hits, newest first, with excerpts.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MessageSearchPage"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/messages/{messageId}": {
   "patch": {
    "operationId": "editMessage",
    "summary": "Edit a message inside the edit window",
    "x-feature": "F-MSG-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/MessageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/MessagePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The edited message.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MessageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteMessage",
    "summary": "Delete a message — the author, the rule's owner or a moderator",
    "x-feature": "F-MSG-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/MessageIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted (or already deleted)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/new-project-defaults": {
   "get": {
    "operationId": "getNewProjectDefaults",
    "summary": "The tenant's defaults for new projects",
    "x-feature": "F-PRJ-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The current template with its version; the built-in template when never saved.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/NewProjectDefaultsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "put": {
    "operationId": "saveNewProjectDefaults",
    "summary": "Replace the defaults for new projects; existing projects are never changed",
    "x-feature": "F-PRJ-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NewProjectDefaultsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved template with its new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/NewProjectDefaultsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/notifications": {
   "get": {
    "operationId": "listNotifications",
    "summary": "The caller's notifications in the current tenant, newest first, 20 per page, with the unread count",
    "x-feature": "F-NOT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "description": "The \"Show\" tab (G-N1; the Inbox connect, 22 Nov 2026): `unread` — the unread rows shown now; `snoozed` — the rows snoozed past now (hidden from the other lists until then). Absent or `all`: every row shown now.",
      "schema": {
       "type": "string",
       "enum": [
        "all",
        "unread",
        "snoozed"
       ]
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "\"Filter notifications\" (XM-762): 1–100 characters matched case-insensitively as a part of the actor's name, the target key, the excerpt or a stored title. A hidden row never matches.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 100
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "description": "`counts` adds `meta.counts` (the tab numbers) to the first page (GAP-NOT-03).",
      "schema": {
       "type": "string",
       "enum": [
        "counts"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page and the unread count.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/NotificationRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/NotificationTrayMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/notifications/read-all": {
   "post": {
    "operationId": "markAllNotificationsRead",
    "summary": "Mark every unread notification of the caller in this tenant read",
    "x-feature": "F-NOT-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Every row is read."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/notifications/{notificationId}/read": {
   "post": {
    "operationId": "markNotificationRead",
    "summary": "Mark one notification read (opening a row does this)",
    "x-feature": "F-NOT-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "notificationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The row is read."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/notifications/{notificationId}/snooze": {
   "post": {
    "operationId": "snoozeNotification",
    "summary": "Hide an unread notification until a time; it returns unread",
    "x-feature": "F-NOT-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "notificationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NotificationSnoozeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The snoozed row with its time.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/NotificationRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unsnoozeNotification",
    "summary": "Bring a snoozed notification back now",
    "x-feature": "F-NOT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "notificationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The row is unread and visible."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/notifications/{notificationId}/unread": {
   "post": {
    "operationId": "markNotificationUnread",
    "summary": "Mark one notification unread again",
    "x-feature": "F-NOT-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "notificationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The row is unread."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/operations": {
   "get": {
    "operationId": "listOperations",
    "summary": "The caller's own long-running operations in the tenant, newest first, cursor-paged",
    "description": "Requester-only (05-api §10.2; XM-16) — never another member's. filter[state] and filter[kind] are comma lists (\"any of\"); the next link keeps them. A cursor is sealed to its reader, tenant and filters.",
    "x-feature": "F-AUD-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "description": "Any of queued, running, succeeded, failed, cancelled (comma-separated).",
      "schema": {
       "type": "string",
       "maxLength": 200,
       "example": "queued,running"
      }
     },
     {
      "name": "filter[kind]",
      "in": "query",
      "required": false,
      "description": "Any of the operation kinds (comma-separated), e.g. audit_export.",
      "schema": {
       "type": "string",
       "maxLength": 4100,
       "example": "audit_export"
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of the caller's operations.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/Operation"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/operations/{operationId}": {
   "get": {
    "operationId": "getOperation",
    "summary": "One of the caller's long-running operations — its state, progress, result or problem",
    "description": "Requester-only (05-api §10.2; XM-16). Retry-After tells a poller when to ask again while the operation is queued or running; links.result is the authorised download of an export's file until it expires.",
    "x-feature": "F-AUD-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "operationId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The operation.",
      "headers": {
       "Retry-After": {
        "description": "Seconds until the next poll, while the operation is queued or running.",
        "schema": {
         "type": "integer",
         "minimum": 1
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}": {
   "get": {
    "operationId": "getOpportunity",
    "summary": "The opportunity's detail — description, decision, interview notes, votes and the viewer's rights",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The detail; ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityDetail"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "editOpportunity",
    "summary": "Change title, description, note, owner or confidence",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/OpportunityPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed detail.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityDetail"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/decision": {
   "post": {
    "operationId": "decideOpportunity",
    "summary": "Record or amend the decision; with Build, link an existing ticket or create one (D-090)",
    "x-feature": "F-DSC-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OpportunityDecisionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The decided opportunity, its decision and, when one was created, the new ticket's key.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityDecisionResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence": {
   "get": {
    "operationId": "listInterviewNotes",
    "summary": "Interview notes, newest first, 25 per page",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of notes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewNotePage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addInterviewNote",
    "summary": "Add an interview note as evidence",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InterviewNoteRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The note.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewNoteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence/{evidenceId}": {
   "patch": {
    "operationId": "editInterviewNote",
    "summary": "Change one's own interview note",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/InterviewNotePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed note.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewNoteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeInterviewNote",
    "summary": "Remove an interview note (its author or a manager)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence/{evidenceId}/reactions/{emoji}": {
   "put": {
    "operationId": "addInterviewNoteReaction",
    "summary": "Add the caller's own reaction to an interview note (idempotent; XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "emoji",
      "in": "path",
      "required": true,
      "description": "The emoji, percent-encoded; a catalogue entry (F-WRK-38.R02).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 64
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The note as the caller now reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewNoteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeInterviewNoteReaction",
    "summary": "Remove the caller's own reaction from an interview note (idempotent; XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "emoji",
      "in": "path",
      "required": true,
      "description": "The emoji, percent-encoded; a catalogue entry (F-WRK-38.R02).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 64
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The note as the caller now reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewNoteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence/{evidenceId}/reopen": {
   "post": {
    "operationId": "reopenInterviewNote",
    "x-idempotency": "exempt",
    "summary": "Reopen a resolved interview note (its author or a manager; idempotent; XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The note, open.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewNoteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence/{evidenceId}/replies": {
   "get": {
    "operationId": "listInterviewNoteReplies",
    "summary": "All the replies of an interview note, oldest first (XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The replies (at most 100).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewReplyList"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addInterviewNoteReply",
    "summary": "Reply to an interview note (XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InterviewReplyRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The reply.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewReplyView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence/{evidenceId}/replies/{replyId}": {
   "patch": {
    "operationId": "editInterviewNoteReply",
    "summary": "Change one's own reply (XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "replyId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/InterviewReplyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed reply.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewReplyView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeInterviewNoteReply",
    "summary": "Remove a reply (its author or a manager; XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "replyId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence/{evidenceId}/replies/{replyId}/reactions/{emoji}": {
   "put": {
    "operationId": "addInterviewReplyReaction",
    "summary": "Add the caller's own reaction to a reply (idempotent; XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "replyId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "emoji",
      "in": "path",
      "required": true,
      "description": "The emoji, percent-encoded; a catalogue entry (F-WRK-38.R02).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 64
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The reply as the caller now reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewReplyView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeInterviewReplyReaction",
    "summary": "Remove the caller's own reaction from a reply (idempotent; XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "replyId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "emoji",
      "in": "path",
      "required": true,
      "description": "The emoji, percent-encoded; a catalogue entry (F-WRK-38.R02).",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 64
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The reply as the caller now reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewReplyView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/evidence/{evidenceId}/resolve": {
   "post": {
    "operationId": "resolveInterviewNote",
    "x-idempotency": "exempt",
    "summary": "Resolve an interview note (its author or a manager; idempotent; XM-1786)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The note, resolved.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/InterviewNoteView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/position": {
   "put": {
    "operationId": "placeOpportunity",
    "summary": "Move an opportunity to a stage and between neighbours (D-091)",
    "x-feature": "F-DSC-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OpportunityPositionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new stage, rank and version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityPositionResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/request-evidence": {
   "get": {
    "operationId": "listRequestEvidence",
    "summary": "The client requests cited by an opportunity, newest first",
    "x-feature": "F-DSC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 25.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/RequestEvidenceView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "linkRequestEvidence",
    "summary": "Link a help-desk request to an opportunity as evidence",
    "x-feature": "F-DSC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RequestEvidenceDraft"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The evidence as the actor reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RequestEvidenceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/request-evidence/{evidenceId}": {
   "patch": {
    "operationId": "editRequestEvidence",
    "summary": "Change the summary of one's own request evidence",
    "x-feature": "F-DSC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "type": "object",
        "required": [
         "summary"
        ],
        "properties": {
         "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed evidence.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RequestEvidenceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeRequestEvidence",
    "summary": "Remove a request evidence (its author or a manager)",
    "x-feature": "F-DSC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "evidenceId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/opportunities/{opportunityId}/vote": {
   "put": {
    "operationId": "castOpportunityVote",
    "summary": "Vote for the opportunity (one vote per member)",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The votes after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityVoteResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "withdrawOpportunityVote",
    "summary": "Withdraw the member's vote",
    "x-feature": "F-DSC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "opportunityId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The votes after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityVoteResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/outbound-deliveries/{deliveryId}/redeliver": {
   "post": {
    "operationId": "redeliverOutboundDelivery",
    "summary": "Re-send a failed or suppressed delivery's stored bytes under its original webhook-id, if still allowed",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/OutboundDeliveryIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "202": {
      "description": "Queued for sending.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OutboundDeliveryView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/plan-versions/{planVersionId}": {
   "get": {
    "operationId": "getPlanVersion",
    "summary": "One plan version with its totals and warnings",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The version (ETag is its version).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PlanVersionView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "discardPlanVersion",
    "summary": "Discard the draft; it stays readable as history",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Discarded."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updatePlanVersion",
    "summary": "Change the note of the draft",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlanVersionPatchRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The draft with its new note (ETag is its version).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PlanVersionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/plan-versions/{planVersionId}/approve": {
   "post": {
    "operationId": "approvePlanVersion",
    "summary": "Approve the draft as the project's baseline; amounts freeze, the earlier baseline is superseded",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlanApproveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The approved version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PlanVersionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/plan-versions/{planVersionId}/expense-line-changes": {
   "post": {
    "operationId": "changePlanExpenseLines",
    "summary": "Add, change or delete up to 500 planned expense lines of a draft, all or nothing",
    "x-feature": "F-FIN-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlanExpenseLineChangesRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The draft with its new totals and warnings.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PlanVersionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/plan-versions/{planVersionId}/expense-lines": {
   "get": {
    "operationId": "listPlanExpenseLines",
    "summary": "The planned expense lines of a plan version, by month then category",
    "x-feature": "F-FIN-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[month]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/YearMonth"
      }
     },
     {
      "name": "filter[categoryId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 100 expense lines.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/PlanExpenseLineView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/plan-versions/{planVersionId}/line-changes": {
   "post": {
    "operationId": "changePlanLines",
    "summary": "Add, change or delete up to 500 lines of a draft, all or nothing",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlanLineChangesRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The draft with its new totals and warnings.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PlanVersionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/plan-versions/{planVersionId}/lines": {
   "get": {
    "operationId": "listPlanLines",
    "summary": "The lines of a plan version, by month then subject",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PlanVersionIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[month]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/YearMonth"
      }
     },
     {
      "name": "filter[teamId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[subjectKind]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "member",
        "role"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 100 lines.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/PlanLineView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal-branding": {
   "get": {
    "operationId": "getPortalBranding",
    "summary": "The tenant's portal branding",
    "x-feature": "F-POR-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The logo's authorised URL, the colour and the version (`ETag`); absent members mean the default.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalBrandingView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "savePortalBranding",
    "summary": "Set or remove the tenant's portal logo and accent colour",
    "x-feature": "F-POR-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PortalBrandingRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved branding with its new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalBrandingView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/approval-requests/{requestId}/decision": {
   "post": {
    "operationId": "decideApproval",
    "summary": "Approve or request changes — the first valid decision of an eligible reviewer closes the request",
    "x-feature": "F-POR-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalDecisionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The recorded decision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ApprovalDecisionResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/comments/{commentId}": {
   "patch": {
    "operationId": "editPortalReply",
    "summary": "Edit one's own client reply within the tenant's edit window",
    "x-feature": "F-POR-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/PortalReplyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The edited reply as a conversation entry.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalConversationEntry"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deletePortalReply",
    "summary": "Delete one's own client reply (soft, audited)",
    "x-feature": "F-POR-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted (also for a reply that was already deleted)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/comments/{commentId}/read": {
   "put": {
    "operationId": "markThreadRead",
    "summary": "Mark the conversation read up to this message (the guest's own read marker; forward only, idempotent)",
    "x-feature": "F-POR-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Recorded — also when the marker is already at or after this message (no write)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/doc-pages/{docPageId}": {
   "get": {
    "operationId": "getPortalDocument",
    "summary": "A shared page's latest published revision for reading in the portal",
    "x-feature": "F-POR-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "docPageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The title, revision, publication date, the sharing member and the body.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalDocument"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/messages/{messageId}": {
   "patch": {
    "operationId": "editPortalMessage",
    "summary": "A client edits their own message inside the edit window",
    "x-feature": "F-MSG-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/MessageIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/MessagePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The edited message as the client sees it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalMessageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deletePortalMessage",
    "summary": "A client deletes their own message",
    "x-feature": "F-MSG-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/MessageIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted (or already deleted)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}": {
   "get": {
    "operationId": "getPortalOverview",
    "summary": "The portal overview — title, status strip, waiting approvals, contact and recently updated tickets",
    "x-feature": "F-POR-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "timeZone",
      "in": "query",
      "required": false,
      "description": "The browser's zone, used when the reader's profile has none (D-128).",
      "schema": {
       "$ref": "#/components/schemas/IanaTimeZone"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The overview for the acting guest or the previewed role.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalOverview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/approval-requests": {
   "get": {
    "operationId": "listPortalApprovals",
    "summary": "The portal's approval queue (never paged) and decided history (25 per page)",
    "x-feature": "F-POR-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The queue, one page of the history and its total; links.next continues the history.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalApprovalsView"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/doc-comment-threads/{threadId}/comments": {
   "post": {
    "operationId": "postPortalDocComment",
    "summary": "Reply in a client thread of this portal",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/DocThreadIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocCommentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new comment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocCommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/doc-pages/{docPageId}/comment-threads": {
   "get": {
    "operationId": "listPortalDocCommentThreads",
    "summary": "The client threads of a page in this portal",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "docPageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of client threads.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocThreadView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "openPortalDocCommentThread",
    "summary": "Open a page-level client thread",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "docPageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocCommentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new client thread.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocThreadView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/doc-search": {
   "get": {
    "operationId": "searchPortalDocs",
    "summary": "Find the portal's published, client-visible pages by their words",
    "x-feature": "F-DOC-18",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of hits.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/PortalDocSearchHit"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/doc-space-pages/{docPageId}": {
   "get": {
    "operationId": "getPortalDocSpacePage",
    "summary": "A linked space's page as the client reads it — its latest published revision",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "docPageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalDocSpacePage"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/doc-spaces": {
   "get": {
    "operationId": "listPortalDocSpaces",
    "summary": "The linked spaces that the portal shows, with their counts of readable pages",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The spaces.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/PortalDocSpace"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/doc-spaces/{spaceId}/pages": {
   "get": {
    "operationId": "listPortalDocSpacePages",
    "summary": "The client-visible pages of one linked space, in tree order, 25 per page",
    "x-feature": "F-DOC-20",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/DocSpaceIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of rows.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/PortalDocSpacePageRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/documents": {
   "get": {
    "operationId": "getPortalDocuments",
    "summary": "The portal's shared documents (published revisions) and shared files, 25 per panel page",
    "x-feature": "F-POR-15",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "panel",
      "in": "query",
      "required": false,
      "description": "both on the first load; documents or files to continue one panel.",
      "schema": {
       "type": "string",
       "enum": [
        "both",
        "documents",
        "files"
       ],
       "default": "both"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The panels with their counts and next cursors.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalDocumentsView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/knowledge": {
   "get": {
    "operationId": "listClientKnowledge",
    "summary": "The client-shared knowledge items of the project, for the client's portal",
    "x-feature": "F-MEM-04",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/KnowledgeItemTypeKey"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "XM-1046: a keyword search of the client-visible items — the key (a prefix) or the title (contains), never the body. The cursor is bound to it.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50, newest change first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/ClientKnowledgeRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/knowledge/{itemKey}": {
   "get": {
    "operationId": "getClientKnowledgeItem",
    "summary": "One client-shared knowledge item in its client projection",
    "x-feature": "F-MEM-04",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/KnowledgeItemKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The client projection of the item.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientKnowledgeView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/memory/entries": {
   "get": {
    "operationId": "listClientMemoryEntries",
    "summary": "The client-visible memory entries of the project, for the portal's Knowledge page (R11, R13)",
    "x-feature": "F-MEM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "The search of the visible entries only (path and text). The cursor is bound to it.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50 in path order, or in the search's rank with q.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/ClientMemoryEntryRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/memory/entries/{entryId}": {
   "get": {
    "operationId": "getClientMemoryEntry",
    "summary": "One client-visible memory entry with its Markdown (R13)",
    "x-feature": "F-MEM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/MemoryEntryIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The entry.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientMemoryEntryView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/messages": {
   "get": {
    "operationId": "listPortalMessages",
    "summary": "The client's side of the project conversation — current period and shared messages",
    "x-feature": "F-MSG-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "after",
      "in": "query",
      "required": false,
      "description": "An opaque cursor from a previous page's lastCursor or a message's cursor.",
      "schema": {
       "type": "string",
       "maxLength": 256
      }
     },
     {
      "name": "before",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 256
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 50
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "Search inside the current period (F-MSG-10).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 120
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Portal message views oldest first (a search answers newest first) with the conversation facts.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PortalMessagePage"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "postPortalMessage",
    "summary": "Post a client message in the project conversation",
    "x-feature": "F-MSG-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MessagePostRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The posted message as the client sees it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalMessageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/messages/read": {
   "put": {
    "operationId": "markPortalMessagesRead",
    "summary": "A client moves their read marker in the project conversation",
    "x-feature": "F-MSG-07",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PortalReadMarkRequest"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "The marker moved (or stayed, moving only forward). No body: a client never receives a sequence or a conversation id (R06, CFL-906, S08); the portal's messages page carries the unread count (`meta.conversation.unreadCount`). XM-719 (a)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/realtime": {
   "get": {
    "operationId": "getPortalRealtimeChannel",
    "summary": "The portal channel to subscribe — the guest's client channel at its current epoch, or a preview's own channel (SEC-WRK2-07)",
    "x-feature": "F-POR-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The channel.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "channel"
           ],
           "properties": {
            "channel": {
             "type": "string",
             "maxLength": 160,
             "pattern": "^private-tenant\\.[0-9a-f-]{36}\\.project\\.[0-9a-f-]{36}\\.client\\.(v[1-9][0-9]{0,17}|preview\\.[0-9a-f-]{36})$"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/request-counts": {
   "get": {
    "operationId": "getPortalRequestCounts",
    "summary": "The Requests tab's counts for the portal shell (R13)",
    "x-feature": "F-HLP-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The counts over the requests the reader may read.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestCounts"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/request-form": {
   "get": {
    "operationId": "getPortalRequestForm",
    "summary": "The current request form as a client reads it",
    "x-feature": "F-HLP-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Categories, fields and the intro without archived items or internal mapping.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskFormClientView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/requests": {
   "post": {
    "operationId": "submitPortalRequest",
    "summary": "Register a request in the portal",
    "x-feature": "F-HLP-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskRequestDraft"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The request as the guest reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "get": {
    "operationId": "listPortalRequests",
    "summary": "The client's requests of a project",
    "x-feature": "F-HLP-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "open",
        "closed",
        "all"
       ],
       "default": "open"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 25.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/HelpDeskClientRequestRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/HelpDeskClientListMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/projects/{projectKey}/tickets": {
   "get": {
    "operationId": "listPortalTickets",
    "summary": "The client's ticket list — client-visible tickets, open by due date then done, 25 per page",
    "x-feature": "F-POR-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "segment",
      "in": "query",
      "required": false,
      "description": "all, or the id of a shown stage.",
      "schema": {
       "type": "string",
       "maxLength": 36,
       "default": "all"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of rows with the total under All, the segments and whether the due-date column applies.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/PortalTicketRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/PortalTicketListMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/requests/{requestKey}": {
   "get": {
    "operationId": "getPortalRequest",
    "summary": "One request as the client reads it",
    "x-feature": "F-HLP-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The client view.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/requests/{requestKey}/messages": {
   "get": {
    "operationId": "listPortalRequestMessages",
    "summary": "The client-visible messages, oldest first",
    "x-feature": "F-HLP-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/HelpDeskMessageView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "postPortalRequestMessage",
    "summary": "Reply on a request",
    "x-feature": "F-HLP-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskMessageDraft"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The request view with the new message.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/requests/{requestKey}/withdraw": {
   "post": {
    "operationId": "withdrawPortalRequest",
    "summary": "Withdraw an open request",
    "x-feature": "F-HLP-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The withdrawn request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskClientRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/tickets/{ticketKey}": {
   "get": {
    "operationId": "getPortalTicket",
    "summary": "One shared ticket as the client may see it",
    "x-feature": "F-POR-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The masked ticket with files, the open request and the reader's can.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalTicket"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/tickets/{ticketKey}/attachments": {
   "post": {
    "operationId": "attachPortalFile",
    "summary": "Attach an uploaded file to the ticket as the client — always Shared with client",
    "x-feature": "F-POR-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PortalAttachRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The attachment as the portal lists it (status scanning until the scan is clean).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalFile"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/tickets/{ticketKey}/comments": {
   "get": {
    "operationId": "listPortalConversation",
    "summary": "The client conversation — the Client thread and decision entries, 50 per page, newest page first",
    "x-feature": "F-POR-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Entries in chronological order; links.next names the earlier page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/PortalConversationEntry"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "total"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "total": {
             "type": "integer",
             "minimum": 0
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "postPortalReply",
    "summary": "Post a client reply in the ticket's Client thread",
    "x-feature": "F-POR-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PortalReplyRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The reply as a conversation entry.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PortalConversationEntry"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/tickets/{ticketKey}/views": {
   "post": {
    "operationId": "recordPortalTicketView",
    "summary": "Record that the client opened the ticket (throttled; never for previews)",
    "x-feature": "F-POR-08",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Recorded, or skipped by the throttle or the tenant setting."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/portal/tour": {
   "get": {
    "operationId": "getClientTour",
    "summary": "The client guest's tour progress and whether to show it",
    "x-feature": "F-POR-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The three steps and visibility; in View as client always `visible` false.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientTourView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "saveClientTour",
    "summary": "Skip one step or dismiss the tour",
    "x-feature": "F-POR-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientTourRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The progress after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientTourView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/previews": {
   "post": {
    "operationId": "startClientView",
    "summary": "Open or renew View as client for one project's client role — a read-only token of at most 15 minutes",
    "x-feature": "F-POR-05",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PreviewStartRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The session, its token and expiry, the role, the project and the organisation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PreviewSessionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/previews/options": {
   "get": {
    "operationId": "getPreviewOptions",
    "summary": "Whether View as client is available for a project and which client roles it offers",
    "x-feature": "F-POR-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Availability, the offered roles, the default and whether the selector is shown.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PreviewOptions"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/previews/{previewId}/end": {
   "post": {
    "operationId": "endClientView",
    "summary": "End View as client; the only operation a preview token may write",
    "x-feature": "F-POR-05",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "previewId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The session ended (or had already ended)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/priorities": {
   "get": {
    "operationId": "listPriorities",
    "summary": "The tenant's priority list, lowest first, for every reader (internal members and client guests)",
    "x-feature": "F-WRK-40",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Every entry (archived ones too), the list version and whether the reader may change the list; ETag is the list version.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PriorityVocabularyView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "put": {
    "operationId": "replacePriorities",
    "summary": "Save the tenant's priority list (the Admin; the whole list, lowest first, in one Save)",
    "x-feature": "F-WRK-40",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PriorityVocabularyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new list; ETag is the new list version.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PriorityVocabularyView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects": {
   "get": {
    "operationId": "listProjects",
    "summary": "The project catalogue — the member's visible projects, filtered, segmented and paged with totals",
    "x-feature": "F-PRJ-01",
    "x-audience": "public",
    "x-assistant": {
     "tool": "list_projects",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [
      "projects"
     ],
     "description": "List the projects that you can open in this tenant, with their keys and names."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "filter[teamId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[clientOrganisationId]",
      "in": "query",
      "required": false,
      "description": "An organisation id, or none for projects without a client.",
      "schema": {
       "type": "string",
       "maxLength": 36
      }
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "any"
       ],
       "default": "active"
      }
     },
     {
      "name": "filter[segment]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "all",
        "pinned",
        "mine",
        "archived"
       ],
       "default": "all"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "description": "R09; XM-1473: 5 is the compact page of the designed list (the other offset lists take 10, 20, 25, 30, 50 or 100).",
      "schema": {
       "type": "integer",
       "enum": [
        5,
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 10
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "description": "XM-1118 (R08; G-H-34): the order of the rows. The keys are updated (the last activity), name, team (the team name), client (the organisation name), members (the People count), openTickets and sprint (the end date of the active sprint). A leading - means descending. The project id breaks every tie, in the same direction. A project without a client or without a sprint comes last. members over more than 10,000 visible, filtered projects gives 400 query.invalid, which names sort with too_many_projects.",
      "schema": {
       "type": "string",
       "enum": [
        "updated",
        "-updated",
        "name",
        "-name",
        "team",
        "-team",
        "client",
        "-client",
        "members",
        "-members",
        "openTickets",
        "-openTickets",
        "sprint",
        "-sprint"
       ],
       "default": "-updated"
      }
     },
     {
      "name": "filter[memberId]",
      "in": "query",
      "required": false,
      "description": "XM-1118 (R03; G-H-31): 1–20 member ids, separated by commas, from meta.facets.members. The filter keeps the projects whose People list holds any of these members. XM-1473: \";\" separates groups that combine with AND (A,B;C = A or B, and also C); at most 10 groups and 20 ids in all.",
      "schema": {
       "type": "string",
       "maxLength": 750
      }
     },
     {
      "name": "filter[notMemberId]",
      "in": "query",
      "required": false,
      "description": "XM-1118 (R03): 1–20 member ids, separated by commas. The filter keeps the projects whose People list holds none of these members. XM-1473: \";\" groups combine into one list (at most 10 groups and 20 ids in all).",
      "schema": {
       "type": "string",
       "maxLength": 750
      }
     },
     {
      "name": "filter[members]",
      "in": "query",
      "required": false,
      "description": "XM-1473 (R03): empty keeps the projects whose People list has no active internal person (nobody in the owning team and no active team-kind membership of an active internal member); not_empty keeps the others. \";\" separates up to 10 conditions that combine with AND.",
      "schema": {
       "type": "string",
       "maxLength": 100,
       "pattern": "^(empty|not_empty)(;(empty|not_empty)){0,9}$"
      }
     },
     {
      "name": "filter[sprint]",
      "in": "query",
      "required": false,
      "description": "XM-1118 (R03, R07): active keeps the active projects that have an active sprint and an available Backlog & sprints module. none keeps all other projects (\"No sprint\"). XM-1473: \";\" separates up to 10 conditions that combine with AND (active;none matches no project). The grid's \"is empty\" is none and \"is not empty\" is active.",
      "schema": {
       "type": "string",
       "maxLength": 100,
       "pattern": "^(active|none)(;(active|none)){0,9}$"
      }
     },
     {
      "name": "filter[openTickets][gte]",
      "in": "query",
      "required": false,
      "description": "XM-1118 (R03): the minimum number of open tickets. The grid operators map to gte, lte, neq and notBetween; these conditions combine with AND. XM-1473: \";\" separates up to 10 numbers (the highest applies). Open tickets \"is not empty\" is gte=1.",
      "schema": {
       "oneOf": [
        {
         "type": "integer",
         "minimum": 0,
         "maximum": 1000000
        },
        {
         "type": "string",
         "pattern": "^\\d{1,7}(;\\d{1,7}){0,9}$"
        }
       ]
      }
     },
     {
      "name": "filter[openTickets][lte]",
      "in": "query",
      "required": false,
      "description": "XM-1118 (R03): the maximum number of open tickets. XM-1473: \";\" separates up to 10 numbers (the lowest applies). Open tickets \"is empty\" is lte=0.",
      "schema": {
       "oneOf": [
        {
         "type": "integer",
         "minimum": 0,
         "maximum": 1000000
        },
        {
         "type": "string",
         "pattern": "^\\d{1,7}(;\\d{1,7}){0,9}$"
        }
       ]
      }
     },
     {
      "name": "filter[openTickets][neq]",
      "in": "query",
      "required": false,
      "description": "XM-1118 (R03): a number of open tickets that the project must not have. XM-1473: \";\" separates up to 10 numbers, each excluded.",
      "schema": {
       "oneOf": [
        {
         "type": "integer",
         "minimum": 0,
         "maximum": 1000000
        },
        {
         "type": "string",
         "pattern": "^\\d{1,7}(;\\d{1,7}){0,9}$"
        }
       ]
      }
     },
     {
      "name": "filter[openTickets][notBetween]",
      "in": "query",
      "required": false,
      "description": "XM-1473 (R03): a,b (0–1,000,000, a ≤ b) keeps the projects with fewer than a or more than b open tickets (the grid's \"not between\"). \";\" separates up to 10 ranges, each excluded.",
      "schema": {
       "type": "string",
       "maxLength": 160,
       "pattern": "^\\d{1,7},\\d{1,7}(;\\d{1,7},\\d{1,7}){0,9}$"
      }
     },
     {
      "name": "filter[module]",
      "in": "query",
      "required": false,
      "description": "R03 (day-2 fix round, 25 Nov 2026; F-HLP-04.R02): one project module key. Keeps the active projects where the module is on and available (the tenant's gate of the module, the feature flag and the plan, is open); a closed gate matches no project. An unknown key is 400 query.invalid. Administration › Help desk lists the projects of a new connection with help_desk.",
      "schema": {
       "$ref": "#/components/schemas/ProjectModuleKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of rows ordered by last activity, with page totals, segment counts and the filter facets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/ProjectCatalogueRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/ProjectCatalogueMeta"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createProject",
    "summary": "Create a project from the tenant's defaults for new projects",
    "x-feature": "F-PRJ-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectDraft"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The created project's document; Location names it by key.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/bulk": {
   "post": {
    "operationId": "bulkProjectAction",
    "summary": "Pin, unpin or archive 1–100 projects, all or nothing",
    "x-feature": "F-PRJ-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BulkProjectRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The action, the number affected and per target its new version or unchanged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BulkProjectResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/creation-options": {
   "get": {
    "operationId": "getProjectCreationOptions",
    "summary": "What the New project dialog may offer the caller",
    "x-feature": "F-PRJ-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The teams the caller may choose, whether a client may be set, the limit usage and the defaults version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectCreationOptions"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/validate": {
   "post": {
    "operationId": "validateProjectDraft",
    "summary": "Dry run — suggest a key and check the draft without creating anything",
    "x-feature": "F-PRJ-02",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The suggested key, its availability, the limit usage and the per-field errors; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDraftValidation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}": {
   "get": {
    "operationId": "getProject",
    "summary": "The project document every project route loads",
    "x-feature": "F-PRJ-04",
    "x-audience": "public",
    "x-assistant": {
     "tool": "get_project",
     "kind": "read",
     "requires": {
      "scope": "project",
      "capability": null
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "never",
     "pages": [
      "project-overview"
     ],
     "description": "Read one project that you can open: its name, modules, and what you can do in it (the can list and the fields you see)."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The project with modules and availability, stages, Timeline settings, field-set version and the caller's capabilities; ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateProject",
    "summary": "Edit the project document — name, key (before the first ticket), team, modules, Timeline settings",
    "x-feature": "F-PRJ-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The project document with its new version (and its canonical key after a key change).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/activity": {
   "get": {
    "operationId": "listProjectActivity",
    "summary": "Project activity, newest first, 20 per page, rendered for the caller",
    "x-feature": "F-WRK-24",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Entries; links.next for \"Show more\".",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/ActivityEntry"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ai-settings": {
   "patch": {
    "operationId": "updateAiProjectSettings",
    "summary": "Switch a project's AI (its Project chat module) and set its monthly limit",
    "x-feature": "F-AST-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/AiProjectSettingsPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The project's row after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AiProjectSettingsRow"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/archive": {
   "post": {
    "operationId": "archiveProject",
    "summary": "Archive a project — hidden from navigation, pickers, counts, AI and the portal; everything kept",
    "x-feature": "F-PRJ-08",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The project document, archived.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/assignees": {
   "get": {
    "operationId": "listProjectAssignees",
    "summary": "The people whom the assignee and reporter pickers offer — the project's team and members whom the writes accept (XM-1603; R08)",
    "x-feature": "F-WRK-23",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "list_project_assignees",
     "kind": "read",
     "requires": {
      "scope": "project",
      "capability": "ticket.create"
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "never",
     "pages": [
      "create-ticket"
     ],
     "description": "List the people that a new ticket of a project can be assigned to."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The picker's people, in name order.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectAssigneeList"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/backlog": {
   "get": {
    "operationId": "getBacklog",
    "summary": "The complete active-sprint section and one ranked backlog page of 50; filters narrow the backlog only",
    "x-feature": "F-WRK-06",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/WorkFilterQuery"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "description": "customFields adds the custom-field values the caller may see (F-WRK-27).",
      "schema": {
       "type": "string",
       "enum": [
        "customFields"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/RowColumnsQuery"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The sprint section (first page only) and a backlog page; links.next for the next 50.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BacklogView"
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "viewPreference": {
             "$ref": "#/components/schemas/ViewPreference"
            },
            "totals": {
             "$ref": "#/components/schemas/BacklogTotals"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/board": {
   "get": {
    "operationId": "getBoard",
    "summary": "The active sprint's columns (or the open tickets with sprints off) with exact counts and the first 100 cards per column",
    "x-feature": "F-WRK-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/WorkFilterQuery"
     },
     {
      "$ref": "#/components/parameters/WorkSearchQuery"
     },
     {
      "$ref": "#/components/parameters/BoardSortQuery"
     },
     {
      "name": "groupBy",
      "in": "query",
      "required": false,
      "description": "assignee, priority or epic groups the board into swimlanes (F-WRK-04; priority and epic since XM-1099).",
      "schema": {
       "type": "string",
       "enum": [
        "columns",
        "assignee",
        "priority",
        "epic"
       ],
       "default": "columns"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The board.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BoardView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/board/columns/{stageId}": {
   "get": {
    "operationId": "getBoardColumnPage",
    "summary": "The next page (100 cards) of one board column, under the same filters",
    "x-feature": "F-WRK-02",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "stageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/WorkFilterQuery"
     },
     {
      "$ref": "#/components/parameters/WorkSearchQuery"
     },
     {
      "$ref": "#/components/parameters/BoardSortQuery"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One column page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BoardColumnPage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/board/lanes": {
   "get": {
    "operationId": "getBoardLanes",
    "summary": "The next page of swimlanes of the grouped board — by assignee, priority or epic (20 lanes, 25 cards per cell)",
    "x-feature": "F-WRK-04",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "groupBy",
      "in": "query",
      "required": false,
      "description": "The grouping of the lanes (XM-1099); assignee when absent. The cursor binds it.",
      "schema": {
       "type": "string",
       "enum": [
        "assignee",
        "priority",
        "epic"
       ],
       "default": "assignee"
      }
     },
     {
      "$ref": "#/components/parameters/WorkFilterQuery"
     },
     {
      "$ref": "#/components/parameters/WorkSearchQuery"
     },
     {
      "$ref": "#/components/parameters/BoardSortQuery"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of lanes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BoardLanePage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/budget-alerts": {
   "get": {
    "operationId": "getBudgetAlerts",
    "summary": "The project's alert rules in force and the states of its baseline",
    "x-feature": "F-FIN-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The rules and states (ETag is the finance row's version); no amounts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BudgetAlertsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "setBudgetAlerts",
    "summary": "Set the project's own alert rules, or return to the tenant default",
    "x-feature": "F-FIN-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BudgetAlertsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The rules and the re-evaluated states.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BudgetAlertsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/budget-comparison": {
   "get": {
    "operationId": "getBudgetComparison",
    "summary": "Baseline, actual, provisional, estimate, remaining, forecast and variance of one project",
    "x-feature": "F-FIN-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/YearMonth"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/YearMonth"
      }
     },
     {
      "name": "grain",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "month",
        "total"
       ],
       "default": "month"
      }
     },
     {
      "name": "by",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "none",
        "member",
        "delivery_role",
        "team",
        "cost_type"
       ],
       "default": "none"
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "estimates"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The comparison in the project's currency, for a holder of view_finance on the project.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BudgetComparisonView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client": {
   "put": {
    "operationId": "changeProjectClient",
    "summary": "ChangeProjectClient — set or remove the client organisation; increments the client version",
    "x-feature": "F-PRJ-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientChangeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The project document with its new client version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-change/validate": {
   "post": {
    "operationId": "validateClientChange",
    "summary": "Dry run — the consequence of changing or removing the project's client, with the current client version",
    "x-feature": "F-PRJ-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clientOrganisationId": {
          "$ref": "#/components/schemas/Uuid"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "What becomes internal-only or ends; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientChangeConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-guests": {
   "get": {
    "operationId": "listProjectClientGuests",
    "summary": "The project's client guests and pending client invitations with tenant-wide totals",
    "x-feature": "F-TEN-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 100
      }
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "current",
        "revoked"
       ],
       "default": "current"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 25
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of guest rows (full or reduced by the caller's capability) and the totals.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/ClientGuestRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "totals"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            },
            "totals": {
             "$ref": "#/components/schemas/ClientGuestTotals"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-guests/{memberId}": {
   "delete": {
    "operationId": "removeClientGuestFromProject",
    "summary": "Remove a client guest from this project — the portal is withdrawn at once",
    "x-feature": "F-TEN-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed (or no active client membership)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-lead": {
   "put": {
    "operationId": "setProjectClientLead",
    "summary": "Choose or clear the client lead shown to clients as \"Your contact\"",
    "x-feature": "F-PRJ-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientLeadRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The project document with the new client lead.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-lead/candidates": {
   "get": {
    "operationId": "listProjectClientLeadCandidates",
    "summary": "The people whom the Client lead picker offers — only those whom setProjectClientLead accepts (R02; no Admin)",
    "x-feature": "F-PRJ-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The eligible people, in name order.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientLeadCandidateList"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing": {
   "get": {
    "operationId": "getClientSharingPolicy",
    "summary": "A project's client-sharing policy with its columns, current client and the caller's abilities",
    "x-feature": "F-ACC-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The policy; ETag carries its version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientSharingView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "saveClientSharingPolicy",
    "summary": "Save the project's policy; applies at once to every guest",
    "x-feature": "F-ACC-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientSharingPolicySaveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved policy.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientSharingView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/preview": {
   "post": {
    "operationId": "previewClientSharing",
    "summary": "Render a sample ticket as the project's client role over the unsaved client-sharing policy",
    "x-feature": "F-ACC-08",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientSharingPreviewRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The client card with ticket counts and presented columns.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PreviewResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/review": {
   "get": {
    "operationId": "getClientSharingReview",
    "summary": "Everything shared with an earlier client of the project, per kind",
    "x-feature": "F-ACC-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     },
     {
      "name": "filter[kind]",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "tickets",
        "attachments",
        "doc_pages",
        "comments",
        "conversation_periods"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of 50 items of the kind, with the organisation and version each was shared under.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientSharingReviewPage"
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/review/attachments": {
   "post": {
    "operationId": "reshareAttachmentsWithCurrentClient",
    "summary": "Re-share ticket attachments shared with an earlier client version into the current one (1–100)",
    "x-feature": "F-WRK-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReshareAttachmentsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The restamped attachments.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReshareResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/review/attachments/validate": {
   "post": {
    "operationId": "validateAttachmentReshare",
    "summary": "The consequence of an attachment re-share (writes nothing)",
    "x-feature": "F-WRK-19",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReshareAttachmentsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequence with per-item problems.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReshareConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/review/counts": {
   "get": {
    "operationId": "getClientSharingReviewCounts",
    "summary": "The number of items per kind shared with an earlier client of the project",
    "x-feature": "F-ACC-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One count for each kind that the reader may see. A kind that the reader's role hides is not in the list.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientSharingReviewCounts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/review/tickets": {
   "post": {
    "operationId": "reshareTicketsWithCurrentClient",
    "summary": "Re-share tickets shared with an earlier client version into the current one (1–100)",
    "x-feature": "F-WRK-18",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReshareTicketsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The restamped tickets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReshareResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/review/tickets/validate": {
   "post": {
    "operationId": "validateTicketReshare",
    "summary": "The consequence of a re-share before it is confirmed (writes nothing)",
    "x-feature": "F-WRK-18",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReshareTicketsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequence with per-item problems.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReshareConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-sharing/validate": {
   "post": {
    "operationId": "validateClientSharingPolicy",
    "summary": "Dry run — the consequence of a proposed policy, bound to the current client",
    "x-feature": "F-ACC-09",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientSharingPolicyInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Widened and narrowed fields with their ticket counts and the client version computed for; nothing written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ClientSharingConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-thread-history-shares": {
   "post": {
    "operationId": "shareClientThreadHistory",
    "summary": "Share earlier client-thread comments (1–500) with the project's current client",
    "x-feature": "F-WRK-21",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ThreadHistoryShareRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The shared comments.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReshareResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/client-thread-history-shares/validate": {
   "post": {
    "operationId": "validateClientThreadHistoryShare",
    "summary": "The consequence of a history share (writes nothing)",
    "x-feature": "F-WRK-21",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ThreadHistoryShareRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequence, including comments that stay hidden because their ticket is not shared.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReshareConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/configuration": {
   "post": {
    "operationId": "saveProjectConfiguration",
    "summary": "Save the project's settings and its stage list together — all or nothing (the one \"Save changes\")",
    "x-feature": "F-PRJ-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectConfigurationSave"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The project document after the save; both parts were written, or nothing was.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/conversation": {
   "get": {
    "operationId": "getProjectConversation",
    "summary": "The project's client conversation, created on first use, with its client periods",
    "x-feature": "F-MSG-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The conversation document with periods, the banner fact and permissions; the ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ConversationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/conversation/history-shares": {
   "post": {
    "operationId": "shareConversationHistory",
    "summary": "Share selected earlier messages with the current client — audited",
    "x-feature": "F-MSG-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HistoryShareRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The share was recorded.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HistoryShareResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/conversation/history-shares/validate": {
   "post": {
    "operationId": "validateConversationHistoryShare",
    "summary": "Dry run — the consequence of sharing earlier messages with the current client",
    "x-feature": "F-MSG-04",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HistoryShareRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequence sentence, the counts and the project's current client version; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HistoryShareConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/cost-entries": {
   "get": {
    "operationId": "listProjectCostEntries",
    "summary": "The project's cost ledger entries, newest first",
    "x-feature": "F-FIN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[memberId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[workDate][gte]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[workDate][lte]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[cause]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "accepted",
        "reopened",
        "revised",
        "rate_changed",
        "role_changed",
        "exchange_changed",
        "rebuild"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 100 entries under the reader's time-visibility level, for a holder of view_finance on the project.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/CostEntryView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "notices"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "notices": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/FinanceNotice"
             }
            },
            "counts": {
             "type": "object",
             "description": "The Actuals chips, on the first page only (no cursor). Labour counts the entries under the filters; Expenses the expenses under the member and date filters (F-FIN-11); All is their sum (XM-869, XM-872). Expenses is absent, and All is Labour, when the read has a member filter and the reader may not see whom an expense is for (F-FIN-11.R10; REV-BATCHFIN-DL-01).",
             "required": [
              "all",
              "labour"
             ],
             "properties": {
              "all": {
               "type": "integer",
               "minimum": 0
              },
              "labour": {
               "type": "integer",
               "minimum": 0
              },
              "expenses": {
               "type": "integer",
               "minimum": 0
              }
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/cost-rebuild": {
   "post": {
    "operationId": "rebuildProjectCosts",
    "summary": "Re-synchronise and re-price the project's accepted time from a date (a long-running operation)",
    "x-feature": "F-FIN-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CostRebuildRequest"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "The operation; its result holds the scanned and changed counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/decisions": {
   "get": {
    "operationId": "listProjectDecisions",
    "summary": "The project's decision log — Memory's decision records and Discovery's decisions, newest first",
    "x-feature": "F-MEM-02",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "open",
        "all"
       ],
       "default": "open"
      }
     },
     {
      "name": "origin",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "memory",
        "discovery",
        "both"
       ],
       "default": "both"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of up to 50 decisions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DecisionLogRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/delivery-roles": {
   "get": {
    "operationId": "listProjectDeliveryRoles",
    "summary": "The project's people with their delivery role in force, its source and the project overrides",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "One row per project member or member with an override, at most 500; `meta.truncated` is true when the project has more (KDC-07).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 500,
           "items": {
            "$ref": "#/components/schemas/ProjectPersonRoleView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "truncated"
           ],
           "properties": {
            "truncated": {
             "type": "boolean",
             "description": "True when the project has more than 500 people with a row (REV-FINC-05)."
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "assignProjectDeliveryRole",
    "summary": "Give a member a delivery role on this project from an effective date, or end it",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectRoleOverrideRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The member's row with the new override; warnings name a member who is not on the project.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectPersonRoleView"
          },
          "warnings": {
           "type": "array",
           "maxItems": 5,
           "items": {
            "$ref": "#/components/schemas/Warning"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/discovery/presence": {
   "post": {
    "operationId": "relayDiscoveryPresence",
    "summary": "Relay one content-free signal on the project's Discovery board presence channel (owner, 23 Nov 2026)",
    "description": "The opportunity that the person has open, or the one field of it that they edit, or `idle`. The opportunity must be of this project (else 404); `editing` needs the field's capability (`discovery_manage`; `discovery_contribute` for `interview`) and an active project. One signal per person per board in the platform's relay window (`429`, `limiter: presence-relay`); an `idle` that ends an activity is exempt. Nothing is stored.",
    "x-feature": "F-DSC-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "X-Socket-ID",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[0-9]{1,20}\\.[0-9]{1,20}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DiscoveryPresenceSignal"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Relayed, or nothing to end."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/discovery/realtime": {
   "get": {
    "operationId": "getDiscoveryPresenceChannel",
    "summary": "The Discovery board's presence channel, at the project's audience epoch (owner, 23 Nov 2026)",
    "description": "`presence-tenant.{t}.project.{p}.discovery.v{n}`: who is on the board, and which opportunity and field each one has open. The SPA reads it when it opens the board and again on `channels.rotated`. Refused exactly as the board's read: a client or a hidden project 404, Discovery off 403.",
    "x-feature": "F-DSC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The channel to join.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "presenceChannel"
           ],
           "properties": {
            "presenceChannel": {
             "$ref": "#/components/schemas/DiscoveryPresenceChannelName"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/doc-pages": {
   "get": {
    "operationId": "listDocTreeLevel",
    "summary": "One level of the project's page tree (the top level, or one parent's children)",
    "x-feature": "F-DOC-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "parentId",
      "in": "query",
      "required": false,
      "description": "Omit for the top level.",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The level's live nodes in tree order with counts and the subtitle facts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTreeLevel"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createDocPage",
    "summary": "Create a page or section at the end of the top level or of a parent",
    "x-feature": "F-DOC-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocPageCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The created page, untagged and without a version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocPageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/doc-pages/trash": {
   "get": {
    "operationId": "listDocTrash",
    "summary": "The project's trashed nodes, newest first, with their restore deadline",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of trashed nodes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/DocTrashItem"
           }
          },
          "meta": {
           "type": "object",
           "description": "XM-988 — the cursor page's meta; nextCursor goes in page[cursor] for the next 50 (present exactly when hasMore).",
           "required": [
            "size",
            "hasMore"
           ],
           "properties": {
            "size": {
             "type": "integer",
             "minimum": 1,
             "maximum": 100
            },
            "hasMore": {
             "type": "boolean"
            },
            "nextCursor": {
             "type": "string",
             "maxLength": 512
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "emptyDocTrash",
    "summary": "XM-989 — Empty trash, deleting every trashed node of the project forever (project Admins; at most 500 per call)",
    "description": "Owner Q18 (22 Nov 2026). Needs administer on an active project. Per page exactly what docs:purge-trash does — the evidence guard, then the deletes or the evidence tombstone, children first. Each page is audited doc.deleted_forever. hasMore true asks for another call.",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The pages deleted forever and whether the trash holds more.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTrashPurgeResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/doc-pages/trash/{pageId}": {
   "delete": {
    "operationId": "purgeDocTrashPage",
    "summary": "XM-989 — Delete forever one trashed node with its trashed subpages of its delete batch (project Admins)",
    "description": "Owner Q18 (22 Nov 2026). Needs administer on an active project; a page that is not in this project's trash answers 404 doc_page.not_found. The evidence guard of docs:purge-trash applies; each page is audited doc.deleted_forever.",
    "x-feature": "F-DOC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/DocPageIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The pages deleted forever (the node and its trashed subpages).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocTrashPurgeResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/doc-space": {
   "get": {
    "operationId": "getProjectDocSpace",
    "summary": "The project space of one project",
    "x-feature": "F-DOC-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The project space.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocSpaceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/epics": {
   "get": {
    "operationId": "listEpics",
    "summary": "Epic panels of one state with progress and the first 50 rows each, 20 panels per page; the shared filters and q narrow the rows (XM-708)",
    "x-feature": "F-WRK-11",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "completed"
       ],
       "default": "active"
      }
     },
     {
      "$ref": "#/components/parameters/WorkFilterQuery"
     },
     {
      "$ref": "#/components/parameters/WorkSearchQuery"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Panels; meta.counts holds active and completed.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/EpicPanel"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "counts",
            "totals"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "counts": {
             "type": "object",
             "required": [
              "active",
              "completed"
             ],
             "properties": {
              "active": {
               "type": "integer",
               "minimum": 0
              },
              "completed": {
               "type": "integer",
               "minimum": 0
              }
             }
            },
            "totals": {
             "type": "object",
             "required": [
              "tickets"
             ],
             "properties": {
              "tickets": {
               "type": "integer",
               "minimum": 0,
               "description": "R23: the live children of the state's epics that the reader can view and that match the filters and q (the bar's \"12 tickets\"); a row count under Visible::for(ticket)."
              }
             }
            },
            "viewPreference": {
             "$ref": "#/components/schemas/ViewPreference"
            },
            "estimateUnit": {
             "description": "R24 (XM-1369; G-EP-03): the project's estimate unit (F-WRK-42.R01): the rows show estimateMinutes for time and estimatePoints for points.",
             "allOf": [
              {
               "$ref": "#/components/schemas/EstimateUnit"
              }
             ]
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/expenses": {
   "get": {
    "operationId": "listProjectExpenses",
    "summary": "The project's expenses, newest first",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "recorded",
        "approved",
        "rejected",
        "withdrawn",
        "reversed"
       ]
      }
     },
     {
      "name": "filter[categoryId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[incurredOn][gte]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[incurredOn][lte]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[memberId]",
      "in": "query",
      "required": false,
      "description": "The member the expenses are for (XM-874, from XM-869). Only for a reader of the member link (R10) — a holder of `manage_finance` on the project or of `view_rates`; any other reader gets `403 access.forbidden`, so the filter never tells who an expense is for.",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 50 expenses.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/ExpenseView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "recordExpense",
    "summary": "Record an expense of the project (net of VAT), or a correction of a reversed one",
    "x-feature": "F-FIN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExpenseRecordRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The expense (recorded, or approved when no approval is needed).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ExpenseView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/field-schema": {
   "get": {
    "operationId": "getProjectFieldSchema",
    "summary": "The caller's view of the project's custom field set (types, options, placement, can)",
    "x-feature": "F-WRK-26",
    "x-audience": "public",
    "x-assistant": {
     "tool": "get_project_fields",
     "kind": "read",
     "requires": {
      "scope": "project",
      "capability": null
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "never",
     "pages": [],
     "description": "Read the custom fields of a project that you see: key, name, type, help text, options, limits, required, editable. Read it before you explain or set a field."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The schema; ETag carries the field-set version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/FieldSchemaView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/fields": {
   "get": {
    "operationId": "getProjectFieldSet",
    "summary": "The project's field set for its editors",
    "x-feature": "F-PRJ-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The ordered entries with library details and the version; ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectFieldSetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "saveProjectFieldSet",
    "summary": "Replace the project's field set as one versioned list",
    "x-feature": "F-PRJ-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectFieldSetRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved set with its new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectFieldSetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/fields/library": {
   "get": {
    "operationId": "listProjectFieldLibrary",
    "summary": "The active library fields that an editor of this project's field set can add",
    "description": "XM-1427 (R12). The caller must be able to edit this project's field set (R01). The list holds the active library fields only, by name, with the configuration of each type; a select field shows its active options only. It does not show project counts, value counts, archived fields or who made a field. `GET /custom-fields` stays the Admin's library read.",
    "x-feature": "F-PRJ-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of the active library fields by name.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/FieldSetLibraryField"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/finance": {
   "get": {
    "operationId": "getProjectFinance",
    "summary": "The project's finance profile — currency, billable flag, baseline and draft summaries, what the caller may do",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The profile (ETag is the finance row's version).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectFinanceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateProjectFinance",
    "summary": "Change the project's currency (before the first amount) or its billable flag",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectFinancePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The profile.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectFinanceView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/finance/budget": {
   "get": {
    "operationId": "getProjectBudget",
    "summary": "The one budget amount of the project, spent so far, left and used (R20, R21)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "get_project_budget",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": "nav:finance-cashflow"
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "never",
     "pages": [],
     "description": "One project's budget in EUR: the amount (null: no budget), spent so far, left, used percent, status and the people cost from time. A project whose finance you cannot see is not found."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The budget and the derived figures (the ETag is the finance row's version).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectBudgetView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "setProjectBudget",
    "summary": "Set the one budget amount of the project, or remove it with null (R20)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectBudgetRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The budget, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectBudgetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/finance/member-rates": {
   "get": {
    "operationId": "listProjectMemberRates",
    "summary": "The people of the project with the cost and bill rate that price their work here on a date (R15; audited)",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "asOf",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One row per person of the project (R09), by name, at most 500; `meta.truncated` is true when the project has more (KDC-07).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 500,
           "items": {
            "$ref": "#/components/schemas/ProjectMemberRateRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "truncated",
            "asOf"
           ],
           "properties": {
            "truncated": {
             "type": "boolean"
            },
            "asOf": {
             "$ref": "#/components/schemas/DateOnly"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/finance/people-candidates": {
   "get": {
    "operationId": "listProjectPeopleCandidates",
    "summary": "The active internal members who are not people of the project, by name, for \"Add to this project\" (R17)",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 50 members by name, then id; `links.next` reads the next page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/MemberRef"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/finance/people/{memberId}/changes": {
   "post": {
    "operationId": "changeProjectPerson",
    "summary": "Change a person's delivery role and project rates on this project from a date, or correct the past (R18, R19; audited)",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/FinanceMemberIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectPersonChangeRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The person's history after the change (R16); the ETag is the new version. Warnings name a member who is not on the project.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectPersonRateHistoryView"
          },
          "warnings": {
           "type": "array",
           "maxItems": 5,
           "items": {
            "$ref": "#/components/schemas/Warning"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/finance/people/{memberId}/changes/preview": {
   "post": {
    "operationId": "previewProjectPersonChange",
    "summary": "A dry run of a change — the roles and rates before and after, the accepted time repriced by month, the postings, timesheets, baselines and reports (R20); writes nothing",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/FinanceMemberIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectPersonChangeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "What the change would do; no row, event or change audit record is written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectPersonChangePreview"
          },
          "warnings": {
           "type": "array",
           "maxItems": 5,
           "items": {
            "$ref": "#/components/schemas/Warning"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/finance/people/{memberId}/rate-history": {
   "get": {
    "operationId": "getProjectPersonRateHistory",
    "summary": "One person of the project — the role and rates today, the rate versions and role entries that price the person here, the version (R16; audited)",
    "x-feature": "F-FIN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/FinanceMemberIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The person's history; the ETag is the person's version (R21), the If-Match of a change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectPersonRateHistoryView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/help-desk/form": {
   "get": {
    "operationId": "getHelpDeskForm",
    "summary": "The project's request form (internal view)",
    "x-feature": "F-HLP-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The current version, with an ETag of the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskFormInternalView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "saveHelpDeskForm",
    "summary": "Save the whole form as a new version",
    "x-feature": "F-HLP-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskFormDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskFormInternalView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/help-desk/form/enabled": {
   "put": {
    "operationId": "setHelpDeskFormEnabled",
    "summary": "Turn the request form on or off",
    "x-feature": "F-HLP-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "enabled"
        ],
        "properties": {
         "enabled": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The form with its new state.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskFormInternalView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/help-desk/held-mail": {
   "get": {
    "operationId": "listHeldHelpDeskMail",
    "summary": "The mails that wait for a triager",
    "x-feature": "F-HLP-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of held mail.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/HelpDeskHeldMailView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/help-desk/held-mail/{mailId}/decision": {
   "post": {
    "operationId": "decideHeldHelpDeskMail",
    "summary": "Release a held mail into a request, or reject it",
    "x-feature": "F-HLP-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "mailId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskHeldMailDecision"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Decided.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskHeldMailView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/help-desk/mailboxes": {
   "get": {
    "operationId": "listHelpDeskMailboxes",
    "summary": "The project's help-desk mailboxes",
    "x-feature": "F-HLP-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The mailboxes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 5,
           "items": {
            "$ref": "#/components/schemas/HelpDeskMailboxView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/HelpDeskMailboxListMeta"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createHelpDeskMailbox",
    "summary": "Create a mailbox for the project",
    "x-feature": "F-HLP-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskMailboxInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskMailboxView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/help-desk/mailboxes/{mailboxId}/status": {
   "put": {
    "operationId": "setHelpDeskMailboxStatus",
    "summary": "Turn a mailbox on or off (active or paused)",
    "x-feature": "F-HLP-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "mailboxId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskMailboxChange"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The mailbox with its new status.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskMailboxView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/help-desk/triagers": {
   "get": {
    "operationId": "listHelpDeskTriagers",
    "summary": "The project's triagers (the choices of a default triage owner)",
    "description": "XM-1285 (owner, 22 Nov 2026: H5): the active internal members for whom triage_requests answers yes on the project, in name order — the choices of a category's defaultTriageOwnerId and of helpdesk.defaultTriageOwner. An internal reader who may view the project.",
    "x-feature": "F-HLP-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The triagers.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "id",
             "name"
            ],
            "properties": {
             "id": {
              "$ref": "#/components/schemas/Uuid"
             },
             "name": {
              "type": "string",
              "minLength": 1
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/knowledge-backlinks": {
   "get": {
    "operationId": "listKnowledgeBacklinks",
    "summary": "The visible knowledge items that link to one ticket, doc page, opportunity or request of the project",
    "x-feature": "F-MEM-03",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "targetKind",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "ticket",
        "knowledge_item",
        "doc_page",
        "opportunity",
        "help_desk_request"
       ]
      }
     },
     {
      "name": "targetRef",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     },
     {
      "name": "includeProposed",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50 backlinks, newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/KnowledgeBacklinkRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/knowledge-items": {
   "post": {
    "operationId": "createKnowledgeItem",
    "summary": "Add a knowledge item to the project",
    "x-feature": "F-MEM-01",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/KnowledgeItemInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new item as the caller sees it, with its key and ETag.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/KnowledgeItemView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "get": {
    "operationId": "listProjectKnowledgeItems",
    "summary": "List or search the project's knowledge items that the reader can see",
    "x-feature": "F-MEM-04",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     },
     {
      "name": "mode",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "keyword",
        "semantic"
       ],
       "default": "keyword"
      }
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 10,
       "items": {
        "$ref": "#/components/schemas/KnowledgeItemTypeKey"
       }
      }
     },
     {
      "name": "tag",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 10,
       "items": {
        "type": "string",
        "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
       }
      }
     },
     {
      "name": "source",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 5,
       "items": {
        "$ref": "#/components/schemas/KnowledgeSourceKind"
       }
      }
     },
     {
      "name": "authorMemberId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "agentIdentityId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "description": "Curators only for proposed, retracted and rejected.",
      "schema": {
       "$ref": "#/components/schemas/KnowledgeItemState"
      }
     },
     {
      "name": "visibility",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/KnowledgeVisibility"
      }
     },
     {
      "name": "decisionStatus",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DecisionStatus"
      }
     },
     {
      "name": "linkedTicketKey",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/TicketKey"
      }
     },
     {
      "name": "updatedFrom",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Instant"
      }
     },
     {
      "name": "updatedTo",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Instant"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of up to 50 rows (20 in semantic mode, without a cursor).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/KnowledgeItemRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/KnowledgeSearchMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/knowledge-review": {
   "get": {
    "operationId": "listKnowledgeReviewQueue",
    "summary": "The project's proposed items and pending revisions, oldest first (curators)",
    "x-feature": "F-MEM-08",
    "x-audience": "internal",
    "deprecated": true,
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "agentIdentityId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50 queue rows.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/ReviewQueueRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/labels": {
   "get": {
    "operationId": "listProjectLabels",
    "summary": "The project's label vocabulary — the picker's typeahead and the Labels settings list",
    "x-feature": "F-WRK-22",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "Name search (prefix and contains, case-insensitive), 1–40 characters.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 40
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "description": "active (default, the picker) · archived · all (the settings list).",
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "all"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Labels by name, at most 100 a page (20 when q is given); links.next continues the list while more labels follow (R23).",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProjectLabelPage"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createProjectLabel",
    "summary": "Create a label in the project's vocabulary",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LabelCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The label; ETag carries its version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/labels/{labelId}": {
   "patch": {
    "operationId": "editProjectLabel",
    "summary": "Rename or recolour a label (If-Match)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/LabelIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/LabelEditRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The label after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/labels/{labelId}/archive": {
   "post": {
    "operationId": "archiveProjectLabel",
    "summary": "Archive a label (idempotent by state)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/LabelIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived label.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/labels/{labelId}/merge": {
   "post": {
    "operationId": "mergeProjectLabel",
    "summary": "Merge this label into a target label of the same project",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/LabelIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LabelMergeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The target label and the number of re-tagged tickets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/LabelMergeResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/labels/{labelId}/merge-preview": {
   "post": {
    "operationId": "previewProjectLabelMerge",
    "summary": "The consequence of merging this label into a target (writes nothing)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/LabelIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "targetLabelId"
        ],
        "additionalProperties": false,
        "properties": {
         "targetLabelId": {
          "$ref": "#/components/schemas/Uuid"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The counts and whether the target is access-sensitive.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/LabelMergePreview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/labels/{labelId}/restore": {
   "post": {
    "operationId": "restoreProjectLabel",
    "summary": "Restore an archived label (idempotent by state)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/LabelIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The active label.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/members": {
   "get": {
    "operationId": "listProjectMembers",
    "summary": "The project's members with capacity and hours this week",
    "x-feature": "F-TEN-12",
    "x-audience": "spa",
    "x-assistant": {
     "tool": "list_project_members",
     "kind": "read",
     "requires": {
      "scope": "project",
      "capability": null
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "never",
     "pages": [
      "project-people"
     ],
     "description": "List the people of a project that you can open."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 100
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "name",
        "-name",
        "role",
        "-role",
        "capacity",
        "-capacity"
       ],
       "default": "name"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 25
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of members and the project-wide summary.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/ProjectPeopleRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "summary"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            },
            "summary": {
             "$ref": "#/components/schemas/ProjectPeopleSummary"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addProjectMember",
    "summary": "Add an existing internal member to the project (Admins, CFL-105)",
    "x-feature": "F-TEN-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectMemberAdd"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new member row.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectPeopleRow"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/members/{memberId}": {
   "delete": {
    "operationId": "removeProjectMember",
    "summary": "Remove an internal member from the project (Admins, CFL-105)",
    "x-feature": "F-TEN-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed (or no active membership)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/memory/directories": {
   "get": {
    "operationId": "listMemoryDirectories",
    "summary": "All directories of the project's memory",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "Every directory, ordered by path.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 10000,
           "items": {
            "$ref": "#/components/schemas/MemoryDirectory"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createMemoryDirectory",
    "summary": "Create a directory (and its missing parents)",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryDirectoryInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new directory.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryDirectory"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/memory/entries": {
   "get": {
    "operationId": "listMemoryEntries",
    "summary": "List or search the project's memory entries",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "Words of the path, the title or the body. With q, the best match comes first.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     },
     {
      "name": "source",
      "in": "query",
      "required": false,
      "style": "form",
      "explode": false,
      "schema": {
       "type": "array",
       "maxItems": 3,
       "items": {
        "$ref": "#/components/schemas/MemorySourceKind"
       }
      }
     },
     {
      "name": "directory",
      "in": "query",
      "required": false,
      "description": "A directory id for its direct entries, or `root` for the entries outside every directory. Absent — all entries.",
      "schema": {
       "type": "string",
       "maxLength": 36
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "path",
        "updated"
       ],
       "default": "updated"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of up to 50 rows without the body.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/MemoryEntryRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createMemoryEntry",
    "summary": "Create an entry at a new path",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryEntryInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new entry with its body.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryEntryView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/memory/entries/by-path": {
   "get": {
    "operationId": "getMemoryEntryByPath",
    "summary": "One entry by its path",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/MemoryEntryPathQuery"
     }
    ],
    "responses": {
     "200": {
      "description": "The entry with its body.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryEntryView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "upsertMemoryEntryByPath",
    "summary": "Create the entry at the path, or replace its body (for automations and agents)",
    "x-feature": "F-MEM-14",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/MemoryEntryPathQuery"
     },
     {
      "name": "If-Match",
      "in": "header",
      "required": false,
      "description": "Optional here (F-MEM-14.R08). When present, the stored version must match (`412`).",
      "schema": {
       "type": "string",
       "maxLength": 64
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MemoryEntryUpsert"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The entry was replaced (`meta.outcome` updated) or already held the body (unchanged).",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MemoryEntryUpsertResult"
        }
       }
      }
     },
     "201": {
      "description": "The entry was created (`meta.outcome` created).",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MemoryEntryUpsertResult"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/memory/entries/upload": {
   "post": {
    "operationId": "uploadMemoryEntry",
    "summary": "Create an entry from an uploaded .md file",
    "x-feature": "F-MEM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary",
          "description": "A `.md` or `.markdown` file; `text/markdown`, `text/plain` or `application/octet-stream`; UTF-8."
         },
         "directory": {
          "type": "string",
          "maxLength": 36,
          "description": "The directory id; absent — the root."
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new entry; its name is the file's name (`.markdown` becomes `.md`).",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemoryEntryView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/modules/validate": {
   "post": {
    "operationId": "validateProjectModules",
    "summary": "Dry run — the consequences of a module change, without saving",
    "x-feature": "F-PRJ-05",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "modules"
        ],
        "properties": {
         "modules": {
          "type": "object",
          "additionalProperties": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Per changed module, its effects with counts and any errors; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ModuleConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/opportunities": {
   "get": {
    "operationId": "getOpportunityBoard",
    "summary": "The project's discovery board — summary, three columns with counts and their first cards",
    "x-feature": "F-DSC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "decided",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "recent",
        "all"
       ],
       "default": "recent"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The board.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityBoard"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createOpportunity",
    "summary": "Add an opportunity at the end of the Opportunities column",
    "x-feature": "F-DSC-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OpportunityCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created; Location /api/v1/opportunities/{id}.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityCard"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/opportunity-columns/{stage}": {
   "get": {
    "operationId": "listOpportunityColumn",
    "summary": "The next cards of one board column (\"Load more\")",
    "x-feature": "F-DSC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "stage",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/OpportunityStage"
      }
     },
     {
      "name": "decided",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "recent",
        "all"
       ],
       "default": "recent"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of up to 100 cards.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/OpportunityColumnPage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/overview": {
   "get": {
    "operationId": "getProjectOverview",
    "summary": "The Overview read model — header facts, tiles, sprint panel and Team panel",
    "x-feature": "F-PRJ-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The figures the caller may see, each absent when its module, client or sprint is missing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectOverview"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/plan-versions": {
   "get": {
    "operationId": "listPlanVersions",
    "summary": "The project's plan versions, newest first",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 25 versions with their totals.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/PlanVersionSummary"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createPlanVersion",
    "summary": "Start a draft — empty, from the baseline or from a named version",
    "x-feature": "F-FIN-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlanVersionCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The draft.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PlanVersionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/presence": {
   "post": {
    "operationId": "relayBoardPresence",
    "summary": "Relay one content-free card signal on the project's cards channel (F-WRK-37)",
    "description": "A card that the person has open or drags, for the project's full readers (R07). One signal per person per project in 2 s; an `idle` that ends an activity is exempt.",
    "x-feature": "F-WRK-37",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "X-Socket-ID",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[0-9]{1,20}\\.[0-9]{1,20}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BoardPresenceSignal"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Relayed, or nothing to end."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/realtime": {
   "get": {
    "operationId": "getProjectRealtimeChannel",
    "summary": "The project channel's current name, with its audience epoch (SEC-WRK2-07)",
    "description": "`private-tenant.{t}.project.{p}.v{n}`: every narrowing moves `n`, publishers publish on the current name only and `/broadcasting/auth` signs only it, so a socket kept open after a narrowing starves (07 §5.4). The SPA reads it when it opens the project and again on `channels.rotated` (and `access.changed`). Internal members with the project in scope; anyone else 404.",
    "x-feature": "F-WRK-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The channel to subscribe.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "channel",
            "presenceChannel",
            "cardsChannel",
            "presence"
           ],
           "properties": {
            "channel": {
             "type": "string",
             "maxLength": 120,
             "pattern": "^private-tenant\\.[0-9a-f-]{36}\\.project\\.[0-9a-f-]{36}\\.v[1-9][0-9]{0,17}$"
            },
            "presenceChannel": {
             "$ref": "#/components/schemas/PresenceChannelName"
            },
            "cardsChannel": {
             "description": "F-WRK-37.R07: the project's cards channel, only for a reader who reads every live ticket of the project; otherwise null.",
             "type": [
              "string",
              "null"
             ],
             "maxLength": 130,
             "pattern": "^private-tenant\\.[0-9a-f-]{36}\\.project\\.[0-9a-f-]{36}\\.cards\\.v[1-9][0-9]{0,17}$"
            },
            "presence": {
             "$ref": "#/components/schemas/PresenceTimings"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/related-doc-spaces": {
   "get": {
    "operationId": "getProjectRelatedDocSpaces",
    "summary": "The tenant and team spaces that the project's AI chat also reads",
    "x-feature": "F-DOC-23",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The related spaces the reader can read.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocRelatedSpacesView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "setProjectRelatedDocSpaces",
    "summary": "Replace the project's related spaces (at most 10)",
    "x-feature": "F-DOC-23",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocRelatedSpacesRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The related spaces.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DocRelatedSpacesView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/requests": {
   "get": {
    "operationId": "listTriageRequests",
    "summary": "The project's triage queue",
    "x-feature": "F-HLP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     {
      "name": "view",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "open",
        "unowned",
        "mine",
        "awaiting_information",
        "closed",
        "all"
       ],
       "default": "open"
      }
     },
     {
      "name": "impact",
      "in": "query",
      "required": false,
      "schema": {
       "type": "array",
       "maxItems": 4,
       "items": {
        "$ref": "#/components/schemas/HelpDeskImpact"
       }
      }
     },
     {
      "name": "channel",
      "in": "query",
      "required": false,
      "schema": {
       "type": "array",
       "maxItems": 4,
       "items": {
        "$ref": "#/components/schemas/HelpDeskChannel"
       }
      }
     },
     {
      "name": "category",
      "in": "query",
      "required": false,
      "schema": {
       "type": "array",
       "maxItems": 10,
       "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]{1,29}$"
       }
      }
     },
     {
      "name": "serviceLevel",
      "in": "query",
      "required": false,
      "description": "XM-1280 (owner §223 add. 46): a set; on_track, paused and none for the design's filter row. G-HDQ-02 (owner §230 add. 102): met — no clock runs and at least one clock stopped, in any state that the view holds; the other values match open requests only.",
      "schema": {
       "type": "array",
       "maxItems": 6,
       "items": {
        "type": "string",
        "enum": [
         "at_risk",
         "breached",
         "on_track",
         "paused",
         "none",
         "met"
        ]
       }
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "description": "G-HDQ-01 (owner §230 add. 102, the queue's Status filter): a set of request states, ANDed with the view (use view=all to filter by state only).",
      "schema": {
       "type": "array",
       "maxItems": 8,
       "items": {
        "$ref": "#/components/schemas/HelpDeskRequestState"
       }
      }
     },
     {
      "name": "owner",
      "in": "query",
      "required": false,
      "description": "XM-1280 (owner §223 add. 46): a set of member ids; `none` is \"No owner\".",
      "schema": {
       "type": "array",
       "maxItems": 21,
       "items": {
        "type": "string",
        "pattern": "^(none|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
       }
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "due",
        "newest",
        "oldest",
        "impact"
       ],
       "default": "due"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 25.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/HelpDeskTriageRow"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/HelpDeskTriageListMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "logInternalRequest",
    "summary": "Log a request for the project's client",
    "x-feature": "F-HLP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskInternalRequestDraft"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new request (internal view).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTriageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/requests/counts": {
   "get": {
    "operationId": "getTriageCounts",
    "summary": "Counts per queue view, capped at 1,000",
    "x-feature": "F-HLP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTriageCounts"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/requests/service-levels": {
   "get": {
    "operationId": "getTriageServiceLevels",
    "summary": "The Service levels tab's summary (XM-1006)",
    "x-feature": "F-HLP-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The open requests by clock state and the 30-day met share.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTriageServiceLevels"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/restore": {
   "post": {
    "operationId": "restoreProject",
    "summary": "Restore an archived project within the project limit",
    "x-feature": "F-PRJ-08",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The project document, active.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDocument"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/restore/validate": {
   "post": {
    "operationId": "validateProjectRestore",
    "summary": "Dry run — the limit and the client access a restore brings back",
    "x-feature": "F-PRJ-08",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The limit usage and the counts of guests and client-visible tickets that regain access; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "limitUsed",
            "guests",
            "clientVisibleTickets"
           ],
           "properties": {
            "limitUsed": {
             "type": "integer",
             "minimum": 0
            },
            "limitMax": {
             "type": "integer",
             "minimum": 0
            },
            "guests": {
             "type": "integer",
             "minimum": 0
            },
            "clientVisibleTickets": {
             "type": "integer",
             "minimum": 0
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/settings": {
   "get": {
    "operationId": "listProjectSettingGroups",
    "summary": "Every settings group of one project the caller may read",
    "x-feature": "F-PRJ-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The project's readable groups.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/settings/helpdesk": {
   "get": {
    "operationId": "getProjectHelpDeskSettings",
    "summary": "The project's help-desk settings group, service levels included",
    "x-feature": "F-HLP-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The group; ETag carries the group's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeProjectHelpDeskSettings",
    "summary": "Change the project's help-desk settings (JSON Merge Patch; null resets to the default)",
    "x-feature": "F-HLP-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The group after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/settings/{group}": {
   "parameters": [
    {
     "$ref": "#/components/parameters/ProjectKeyPath"
    },
    {
     "$ref": "#/components/parameters/SettingGroupPath"
    }
   ],
   "get": {
    "operationId": "getProjectSettingGroup",
    "summary": "One project settings group; ETag carries its version",
    "x-feature": "F-PRJ-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The group; ETag carries the group's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeProjectSettingGroup",
    "summary": "Change one project settings group — a JSON Merge Patch with If-Match (null resets a key to its default)",
    "x-feature": "F-PRJ-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The group after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/settings/{group}/validate": {
   "parameters": [
    {
     "$ref": "#/components/parameters/ProjectKeyPath"
    },
    {
     "$ref": "#/components/parameters/SettingGroupPath"
    }
   ],
   "post": {
    "operationId": "validateProjectSettingGroup",
    "summary": "Dry run of a project settings group change; nothing is written",
    "x-feature": "F-PRJ-05",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequences; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingsValidation"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/spendings": {
   "parameters": [
    {
     "$ref": "#/components/parameters/ProjectKeyPath"
    }
   ],
   "get": {
    "operationId": "listProjectSpendings",
    "summary": "The lines of one project, By person and the EUR totals (the project's Finance page; R08, R19)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The project's lines as they are now.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingsView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addProjectSpending",
    "summary": "Add a spending with the project of the page (R07, R19)",
    "x-feature": "F-FIN-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpendingAddRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new line, read back.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SpendingLineView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/sprints": {
   "post": {
    "operationId": "planSprint",
    "summary": "Plan a sprint (one active and at most work.sprints.plannedLimit planned per project); start it at once with start=true",
    "x-feature": "F-WRK-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SprintCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The sprint.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SprintView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "get": {
    "operationId": "listSprints",
    "summary": "The project's sprints with their goal progress (filter by state and date range), newest first",
    "x-feature": "F-WRK-09",
    "x-audience": "public",
    "x-assistant": {
     "tool": "list_sprints",
     "kind": "read",
     "requires": {
      "scope": "project",
      "capability": null
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "never",
     "pages": [
      "backlog"
     ],
     "description": "List the sprints of a project that you can open."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "planned",
        "active",
        "completed"
       ]
      }
     },
     {
      "name": "filter[endsOn][gte]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[startsOn][lte]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Sprints, 20 per page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/SprintView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/stages": {
   "put": {
    "operationId": "saveStageList",
    "summary": "Save the whole stage list — add, rename, reorder, kind, colour, presentation, WIP; removals name their merge target",
    "x-feature": "F-PRJ-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StageListRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved list with its new version; a removal with tickets is listed as removing until it completes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "stagesVersion",
            "stages"
           ],
           "properties": {
            "stagesVersion": {
             "type": "integer",
             "minimum": 1
            },
            "stages": {
             "type": "array",
             "maxItems": 20,
             "items": {
              "$ref": "#/components/schemas/BoardStageView"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/stages/ticket-counts": {
   "get": {
    "operationId": "getStageTicketCounts",
    "summary": "The live tickets the caller may see in each stage — \"Tickets n\" of the stage editor",
    "x-feature": "F-PRJ-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "Each stage in board order; ticketCount is absent while the caller's plan hides the status.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/StageTicketCountList"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/stages/validate": {
   "post": {
    "operationId": "validateStageList",
    "summary": "Dry run — tickets moved, client statuses changed, kinds changed and errors of a stage-list draft",
    "x-feature": "F-PRJ-06",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StageListRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequence; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/StageListConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/team-periods/{date}": {
   "get": {
    "operationId": "getTeamPeriod",
    "summary": "The project's team for the timesheet period containing the date — approvers only",
    "x-feature": "F-TIM-06",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "date",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One row per project member with total, capacity and the sheet.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamPeriod"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-history": {
   "get": {
    "operationId": "listProjectTicketHistory",
    "summary": "The project's recorded changes that the caller may see, newest first, 100 per page",
    "x-feature": "F-WRK-36",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Instant"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Instant"
      }
     },
     {
      "name": "field",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 400
      }
     },
     {
      "name": "actorKind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 80
      }
     },
     {
      "name": "actorId",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of entries with their tickets.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TicketHistoryPage"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-history/export": {
   "post": {
    "operationId": "exportProjectTicketHistory",
    "summary": "Export a period of the project's history as CSV — streamed up to 10,000 rows, otherwise an operation",
    "x-feature": "F-WRK-36",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketHistoryExportRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The CSV file (Content-Disposition attachment), UTF-8 with a byte-order mark.",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "202": {
      "description": "A large export runs as an operation; Location points to it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-type-order": {
   "put": {
    "operationId": "reorderTicketTypes",
    "summary": "Set the order of every type of the project",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketTypeOrderRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The catalogue in the new order.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TicketTypeCatalogue"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-types": {
   "get": {
    "operationId": "listTicketTypes",
    "summary": "The project's ticket types in position order, with the caller's abilities",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "all"
       ],
       "default": "active"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The catalogue.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TicketTypeCatalogue"
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createTicketType",
    "summary": "Create a ticket type in the project",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketTypeCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new type.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketTypeView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-types/{typeKey}": {
   "patch": {
    "operationId": "editTicketType",
    "summary": "Edit a type's name, icon, colour, allowed parents, field profile or hints",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/TicketTypeKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/TicketTypePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The type.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketTypeView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteTicketType",
    "summary": "Delete a type that no ticket has",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/TicketTypeKeyPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted (also when it was already gone)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-types/{typeKey}/archive": {
   "post": {
    "operationId": "archiveTicketType",
    "summary": "Archive a type; its tickets keep it",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/TicketTypeKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The type.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketTypeView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-types/{typeKey}/default": {
   "post": {
    "operationId": "setDefaultTicketType",
    "summary": "Make an active standard type the project's default",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/TicketTypeKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The catalogue after the change.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TicketTypeCatalogue"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/ticket-types/{typeKey}/restore": {
   "post": {
    "operationId": "restoreTicketType",
    "summary": "Restore an archived type",
    "x-feature": "F-WRK-30",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/TicketTypeKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The type.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketTypeView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/tickets": {
   "get": {
    "operationId": "listProjectTickets",
    "summary": "The generic ticket list of a project — filters, q, whitelisted sort, cursor (the Calendar uses the due-date range)",
    "x-feature": "F-WRK-14",
    "x-audience": "public",
    "x-assistant": {
     "tool": "list_project_tickets",
     "kind": "read",
     "requires": {
      "scope": "project",
      "capability": null
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "never",
     "pages": [
      "work-list",
      "backlog"
     ],
     "description": "List or filter the tickets of a project that you can see."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/TicketListFilterQuery"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "description": "1–4 terms from rank, priority (the tenant's priority order, the highest first), dueDate, key, updatedAt, cf.<key>; a - prefix sorts descending.",
      "schema": {
       "type": "string",
       "maxLength": 120,
       "example": "dueDate,key"
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "description": "customFields adds the custom-field values the caller may see (F-WRK-27).",
      "schema": {
       "type": "string",
       "enum": [
        "customFields"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/RowColumnsQuery"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of tickets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TicketListItem"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "viewPreference": {
             "$ref": "#/components/schemas/ViewPreference"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createTicket",
    "summary": "Create a ticket with the project's next key, placed by the entry point (D-077)",
    "x-feature": "F-WRK-23",
    "x-audience": "public",
    "x-assistant": {
     "tool": "create_ticket",
     "kind": "write",
     "requires": {
      "scope": "project",
      "capability": "ticket.create"
     },
     "scope": [
      "projectKey"
     ],
     "confirm": "always",
     "pages": [
      "create-ticket",
      "work-board"
     ],
     "description": "Create a ticket in a project where you can create tickets. The person confirms the exact fields first. If the result names a required field, ask the person for its value; never guess one."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created; Location /api/v1/tickets/{key}; meta.warnings may hold ticket.stage_hidden_from_clients.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketDetail"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/tickets/counts": {
   "get": {
    "operationId": "countProjectTickets",
    "summary": "The List's total (\"N of M tickets\") and, with groupBy, each group header's count — the List's filters and q; bounded at 10,000 (XM-1109)",
    "x-feature": "F-WRK-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/TicketListFilterQuery"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "groupBy",
      "in": "query",
      "required": false,
      "description": "The List's grouping: status, assignee (needs Assignee in the reader's mask, else 400 query.invalid), epic (needs Hierarchy, else 400 hierarchy_not_visible) or priority. Absent: the total only.",
      "schema": {
       "type": "string",
       "enum": [
        "status",
        "assignee",
        "epic",
        "priority"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The List's counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketListCounts"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/timeline": {
   "get": {
    "operationId": "getTimeline",
    "summary": "The Timeline of one sprint or epic over a week range (D-050), rows by epic and rank with computed bars",
    "x-feature": "F-WRK-13",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "scope",
      "in": "query",
      "required": false,
      "description": "sprint:<id>, epic:<id> or (Spec BF-1, F-WRK-31.R13) parent:<ticketKey>; absent means the active sprint.",
      "schema": {
       "type": "string",
       "pattern": "^((sprint|epic):[0-9a-f-]{36}|parent:[A-Za-z][A-Za-z0-9]{1,9}-[1-9][0-9]{0,8})$"
      }
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "$ref": "#/components/parameters/WorkFilterQuery"
     },
     {
      "$ref": "#/components/parameters/WorkSearchQuery"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The Timeline page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimelineView"
          },
          "meta": {
           "type": "object",
           "required": [
            "totals"
           ],
           "properties": {
            "totals": {
             "type": "object",
             "required": [
              "tickets"
             ],
             "properties": {
              "tickets": {
               "type": "integer",
               "minimum": 0,
               "description": "R12 (XM-791): the ticket rows of the scope on all pages that the reader can view and that match the filters and q (the bar's \"12 tickets\"); a row count under Visible::for(ticket). The range and the dates do not change it."
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/views/{view}/default": {
   "put": {
    "operationId": "saveProjectViewDefault",
    "summary": "Save the project default of a project view (plan on the project; audited)",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/ProjectViewKindPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ViewDefaultDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "resetProjectViewDefault",
    "summary": "Reset the project default of a project view to the system default (plan on the project; audited)",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/ProjectViewKindPath"
     }
    ],
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/views/{view}/preference": {
   "put": {
    "operationId": "saveProjectViewPreference",
    "summary": "Save the caller's display preference of a project view (Backlog, List, Epics)",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/ProjectViewKindPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ViewPreferenceDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "resetProjectViewPreference",
    "summary": "Reset the caller's display preference of a project view; the caller follows the default again",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ProjectKeyPath"
     },
     {
      "$ref": "#/components/parameters/ProjectViewKindPath"
     }
    ],
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/projects/{projectKey}/work-frame": {
   "get": {
    "operationId": "getWorkFrame",
    "summary": "The Work frame — active sprint summary, goal, backlog and client-visible counts, assignees in scope, available views",
    "x-feature": "F-WRK-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "projectKey",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "$ref": "#/components/parameters/WorkFilterQuery"
     },
     {
      "$ref": "#/components/parameters/WorkSearchQuery"
     },
     {
      "name": "view",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/WorkViewKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The frame.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorkFrameView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/rate-card": {
   "get": {
    "operationId": "getRateCard",
    "summary": "The cost and bill rates in force on a date, per subject (view_rates; audited)",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "asOf",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "filter[subjectKind]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "role",
        "member",
        "project_role",
        "project_member"
       ]
      }
     },
     {
      "name": "filter[projectKey]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 100 rows.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/RateCardRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/rate-versions": {
   "get": {
    "operationId": "listRateVersions",
    "summary": "The history of rate versions of one subject (view_rates; audited)",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[subjectKind]",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "role",
        "member",
        "project_role",
        "project_member"
       ]
      }
     },
     {
      "name": "filter[memberId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[deliveryRoleId]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "filter[projectKey]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "filter[rateKind]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "cost",
        "bill"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 50 versions, newest effective date first, then newest recorded.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/RateVersionView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "recordRate",
    "summary": "Record a rate version for a subject from an effective date, an end, or a correction",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RateVersionRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The recorded version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RateVersionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/rate-versions/{rateVersionId}": {
   "get": {
    "operationId": "getRateVersion",
    "summary": "One rate version (view_rates; audited)",
    "x-feature": "F-FIN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/RateVersionIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RateVersionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reaction-emoji": {
   "get": {
    "operationId": "getReactionEmoji",
    "summary": "The tenant's allowed reaction emoji, for every person who may react (internal members and client guests)",
    "x-feature": "F-WRK-38",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The mode, the list for only, the catalogue's versions and the per-comment bound; ETag is the Work settings epoch.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReactionEmojiSettingsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "put": {
    "operationId": "changeReactionEmoji",
    "summary": "Set the tenant's allowed reaction emoji (the Admin; one Save of the mode and the list)",
    "x-feature": "F-WRK-38",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReactionEmojiSettingsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new state; ETag is the new Work settings epoch.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReactionEmojiSettingsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/realtime/channels": {
   "get": {
    "operationId": "getRealtimeChannelNames",
    "summary": "The reader's current tenant and user channel names, with their audience epochs (XM-116)",
    "description": "`private-tenant.{t}.v{n}` and `private-tenant.{t}.user.{u}.v{n}`: every narrowing of Access's authority-change map that reaches the channels' audience moves `n` (`tenancy.channel-epoch`), publishers publish on the current names only and `/broadcasting/auth` signs only them, so an authorisation fetched before a narrowing subscribes to a name nobody publishes on (`07-…` §5.4; `08-…` §6.9). The workspace shell and the portal read the names when they open and again on `channels.rotated` (and on reconnect). `tenant` is null for a client guest (the tenant channel is internal); a View as client is refused. Members and client guests of the tenant; an operator under a support grant answers 404.",
    "x-feature": "F-WSP-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The channel names to subscribe.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "tenant",
            "user"
           ],
           "properties": {
            "tenant": {
             "type": [
              "string",
              "null"
             ],
             "maxLength": 80,
             "pattern": "^private-tenant\\.[0-9a-f-]{36}\\.v[1-9][0-9]{0,17}$"
            },
            "user": {
             "type": [
              "string",
              "null"
             ],
             "maxLength": 130,
             "pattern": "^private-tenant\\.[0-9a-f-]{36}\\.user\\.[0-9a-f-]{36}\\.v[1-9][0-9]{0,17}$"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/relation-kinds": {
   "get": {
    "operationId": "listRelationKinds",
    "summary": "The tenant's relation kinds in order",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "all"
       ],
       "default": "active"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The kinds.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/RelationKindView"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createRelationKind",
    "summary": "Add a custom relation kind",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RelationKindCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The kind.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RelationKindView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/relation-kinds/{kindKey}": {
   "patch": {
    "operationId": "editRelationKind",
    "summary": "Change a custom kind's phrases or position",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/RelationKindKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/RelationKindPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The kind.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RelationKindView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteRelationKind",
    "summary": "Delete an unused custom kind",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/RelationKindKeyPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/relation-kinds/{kindKey}/archive": {
   "post": {
    "operationId": "archiveRelationKind",
    "summary": "Archive a custom kind; its relations stay",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/RelationKindKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The kind.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RelationKindView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/relation-kinds/{kindKey}/restore": {
   "post": {
    "operationId": "restoreRelationKind",
    "summary": "Restore an archived custom kind",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/RelationKindKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The kind.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RelationKindView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/report-runs/{reportRunId}": {
   "get": {
    "operationId": "getReportRun",
    "summary": "One run of the caller — state, columns, totals and notices",
    "x-feature": "F-RPT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ReportRunIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The run.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportRunView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/report-runs/{reportRunId}/export": {
   "post": {
    "operationId": "exportReportRun",
    "summary": "Download a finished run of the caller as CSV, written from the stored result",
    "x-feature": "F-RPT-04",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ReportRunIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The CSV file (Content-Disposition attachment), UTF-8 with a byte-order mark; the notices in X-Kanso-Report-Notices.",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/report-runs/{reportRunId}/rows": {
   "get": {
    "operationId": "listReportRunRows",
    "summary": "The rows of a finished run in the result's order, up to 100 a page",
    "x-feature": "F-RPT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ReportRunIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of rows.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/ReportRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/report-schedules/{reportScheduleId}": {
   "get": {
    "operationId": "getReportSchedule",
    "summary": "One schedule",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ReportScheduleIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The schedule (ETag is its version).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportScheduleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateReportSchedule",
    "summary": "Change the cadence, the period or the recipients",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ReportScheduleIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportSchedulePatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The schedule.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportScheduleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteReportSchedule",
    "summary": "Delete a schedule and its delivery records",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ReportScheduleIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/report-schedules/{reportScheduleId}/deliveries": {
   "get": {
    "operationId": "listReportScheduleDeliveries",
    "summary": "The deliveries of a schedule with their states (its editors), newest first",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/ReportScheduleIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 50 deliveries; another recipient's file id is never included.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/ReportDeliveryView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/report-schedules/{reportScheduleId}/pause": {
   "post": {
    "operationId": "pauseReportSchedule",
    "summary": "Pause a schedule",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ReportScheduleIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The paused schedule.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportScheduleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/report-schedules/{reportScheduleId}/resume": {
   "post": {
    "operationId": "resumeReportSchedule",
    "summary": "Resume a paused or suspended schedule when its cause is gone",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/ReportScheduleIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The active schedule with its next occurrence.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportScheduleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reports/catalogue": {
   "get": {
    "operationId": "getReportCatalogue",
    "summary": "The fact-source catalogue with the reader's availability per source and measure",
    "x-feature": "F-RPT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The catalogue version and its sources.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportCatalogue"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reports/catalogue/summary": {
   "get": {
    "operationId": "getReportCatalogueSummary",
    "summary": "The headline figure of each catalogue source that the reader may use (the Reports landing's catalogue panels)",
    "description": "XM-955 (G-RPT-01): per source, its headline measure in the current period and in the period before (the change in whole per cent) and up to 12 weekly points, each computed as the reader's own synchronous run (the same visibility, time level and money rules); only totals leave; nothing is stored. A source the reader cannot use is left out; a withheld total is absent. The estimates source is a snapshot: logged of estimate in per cent, no previous period and no points.",
    "x-feature": "F-RPT-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The figures in the catalogue's order.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "sources"
           ],
           "properties": {
            "sources": {
             "type": "array",
             "maxItems": 20,
             "items": {
              "type": "object",
              "required": [
               "source",
               "measure",
               "unit",
               "points"
              ],
              "properties": {
               "source": {
                "$ref": "#/components/schemas/ReportSourceKey"
               },
               "measure": {
                "$ref": "#/components/schemas/ReportKey"
               },
               "unit": {
                "type": "string",
                "enum": [
                 "minutes",
                 "count",
                 "money",
                 "percent"
                ]
               },
               "current": {
                "type": "number"
               },
               "previous": {
                "type": "number"
               },
               "deltaPercent": {
                "type": "integer"
               },
               "points": {
                "type": "array",
                "maxItems": 12,
                "items": {
                 "type": "number"
                }
               },
               "currency": {
                "$ref": "#/components/schemas/CurrencyCode"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reports/dimension-values": {
   "post": {
    "operationId": "listReportDimensionValues",
    "summary": "The values of an entity dimension that the reader's own facts hold for the builder's definition (the Filters bar)",
    "description": "XM-1269 (G-RPT-05, G-RPT-09): the builder's definition (its source, period and other filters) planned and computed in the reader's own context with the one dimension, exactly as a synchronous run of the reader; only labelled values leave (a hidden value, a small group or a former member is never named); nothing is stored. `q` keeps the labels that hold the text. At most 50, in label order; `capped` when more matched.",
    "x-feature": "F-RPT-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "definition",
         "dimension"
        ],
        "properties": {
         "definition": {
          "$ref": "#/components/schemas/ReportDefinition"
         },
         "dimension": {
          "$ref": "#/components/schemas/ReportKey"
         },
         "q": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The values, each its id (the filter's value) and its label.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "type": "object",
            "required": [
             "value",
             "label"
            ],
            "properties": {
             "value": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
             },
             "label": {
              "type": "string",
              "maxLength": 200
             }
            }
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "capped"
           ],
           "properties": {
            "capped": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reports/limits": {
   "get": {
    "operationId": "getReportLimits",
    "summary": "The effective limits of the report engine and the usage the caller may know",
    "x-feature": "F-RPT-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The limits; the tenant counts are zero for a caller who is not an Admin.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportLimitsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reports/runs": {
   "post": {
    "operationId": "runReport",
    "summary": "Run a definition in the caller's own access — the result at once, or an operation for a large run",
    "x-feature": "F-RPT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportRunRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The finished run (Location /api/v1/report-runs/{id}); its rows are read page by page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportRunView"
          }
         }
        }
       }
      }
     },
     "202": {
      "description": "A large run continues in the background; the run in state running with its operationId (Location names the operation).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportRunView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reports/this-week": {
   "get": {
    "operationId": "getReportsThisWeek",
    "summary": "The logged time of the current and the previous timesheet week as the reader's own worklogs report (the Reports sidebar)",
    "x-feature": "F-RPT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The two weeks' totals, or `available` false.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportThisWeek"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/reports/validate": {
   "post": {
    "operationId": "validateReportDefinition",
    "summary": "Validate a definition, resolve its period and estimate its size; returns no data",
    "x-feature": "F-RPT-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportRunRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The validation; valid is false with field errors when the definition is invalid.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportValidation"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/repository-connections": {
   "get": {
    "operationId": "listRepositoryConnections",
    "summary": "The project-centric repositories table — every project, its live connections, or a \"No repository\" row",
    "x-feature": "F-INT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[presence]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "all",
        "with_repository",
        "without_repository",
        "needs_attention"
       ],
       "default": "all"
      }
     },
     {
      "name": "filter[projectKey]",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     {
      "name": "filter[archived]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 100
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 25
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of rows with exact counts per filter.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/RepositoryConnectionRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "counts"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            },
            "counts": {
             "type": "object",
             "required": [
              "all",
              "withRepository",
              "withoutRepository",
              "needsAttention"
             ],
             "properties": {
              "all": {
               "type": "integer",
               "minimum": 0
              },
              "withRepository": {
               "type": "integer",
               "minimum": 0
              },
              "withoutRepository": {
               "type": "integer",
               "minimum": 0
              },
              "needsAttention": {
               "type": "integer",
               "minimum": 0
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "connectRepository",
    "summary": "Connect the chosen repository with a consumed token check; the member becomes the connection's owner",
    "x-feature": "F-INT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "checkId",
         "projectKey",
         "repositoryId"
        ],
        "additionalProperties": false,
        "properties": {
         "checkId": {
          "type": "string",
          "minLength": 22,
          "maxLength": 64
         },
         "projectKey": {
          "$ref": "#/components/schemas/ProjectKey"
         },
         "repositoryId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
         },
         "rotationDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 365
         },
         "webhookMode": {
          "$ref": "#/components/schemas/WebhookModeKey"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Connected; a manual hook's URL and secret are returned once.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RepositoryConnectionView"
          },
          "manualWebhook": {
           "$ref": "#/components/schemas/ManualWebhookSetup"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "502": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/repository-connections/token-checks": {
   "post": {
    "operationId": "checkRepositoryToken",
    "summary": "Verify a pasted access token with the provider and list the repositories it can read; the token is held 10 minutes",
    "x-feature": "F-INT-03",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "projectKey",
         "provider",
         "token"
        ],
        "additionalProperties": false,
        "properties": {
         "projectKey": {
          "$ref": "#/components/schemas/ProjectKey"
         },
         "provider": {
          "$ref": "#/components/schemas/AllowedProviderKey"
         },
         "instanceId": {
          "$ref": "#/components/schemas/Uuid"
         },
         "token": {
          "type": "string",
          "minLength": 20,
          "maxLength": 512,
          "writeOnly": true
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The verified token's facts and repositories; never the token.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TokenCheckView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "502": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/repository-connections/{connectionId}": {
   "delete": {
    "operationId": "disconnectRepository",
    "summary": "Disconnect a repository from its project; links stay as frozen history",
    "x-feature": "F-INT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/RepositoryConnectionIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Disconnected (or already disconnected)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeRepositoryConnectionRotation",
    "summary": "Set a connection's own rotation period (shorter than the tenant default) or reset it to the default",
    "x-feature": "F-INT-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/RepositoryConnectionIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "rotationDays"
        ],
        "additionalProperties": false,
        "properties": {
         "rotationDays": {
          "oneOf": [
           {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
           },
           {
            "type": "null"
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Changed; the due date recomputed.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RepositoryConnectionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/repository-connections/{connectionId}/owner": {
   "put": {
    "operationId": "transferRepositoryConnectionOwner",
    "summary": "Designate the connection's accountable owner (Admins); resumes a connection paused for \"owner needed\"",
    "x-feature": "F-INT-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/RepositoryConnectionIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "memberId"
        ],
        "additionalProperties": false,
        "properties": {
         "memberId": {
          "$ref": "#/components/schemas/Uuid"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Transferred.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RepositoryConnectionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/repository-connections/{connectionId}/token": {
   "put": {
    "operationId": "replaceRepositoryToken",
    "summary": "Replace a connection's access token and webhook secret together; resumes a paused or expired connection",
    "x-feature": "F-INT-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/RepositoryConnectionIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "token"
        ],
        "additionalProperties": false,
        "properties": {
         "token": {
          "type": "string",
          "minLength": 20,
          "maxLength": 512,
          "writeOnly": true
         },
         "rotationDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 365
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Replaced; a manual hook's new secret is returned once.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RepositoryConnectionView"
          },
          "manualWebhook": {
           "$ref": "#/components/schemas/ManualWebhookSetup"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "502": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}": {
   "get": {
    "operationId": "getTriageRequest",
    "summary": "One request with its internal view",
    "x-feature": "F-HLP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The internal view; ETag of the request's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTriageView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/accept": {
   "post": {
    "operationId": "acceptRequest",
    "summary": "Accept a request into a new ticket",
    "x-feature": "F-HLP-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskAcceptDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The accepted request and the new ticket's key.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskDecisionResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/accept-proposal": {
   "get": {
    "operationId": "getRequestAcceptProposal",
    "summary": "What the accept and merge dialogs propose (the files to copy, the mapped custom-field values)",
    "description": "Owner, 23 Nov 2026 (H1 rest): R03 and R05 need data that the request view does not hold in Work's terms. The files are the request's files that scanned clean (the dialogs choose all of them by default). Each custom field is a form field of the request's form version that maps to a custom field of the project's current field set and has a value; the value is in Work's `customFields` shape (text, a number, a boolean, an option id or a list of option ids). A form option matches a custom-field option by its label, lower-case and trimmed (the rule of `KindToTypeMapping`). Needs `triage_requests` (F-HLP-07.R01).",
    "x-feature": "F-HLP-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The proposal.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskAcceptProposal"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/ask-for-information": {
   "post": {
    "operationId": "askRequestForInformation",
    "summary": "Ask the client for more information and pause the request",
    "x-feature": "F-HLP-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskMessageDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The request, now waiting for the client.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskDecisionResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/merge": {
   "post": {
    "operationId": "mergeRequest",
    "summary": "Merge a request into an existing ticket",
    "x-feature": "F-HLP-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskMergeDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The merged request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskDecisionResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/messages": {
   "get": {
    "operationId": "listTriageRequestMessages",
    "summary": "Every message of a request with internal notes, oldest first",
    "x-feature": "F-HLP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A keyset page of 50.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/HelpDeskMessageView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "postTriageMessage",
    "summary": "Reply to the client or add an internal note",
    "x-feature": "F-HLP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/HelpDeskMessageDraft"
         },
         {
          "type": "object",
          "required": [
           "kind"
          ],
          "properties": {
           "kind": {
            "type": "string",
            "enum": [
             "team",
             "internal_note"
            ]
           }
          }
         }
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The request's internal view with the new message.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTriageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/messages/{messageId}/redact": {
   "post": {
    "operationId": "redactRequestMessage",
    "summary": "Replace a message's text with \"This message was redacted.\"",
    "x-feature": "F-HLP-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     },
     {
      "name": "messageId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The redacted message.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskMessageView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/opportunities": {
   "get": {
    "operationId": "listRequestOpportunities",
    "summary": "The opportunities that cite a request, for the request panel",
    "x-feature": "F-DSC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "At most 10 opportunities that the reader can see.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 10,
           "items": {
            "$ref": "#/components/schemas/TicketOpportunityLink"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/reject": {
   "post": {
    "operationId": "rejectRequest",
    "summary": "Reject a request with a reason the client sees",
    "x-feature": "F-HLP-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskRejectDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The rejected request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskDecisionResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/requests/{requestKey}/triage-owner": {
   "put": {
    "operationId": "setTriageOwner",
    "summary": "Claim, assign or clear the triage owner",
    "x-feature": "F-HLP-07",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "requestKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/HelpDeskRequestKey"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/HelpDeskTriageOwnerChange"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The request's internal view.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/HelpDeskTriageView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/roles": {
   "get": {
    "operationId": "listRoles",
    "summary": "The tenant's roles with live member counts",
    "x-feature": "F-ACC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Every role, system roles first; bounded (at most 200 roles per tenant).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/RoleSummaryView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createRole",
    "summary": "Create a custom role from a template or as a copy of another role",
    "x-feature": "F-ACC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RoleCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new role, version 1 active; Location points to it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleDetailView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/roles/{roleId}": {
   "get": {
    "operationId": "getRole",
    "summary": "One role with its active rules, the caller's draft or another author's draft marker, and its protected operands",
    "x-feature": "F-ACC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The role; ETag carries the role's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleDetailView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "renameRole",
    "summary": "Rename a custom role",
    "x-feature": "F-ACC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RoleRenameRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The renamed role.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleSummaryView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteRole",
    "summary": "Delete a custom role that no member holds",
    "x-feature": "F-ACC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The role, its versions and its draft are gone."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/roles/{roleId}/activate": {
   "post": {
    "operationId": "activateRoleDraft",
    "summary": "Save the role — the draft becomes the new active version and applies at once",
    "x-feature": "F-ACC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RoleActivateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The role with its new active version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleDetailView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/roles/{roleId}/draft": {
   "put": {
    "operationId": "saveRoleDraft",
    "summary": "Save the caller's draft of a role (the whole document)",
    "x-feature": "F-ACC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RoleDraftRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The stored draft with its new draft version and warnings.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleDraftView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "discardRoleDraft",
    "summary": "Discard a role's draft (the author's, or another author's explicitly)",
    "x-feature": "F-ACC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "The draft is gone."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/roles/{roleId}/draft/impact": {
   "get": {
    "operationId": "getRoleDraftImpact",
    "summary": "What activating the draft changes for today's holders, its policy classification and new protected operands",
    "x-feature": "F-ACC-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Presentation only; computed when asked.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleImpactView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/roles/{roleId}/preview": {
   "post": {
    "operationId": "previewRole",
    "summary": "Render a sample ticket as a role (draft or active) or an internal member would see it",
    "x-feature": "F-ACC-08",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RolePreviewRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The preview; nothing was written but a throttled audit mark.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/PreviewResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/roles/{roleId}/reapply-template": {
   "post": {
    "operationId": "reapplyRoleTemplate",
    "summary": "Re-apply the role's updated template as the caller's draft",
    "description": "\"Template updated · Re-apply\" (R09, S08): the template's current revision becomes the caller's draft of the role — the Contractor's projects kept — activated later with its impact; a document equal to the active one is adopted at once without a draft. A repeated call finds the draft it made.",
    "x-feature": "F-ACC-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "roleId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The role with the caller's draft of the re-applied template (or the adopted revision).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RoleDetailView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saml/{tenantId}/acs": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "consumeSamlResponse",
    "summary": "The tenant's assertion consumer service (HTTP-POST binding)",
    "x-feature": "F-IDN-04",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "name": "tenantId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/x-www-form-urlencoded": {
       "schema": {
        "type": "object",
        "required": [
         "SAMLResponse"
        ],
        "properties": {
         "SAMLResponse": {
          "type": "string",
          "maxLength": 2000000
         },
         "RelayState": {
          "type": "string",
          "maxLength": 256
         }
        }
       }
      }
     }
    },
    "responses": {
     "303": {
      "description": "To /auth/saml/continue with a one-time handoff code."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saml/{tenantId}/metadata": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "get": {
    "operationId": "getServiceProviderMetadata",
    "summary": "The tenant's SAML service-provider metadata (XML) for its IdP",
    "x-feature": "F-IDN-22",
    "x-audience": "public",
    "x-surface": "auth",
    "parameters": [
     {
      "name": "tenantId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SP entityID, ACS, SLS and the platform SP certificate(s) as application/samlmetadata+xml."
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saml/{tenantId}/sls": {
   "servers": [
    {
     "url": "/",
     "description": "app.<apex> — the step-based sign-in surface (/auth)"
    }
   ],
   "post": {
    "operationId": "receiveSamlLogout",
    "summary": "IdP-initiated LogoutRequest or the LogoutResponse to an SP-initiated logout (POST binding)",
    "x-feature": "F-IDN-04",
    "x-audience": "spa",
    "x-surface": "auth",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "name": "tenantId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A LogoutResponse (auto-posting form) or a redirect to /sign-in."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "get": {
    "operationId": "receiveSamlLogoutRedirect",
    "summary": "The same over the HTTP-Redirect binding",
    "x-feature": "F-IDN-04",
    "x-audience": "spa",
    "x-surface": "auth",
    "parameters": [
     {
      "name": "tenantId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "SAMLRequest",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 65536
      }
     },
     {
      "name": "SAMLResponse",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 65536
      }
     }
    ],
    "responses": {
     "302": {
      "description": "The LogoutResponse to the IdP, or /sign-in after an SP-initiated logout."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/saved-reports": {
   "get": {
    "operationId": "listSavedReports",
    "summary": "The caller's own reports and the shared reports the caller can open",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     },
     {
      "name": "filter[scope]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "mine",
        "shared",
        "all"
       ],
       "default": "mine"
      }
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "any"
       ],
       "default": "active"
      },
      "description": "`any` lists both states in one list (XM-1266; the designed grid shows a State column)."
     },
     {
      "name": "filter[source]",
      "in": "query",
      "required": false,
      "description": "One source key or several, separated by commas (XM-1266).",
      "schema": {
       "type": "string",
       "pattern": "^(worklogs|costs|plans|expenses|estimates)(,(worklogs|costs|plans|expenses|estimates)){0,4}$"
      }
     },
     {
      "name": "filter[sharing]",
      "in": "query",
      "required": false,
      "description": "One sharing level or several, separated by commas (XM-1266; the designed \"Shared with\" filter).",
      "schema": {
       "type": "string",
       "pattern": "^(personal|team|tenant)(,(personal|team|tenant)){0,2}$"
      }
     },
     {
      "name": "filter[owner]",
      "in": "query",
      "required": false,
      "description": "The reports of these owners (member ids, separated by commas, at most 50; XM-1266; the designed Owner filter \"is\").",
      "schema": {
       "type": "string",
       "maxLength": 1900
      }
     },
     {
      "name": "filter[notOwner]",
      "in": "query",
      "required": false,
      "description": "The reports of every owner except these (member ids, separated by commas, at most 50; XM-1266; the Owner filter \"is not\").",
      "schema": {
       "type": "string",
       "maxLength": 1900
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "description": "The order (XM-1266). A cursor page takes only `-updatedAt`; every other order needs `page[number]`. `owner` orders by the owner's display name (\"Former member\" for a removed owner); each order ends on the id.",
      "schema": {
       "type": "string",
       "enum": [
        "-updatedAt",
        "updatedAt",
        "name",
        "-name",
        "source",
        "-source",
        "owner",
        "-owner",
        "sharing",
        "-sharing",
        "state",
        "-state",
        "scheduleCount",
        "-scheduleCount"
       ],
       "default": "-updatedAt"
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "description": "An offset page (XM-1266; the designed grid's page numbers); not with `page[cursor]`.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 999999
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "description": "The rows of an offset page (the designed \"Rows per page\").",
      "schema": {
       "type": "integer",
       "enum": [
        10,
        20,
        25,
        30,
        50,
        100
       ],
       "default": 25
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 25 reports, newest change first (a cursor page); or an offset page (`page[number]`) in `sort` with its total, the counts of the segments and the owners of the scope (XM-1266).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/SavedReportSummary"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "oneOf": [
              {
               "$ref": "#/components/schemas/CursorPageMeta"
              },
              {
               "$ref": "#/components/schemas/OffsetPageMeta"
              }
             ]
            },
            "counts": {
             "type": "object",
             "description": "An offset page only: the reader's own reports and the shared reports the reader opens, in both states and before the filters (the designed segment badges); `all` (every report of the tenant) for an Admin only (R16).",
             "required": [
              "mine",
              "shared"
             ],
             "properties": {
              "mine": {
               "type": "integer",
               "minimum": 0
              },
              "shared": {
               "type": "integer",
               "minimum": 0
              },
              "all": {
               "type": "integer",
               "minimum": 0
              }
             }
            },
            "owners": {
             "type": "array",
             "maxItems": 200,
             "description": "An offset page only — the owners of the scope's reports in name order (the designed Owner filter's options).",
             "items": {
              "$ref": "#/components/schemas/MemberRef"
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createSavedReport",
    "summary": "Save a definition as a new report, version 1",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SavedReportCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The saved report.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}": {
   "get": {
    "operationId": "getSavedReport",
    "summary": "One saved report with its current definition and what the caller may do",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The report (ETag is its version).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "updateSavedReport",
    "summary": "Rename a report or change its description",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SavedReportPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The report.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteSavedReport",
    "summary": "Delete a report with its versions and schedules",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted."
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/archive": {
   "post": {
    "operationId": "archiveSavedReport",
    "summary": "Archive a report and suspend its schedules",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived report.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/duplicate": {
   "post": {
    "operationId": "duplicateSavedReport",
    "summary": "Make a personal copy of a report the caller can open",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SavedReportDuplicateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The copy, owned by the caller.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/restore": {
   "post": {
    "operationId": "restoreSavedReport",
    "summary": "Restore an archived report",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The active report; its schedules stay suspended.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/runs": {
   "post": {
    "operationId": "runSavedReport",
    "summary": "Run a saved report in the caller's own access, optionally with another period or an earlier version",
    "x-feature": "F-RPT-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SavedReportRunRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The finished run.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportRunView"
          }
         }
        }
       }
      }
     },
     "202": {
      "description": "A large run continues in the background; the run in state running with its operationId.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportRunView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/schedules": {
   "get": {
    "operationId": "listReportSchedules",
    "summary": "The schedules of a saved report (its editors)",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The schedules, at most 20.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/ReportScheduleView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createReportSchedule",
    "summary": "Schedule a saved report for recipients",
    "x-feature": "F-RPT-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportScheduleRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The schedule with its next occurrence.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ReportScheduleView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/sharing": {
   "put": {
    "operationId": "setSavedReportSharing",
    "summary": "Set who may open the report — personal, a team or the tenant",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportSharingRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The report with its sharing.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/transfer": {
   "post": {
    "operationId": "transferSavedReport",
    "summary": "Make another internal member the report's owner",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportTransferRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The report with its new owner; for a caller who no longer opens it, the report as the transfer left it with every `can` false (R18).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/saved-reports/{savedReportId}/versions": {
   "get": {
    "operationId": "listSavedReportVersions",
    "summary": "The versions of a report, newest first",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of 25 versions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 25,
           "items": {
            "$ref": "#/components/schemas/SavedReportVersionView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "reviseSavedReport",
    "summary": "Save a changed definition as the next version",
    "x-feature": "F-RPT-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SavedReportIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SavedReportRevisionRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The report at its new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SavedReportView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/search": {
   "get": {
    "operationId": "searchGlobal",
    "summary": "Global search — at most 20 grouped, permission-filtered hits (scope workspace for ⌘K, admin for administration search)",
    "x-feature": "F-SRC-01",
    "x-audience": "public",
    "x-assistant": {
     "tool": "search",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [],
     "description": "Search tickets, projects, documents and people that you can see in this tenant."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "scope",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "workspace",
        "admin"
       ],
       "default": "workspace"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Grouped hits.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SearchResults"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/search/members": {
   "get": {
    "operationId": "searchMembers",
    "summary": "Member and client-guest typeahead for pickers, limited to the caller's scope",
    "x-feature": "F-SRC-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "projectKey",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     },
     {
      "name": "audience",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "internal",
        "client",
        "any"
       ],
       "default": "internal"
      }
     },
     {
      "name": "capability",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/CapabilityKey"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 20,
       "default": 10
      }
     },
     {
      "name": "place",
      "in": "query",
      "required": false,
      "description": "F-SRC-05.R07 (XM-938): the place of a mention — only the people whom that place's write accepts as a mention. Not with projectKey or capability. An unknown, hidden or unwritable place answers like a place where nobody matches.",
      "schema": {
       "type": "string",
       "maxLength": 80,
       "pattern": "^(ticket:[A-Za-z][A-Za-z0-9]{1,9}-[1-9][0-9]{0,8}:(internal|client|description|acceptance_criterion)|(doc_page|conversation):[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-7[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12})$"
      }
     },
     {
      "name": "notInProject",
      "in": "query",
      "required": false,
      "description": "XM-1023 (R08) — the active internal members WITHOUT an active membership of this project (\"Add member\" on Project › People); not with projectKey, capability, place or a non-internal audience.",
      "schema": {
       "type": "string",
       "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Candidates.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/MemberPickerPage"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/search/projects": {
   "get": {
    "operationId": "findProjects",
    "summary": "The project finder (⌘P) and project typeahead — recent projects when q is empty",
    "x-feature": "F-SRC-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     {
      "name": "capability",
      "in": "query",
      "required": false,
      "schema": {
       "$ref": "#/components/schemas/CapabilityKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Up to 20 projects.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectFinderPage"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security": {
   "get": {
    "operationId": "getTenantSecurityOverview",
    "summary": "The Security & sign-in page — methods, team policies, 2FA, sessions and tokens",
    "x-feature": "F-IDN-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The tenant's authentication policy with live counts; ETag is the policy version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantSecurityOverview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/saml/metadata": {
   "post": {
    "operationId": "submitSamlMetadata",
    "summary": "Parse IdP metadata (file content or URL) and save it unless dryRun",
    "x-feature": "F-IDN-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SamlMetadataSubmission"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The parsed entities; saved when dryRun is false.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SamlMetadataPreview"
          }
         }
        }
       }
      }
     },
     "202": {
      "description": "A metadata URL is fetched by an operation; its result is a SamlMetadataPreview."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "413": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/saml/test": {
   "post": {
    "operationId": "startSamlTest",
    "summary": "Start a test sign-in against the stored or a candidate configuration",
    "x-feature": "F-IDN-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SamlTestStart"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "A pending test with the IdP redirect URL (top-level navigation).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SamlTestResult"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/saml/test/{testId}": {
   "get": {
    "operationId": "getSamlTestResult",
    "summary": "The outcome of a test sign-in (kept 10 minutes)",
    "x-feature": "F-IDN-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "testId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Pending, passed, failed or expired, with what the assertion carried.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SamlTestResult"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/session-policy": {
   "put": {
    "operationId": "setSessionPolicy",
    "summary": "Save session length and idle timeout for new sign-ins",
    "x-feature": "F-IDN-25",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SessionPolicyUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved policy; ETag is the new policy version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantSecurityOverview"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/sign-everyone-out": {
   "post": {
    "operationId": "signEveryoneOut",
    "summary": "End every session in the tenant except the caller's",
    "x-feature": "F-IDN-25",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The counts and the new epoch.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignEveryoneOutResult"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/sign-in-methods/{method}": {
   "put": {
    "operationId": "configureSignInMethod",
    "summary": "Save one method's dialog — Enabled, audience and settings",
    "x-feature": "F-IDN-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "method",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "password",
        "google",
        "microsoft",
        "saml"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SignInMethodConfigUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved method row.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInMethodConfigView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/sign-in-methods/{method}/validate": {
   "post": {
    "operationId": "validateSignInMethodChange",
    "summary": "Dry run — the consequence of a method change before Save",
    "x-feature": "F-IDN-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "method",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "password",
        "google",
        "microsoft",
        "saml"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SignInMethodConfigUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequence sentence and the stranded accounts; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignInMethodImpact"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/token-policy": {
   "put": {
    "operationId": "setTokenPolicy",
    "summary": "Allow or turn off tokens and set their maximum lifetime",
    "x-feature": "F-IDN-26",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TokenPolicyUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved policy with the number of tokens revoked.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantSecurityOverview"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/two-factor-policy": {
   "put": {
    "operationId": "setTwoFactorPolicy",
    "summary": "Save the tenant's two-factor policy and device-trust switches",
    "x-feature": "F-IDN-24",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TwoFactorPolicyUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved policy with fresh counts; ETag is the new policy version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantSecurityOverview"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/two-factor-policy/validate": {
   "post": {
    "operationId": "validateTwoFactorPolicy",
    "summary": "Dry run — how many people the proposed policy makes enrol",
    "x-feature": "F-IDN-24",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TwoFactorPolicyUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequence; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "sentence",
            "mustEnrol",
            "loosening"
           ],
           "properties": {
            "sentence": {
             "type": "string",
             "maxLength": 300
            },
            "mustEnrol": {
             "type": "integer",
             "minimum": 0
            },
            "loosening": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/security/two-factor-reminders": {
   "post": {
    "operationId": "sendTwoFactorReminders",
    "summary": "Remind members without an authenticator — all of them, or the selected ones — once per cooldown",
    "x-feature": "F-NOT-06",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TwoFactorReminderRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "How many were reminded and who was skipped why.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TwoFactorReminderResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/settings": {
   "get": {
    "operationId": "listSettingGroups",
    "summary": "Every settings group of the tenant the caller may read, with effective values, sources, bounds and pending versions",
    "x-feature": "F-TEN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The readable groups; `validUntil` is the earliest of theirs.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/settings/helpdesk": {
   "get": {
    "operationId": "getHelpDeskSettings",
    "summary": "The tenant's help-desk settings group",
    "x-feature": "F-HLP-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The group; ETag carries the group's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "patch": {
    "operationId": "changeHelpDeskSettings",
    "summary": "Change the tenant's help-desk settings (JSON Merge Patch; null resets to the default)",
    "x-feature": "F-HLP-09",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The group after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/settings/schema": {
   "get": {
    "operationId": "getSettingsSchema",
    "summary": "The settings registry as the caller's scope sees it — groups, keys, types, bounds, labels, change semantics and editors",
    "x-feature": "F-TEN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "scope",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "tenant",
        "project",
        "member"
       ],
       "default": "tenant"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The schema.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingsSchemaView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/settings/{group}": {
   "parameters": [
    {
     "$ref": "#/components/parameters/SettingGroupPath"
    }
   ],
   "get": {
    "operationId": "getSettingGroup",
    "summary": "One settings group — effective values, defaults, bounds, sources and pending versions; ETag carries its version",
    "x-feature": "F-TEN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The group; ETag carries the group's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "changeSettingGroup",
    "summary": "Change one settings group — a JSON Merge Patch of its keys with If-Match (null resets a key to its inherited value)",
    "x-feature": "F-TEN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The group after the change; a shortened retention shows as pending.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingGroupView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/settings/{group}/validate": {
   "parameters": [
    {
     "$ref": "#/components/parameters/SettingGroupPath"
    }
   ],
   "post": {
    "operationId": "validateSettingGroup",
    "summary": "Dry run of a settings group change — the consequence sentences with the server's counts; nothing is written",
    "x-feature": "F-TEN-02",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SettingGroupPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequences; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingsValidation"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/shared-labels": {
   "get": {
    "operationId": "listSharedLabels",
    "summary": "The tenant's shared labels — the Shared labels administration list and the \"Shared\" group of every project's label picker (F-WRK-22.R20)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "Name search (contains, case-insensitive), 1–40 characters.",
      "schema": {
       "type": "string",
       "minLength": 1,
       "maxLength": 40
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "description": "active (default, the pickers) · archived · all (the administration list).",
      "schema": {
       "type": "string",
       "enum": [
        "active",
        "archived",
        "all"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Shared labels by name, at most the tenant's work.labels.sharedLabelLimit (1,000 †); sharedLabelsTruncated tells that more exist. Every internal member reads it; ticketCount and can only for administer holders.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SharedLabelList"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "createSharedLabel",
    "summary": "Create a shared label of the tenant (administer; F-WRK-22.R20)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LabelCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The label; ETag carries its version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/shared-labels/{labelId}": {
   "patch": {
    "operationId": "editSharedLabel",
    "summary": "Rename or recolour a shared label (If-Match; administer)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/SharedLabelIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/LabelEditRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The label after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/shared-labels/{labelId}/archive": {
   "post": {
    "operationId": "archiveSharedLabel",
    "summary": "Archive a shared label (idempotent by state; administer)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/SharedLabelIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The archived label.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/shared-labels/{labelId}/merge": {
   "post": {
    "operationId": "mergeSharedLabel",
    "summary": "Merge a shared label into another shared label (administer; tickets of every project; F-WRK-22.R18, R20)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/SharedLabelIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LabelMergeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The target label and the number of re-tagged tickets.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/LabelMergeResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/shared-labels/{labelId}/merge-preview": {
   "post": {
    "operationId": "previewSharedLabelMerge",
    "summary": "Preview a merge of shared labels: the live tickets of every project that move and those that already carry the target (administer)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/SharedLabelIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "targetLabelId"
        ],
        "additionalProperties": false,
        "properties": {
         "targetLabelId": {
          "$ref": "#/components/schemas/Uuid"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The counts and whether the target is access-sensitive.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/LabelMergePreview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/shared-labels/{labelId}/restore": {
   "post": {
    "operationId": "restoreSharedLabel",
    "summary": "Restore a shared label (idempotent by state; administer)",
    "x-feature": "F-WRK-22",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/SharedLabelIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The active label.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectLabelView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/sprints/{sprintId}": {
   "patch": {
    "operationId": "editSprint",
    "summary": "Edit a planned or active sprint's name, goal or dates",
    "x-feature": "F-WRK-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "sprintId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/SprintPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The sprint.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SprintView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "discardPlannedSprint",
    "summary": "Discard a planned sprint that was never started; its tickets return to the backlog with their ranks",
    "x-feature": "F-WRK-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "sprintId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Discarded."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "get": {
    "operationId": "getSprint",
    "summary": "One sprint with its goal, days left and the epic lines of the Sprint panel",
    "x-feature": "F-WRK-09",
    "x-audience": "public",
    "x-assistant": {
     "tool": "get_sprint",
     "kind": "read",
     "requires": {
      "scope": "resource",
      "capability": null,
      "resource": "sprint"
     },
     "scope": [
      "sprintId"
     ],
     "confirm": "never",
     "pages": [],
     "description": "Read one sprint of a project that you can open: dates, goal and progress."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "sprintId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The sprint; ETag carries its version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SprintView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/sprints/{sprintId}/complete": {
   "post": {
    "operationId": "completeSprint",
    "summary": "Complete the active sprint; unfinished tickets go to the top of the backlog (D-075) or to the top of a planned sprint (carryOverTo)",
    "x-feature": "F-WRK-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "sprintId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SprintCompleteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The completed sprint with the counts.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SprintCompletionResult"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/sprints/{sprintId}/start": {
   "post": {
    "operationId": "startSprint",
    "summary": "Start a planned sprint (no other active sprint; its planned tickets stay in it)",
    "x-feature": "F-WRK-08",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "sprintId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The active sprint.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SprintView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-access-requests": {
   "get": {
    "operationId": "listTenantSupportAccessRequests",
    "summary": "The tenant's pending, active and recently ended support requests (Admins)",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Requests newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TenantSupportRequestView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-access-requests/{requestId}/approve": {
   "post": {
    "operationId": "approveTenantSupportAccess",
    "summary": "Approve the request; the window starts now",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SupportDecisionNote"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The request with the decision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantSupportRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-access-requests/{requestId}/deny": {
   "post": {
    "operationId": "denyTenantSupportAccess",
    "summary": "Deny the request",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SupportDecisionNote"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The request with the decision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantSupportRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-access-requests/{requestId}/revoke": {
   "post": {
    "operationId": "revokeTenantSupportAccess",
    "summary": "End an approved or active window now",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "requestId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SupportDecisionNote"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The request with the revocation.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantSupportRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-change-proposals": {
   "get": {
    "operationId": "listSupportChangeProposals",
    "summary": "The tenant Admin's queue (or the operator's own proposals in a window)",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter[state]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "open",
        "draft",
        "proposed",
        "approved",
        "ended"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Proposals newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/SupportProposalView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "draftSupportChangeProposal",
    "summary": "The operator drafts an exact change of a proposal-class operation",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SupportProposalDraft"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The draft with its before-snapshot and classification.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-change-proposals/{proposalId}": {
   "parameters": [
    {
     "name": "proposalId",
     "in": "path",
     "required": true,
     "schema": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   ],
   "get": {
    "operationId": "getSupportChangeProposal",
    "summary": "The exact proposal — operation, target, before and after, digest, approvals, expiry",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The proposal.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "reviseSupportChangeProposal",
    "summary": "The operator revises a draft",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SupportProposalDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The revised draft.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "discardSupportChangeProposal",
    "summary": "The operator discards a draft",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "The draft is deleted."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-change-proposals/{proposalId}/activate": {
   "post": {
    "operationId": "activateSupportChangeProposal",
    "summary": "The proposing operator applies an approved change once, in the same live window",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "proposalId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The activated proposal; a repeat returns the stored receipt.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-change-proposals/{proposalId}/approve": {
   "post": {
    "operationId": "approveSupportChangeProposal",
    "summary": "An Admin approves the exact change with a fresh strong tenant-bound stamp (optionally applies it)",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "proposalId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SupportProposalDecision"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The approved (or activated) proposal.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-change-proposals/{proposalId}/reject": {
   "post": {
    "operationId": "rejectSupportChangeProposal",
    "summary": "An Admin rejects the exact change (same assurance as approval)",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "proposalId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SupportProposalDecision"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The rejected proposal.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-change-proposals/{proposalId}/submit": {
   "post": {
    "operationId": "submitSupportChangeProposal",
    "summary": "Freeze the payload and digest and ask the tenant's Admins (operator TOTP within 15 minutes)",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "proposalId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The proposed change with its digest and expiry.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/support-change-proposals/{proposalId}/withdraw": {
   "post": {
    "operationId": "withdrawSupportChangeProposal",
    "summary": "The proposing operator withdraws a proposed or approved change",
    "x-feature": "F-PLT-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "proposalId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The withdrawn proposal.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SupportProposalView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/team-avatars": {
   "get": {
    "operationId": "listTeamAvatars",
    "summary": "The teams of the tenant that show an icon or an image (R12) — the UI's map of team avatars",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "An internal member gets every team with an icon or an image; any other reader an empty list. Ids, kinds, icons and image tags only.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamAvatarIndexView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams": {
   "get": {
    "operationId": "listTeams",
    "summary": "The tenant's teams as cards",
    "x-feature": "F-TEN-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "XM-1055 (R10) — only the teams whose name contains this text.",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 100
      }
     },
     {
      "name": "page[number]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 50
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of team cards by name; the page meta carries the total (\"3 teams\").",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TeamCard"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/OffsetPageMeta"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createTeam",
    "summary": "Create a team with an optional lead, initial members and projects to transfer",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TeamCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The team, and one outcome per project to transfer.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamCreateResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams/{teamId}": {
   "get": {
    "operationId": "getTeam",
    "summary": "The selected team's detail panel",
    "x-feature": "F-TEN-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The team, its first six members by joined date, its projects and its sign-in summary; the ETag is the team's version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamDetail"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "renameTeam",
    "summary": "Rename a team",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/TeamRename"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The renamed team.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamCard"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteTeam",
    "summary": "Delete a team that owns no projects",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted (or already absent)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams/{teamId}/avatar": {
   "put": {
    "operationId": "setTeamAvatar",
    "summary": "Show the team's initial or an icon of the registry (R12); a replaced image is removed",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TeamAvatarChoice"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The team with its avatar; the ETag is the team's new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamCard"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams/{teamId}/avatar/image": {
   "put": {
    "operationId": "uploadTeamAvatarImage",
    "summary": "Upload the team's avatar image — scanned, the centre square stored as a 256 px WebP (R12)",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file"
        ],
        "additionalProperties": false,
        "properties": {
         "file": {
          "type": "string",
          "format": "binary",
          "description": "A PNG, JPEG or WebP image of at most 2 MiB."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The team with its image avatar; the ETag is the team's new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamCard"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "get": {
    "operationId": "getTeamAvatarImage",
    "summary": "The team's avatar image for an img element of the tenant (R12)",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "tenant",
      "in": "query",
      "required": true,
      "description": "The tenant id, checked like X-Kanso-Tenant (an img element cannot send headers).",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "v",
      "in": "query",
      "required": false,
      "description": "The image tag of TeamAvatarView (the UI adds it so that a new image is a new address); the server ignores it.",
      "schema": {
       "type": "string",
       "maxLength": 16
      }
     },
     {
      "name": "If-None-Match",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 200
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The 256 px WebP image; a strong ETag; Cache-Control private, no-store.",
      "content": {
       "image/webp": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "304": {
      "description": "The image did not change (If-None-Match)."
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "503": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams/{teamId}/lead": {
   "put": {
    "operationId": "setTeamLead",
    "summary": "Make a member the team's lead, or clear the lead",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TeamLeadUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The team with its lead.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamCard"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams/{teamId}/members": {
   "get": {
    "operationId": "listTeamMembers",
    "summary": "Search a team's members",
    "x-feature": "F-TEN-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "XM-992 (R11) — a substring of the name, or a prefix of the e-mail for a reader who sees e-mails.",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 100
      }
     },
     {
      "name": "filter[role]",
      "in": "query",
      "required": false,
      "description": "XM-992 (R11) — 1–20 role ids, comma-separated; a member with any of them matches.",
      "schema": {
       "type": "string",
       "maxLength": 800
      }
     },
     {
      "name": "sort",
      "in": "query",
      "required": false,
      "description": "XM-992 (R11) — the order; `-` is descending; ties go by the name, then the member id.",
      "schema": {
       "type": "string",
       "enum": [
        "joinedAt",
        "-joinedAt",
        "name",
        "-name",
        "role",
        "-role"
       ],
       "default": "joinedAt"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "The page size (XM-992 — up to 100).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 6
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of the matching members in the asked order, the match total, and the next page while there is one.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TeamMemberRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "total"
           ],
           "properties": {
            "total": {
             "type": "integer",
             "minimum": 0
            },
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addTeamMembers",
    "summary": "Add existing internal members to a team",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TeamMembersAdd"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The members added and those already in the team.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "added",
            "alreadyMembers",
            "team"
           ],
           "properties": {
            "added": {
             "type": "array",
             "maxItems": 100,
             "items": {
              "$ref": "#/components/schemas/Uuid"
             }
            },
            "alreadyMembers": {
             "type": "array",
             "maxItems": 100,
             "items": {
              "$ref": "#/components/schemas/Uuid"
             }
            },
            "team": {
             "$ref": "#/components/schemas/TeamCard"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams/{teamId}/members/{memberId}": {
   "delete": {
    "operationId": "removeTeamMember",
    "summary": "Remove a member from a team",
    "x-feature": "F-TEN-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Removed (or not a member of the team)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/teams/{teamId}/sign-in-policy": {
   "put": {
    "operationId": "setTeamSignInPolicy",
    "summary": "Narrow a team's sign-in methods or enforce SAML single sign-on",
    "x-feature": "F-IDN-23",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "teamId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TeamSignInPolicyUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The team's effective policy; ETag is the new policy version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamSignInPolicyView"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tenant": {
   "get": {
    "operationId": "getTenantOverview",
    "summary": "The administration overview — counts, 2FA figure, projects subset and setup checklist",
    "x-feature": "F-TEN-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The overview read model.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TenantOverview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tenant/setup-checklist/dismissals/{item}": {
   "put": {
    "operationId": "dismissSetupChecklistItem",
    "summary": "Dismiss a checklist item that does not apply (Repositories connected only)",
    "x-feature": "F-TEN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "item",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "repositories_connected"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated checklist.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SetupChecklistView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "restoreSetupChecklistItem",
    "summary": "Show a dismissed item again",
    "x-feature": "F-TEN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "item",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "repositories_connected"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The updated checklist.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SetupChecklistView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/tenant/setup-checklist/hidden": {
   "put": {
    "operationId": "hideSetupChecklist",
    "summary": "Hide the setup checklist panel of the overview (it stays shown at 5 of 5 until an Admin hides it)",
    "x-feature": "F-TEN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The updated checklist (hidden is true).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SetupChecklistView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "showSetupChecklist",
    "summary": "Show the hidden setup checklist panel again (\"Show setup checklist\")",
    "x-feature": "F-TEN-03",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The updated checklist (hidden is false).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SetupChecklistView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/ticket-relations/{relationId}": {
   "patch": {
    "operationId": "editTicketRelation",
    "summary": "Change or clear a relation's reason",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/TicketRelationIdPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/TicketRelationPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The relation, read from its source ticket. A panel of the target ticket reads the list again for its own phrase.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketRelationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "removeTicketRelation",
    "summary": "Remove a relation",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketRelationIdPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Removed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/bulk": {
   "post": {
    "operationId": "bulkEditTickets",
    "summary": "Apply one action to 1–100 tickets of one project, all or nothing (05 §11)",
    "x-feature": "F-WRK-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BulkTicketRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Every target with its version; affected counts the changed ones.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/BulkTicketResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}": {
   "get": {
    "operationId": "getTicket",
    "summary": "The ticket through the caller's mask, with can (the side panel's document)",
    "x-feature": "F-WRK-16",
    "x-audience": "public",
    "x-assistant": {
     "tool": "get_ticket",
     "kind": "read",
     "requires": {
      "scope": "resource",
      "capability": null,
      "resource": "ticket"
     },
     "scope": [
      "ticketKey"
     ],
     "confirm": "never",
     "pages": [
      "ticket-panel"
     ],
     "description": "Read one ticket by its key, with the fields that you can see and what you can do on it."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The ticket; ETag carries the version; meta.warnings may hold ticket.stage_hidden_from_clients (R09).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketDetail"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "trashTicket",
    "summary": "Move the ticket to the trash (restorable for the tenant's retention)",
    "x-feature": "F-WRK-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "204": {
      "description": "Trashed."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "editTicket",
    "summary": "Edit ticket fields (JSON Merge Patch with If-Match); custom fields per F-WRK-26",
    "x-feature": "F-WRK-22",
    "x-audience": "public",
    "x-assistant": {
     "tool": "edit_ticket",
     "kind": "write",
     "requires": {
      "scope": "resource",
      "capability": "edit",
      "resource": "ticket"
     },
     "scope": [
      "ticketKey"
     ],
     "confirm": "always",
     "pages": [
      "ticket-panel",
      "work-board"
     ],
     "description": "Change fields of one ticket that you can edit, the assignee included. The person confirms the exact change first."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/TicketPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The ticket after the change; ETag carries the new version; meta.warnings may hold ticket.stage_hidden_from_clients.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketDetail"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/acceptance-criteria": {
   "get": {
    "operationId": "listAcceptanceCriteria",
    "summary": "The ticket's acceptance criteria in their order, with \"N of M met\"",
    "x-feature": "F-WRK-39",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The rows, the summary and whether the reader may change the list.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/AcceptanceCriteriaList"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addAcceptanceCriterion",
    "summary": "Add one criterion at the end of the list or after another criterion",
    "x-feature": "F-WRK-39",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AcceptanceCriterionCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new criterion. `ETag` is its version.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AcceptanceCriterionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/acceptance-criteria/batch": {
   "post": {
    "operationId": "addAcceptanceCriteria",
    "summary": "Add the lines of a paste as criteria, in their order",
    "x-feature": "F-WRK-39",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AcceptanceCriteriaBatchRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The new criteria in their order.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "minItems": 1,
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/AcceptanceCriterionView"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/activity": {
   "get": {
    "operationId": "listTicketActivity",
    "summary": "One ticket's activity, newest first, 20 per page",
    "x-feature": "F-WRK-24",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Entries.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/ActivityEntry"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/approval-requests": {
   "get": {
    "operationId": "getTicketApprovals",
    "summary": "The ticket's approval panel — the open request, the history and what the caller may do",
    "x-feature": "F-POR-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The open request (absent when none), up to 50 earlier requests and the caller's can.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ApprovalPanelView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "requestApproval",
    "summary": "Request a client decision on the ticket's exact current subject",
    "x-feature": "F-POR-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalDraft"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The open request.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ApprovalRequestView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/approval-requests/validate": {
   "post": {
    "operationId": "validateApprovalRequest",
    "summary": "Dry run — eligible reviewers, the subject that would be bound and the client version",
    "x-feature": "F-POR-13",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The validation; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ApprovalDraftValidation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/attachments": {
   "get": {
    "operationId": "listTicketAttachments",
    "summary": "The ticket's attachments (comment files included) with Files' live status",
    "x-feature": "F-WRK-19",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Attachments, oldest first, 100 per page; meta.counts holds total and shared.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/AttachmentView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page",
            "counts"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            },
            "counts": {
             "type": "object",
             "required": [
              "total",
              "shared"
             ],
             "properties": {
              "total": {
               "type": "integer",
               "minimum": 0
              },
              "shared": {
               "type": "integer",
               "minimum": 0
              }
             }
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "attachFileToTicket",
    "summary": "Attach an uploaded file to the ticket (Internal by default)",
    "x-feature": "F-WRK-19",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AttachmentCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The attachment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/AttachmentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/children": {
   "get": {
    "operationId": "listTicketChildren",
    "summary": "A ticket's direct children in rank order, 50 per page",
    "x-feature": "F-WRK-31",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Children; links.next for the next page.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/TicketChildRow"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/client-visibility": {
   "put": {
    "operationId": "setTicketClientVisibility",
    "summary": "Switch Client visible for the client version the consequence showed",
    "x-feature": "F-WRK-18",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ClientVisibilityRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The ticket; meta.warnings may hold ticket.approval_hidden or ticket.stage_hidden_from_clients.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketDetail"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 3,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/client-visibility/consequence": {
   "get": {
    "operationId": "getTicketExposureConsequence",
    "summary": "What clients would see and what switching off would hide, for the current client version",
    "x-feature": "F-WRK-18",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The consequence.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketExposureConsequence"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/comments": {
   "get": {
    "operationId": "listTicketComments",
    "summary": "Comments of both threads (filter[thread]) oldest first",
    "x-feature": "F-WRK-21",
    "x-audience": "public",
    "x-assistant": {
     "tool": "list_ticket_comments",
     "kind": "read",
     "requires": {
      "scope": "resource",
      "capability": null,
      "resource": "ticket"
     },
     "scope": [
      "ticketKey"
     ],
     "confirm": "never",
     "pages": [
      "ticket-panel"
     ],
     "description": "Read the comments of one ticket that you can see, in the threads that you can read."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "filter[thread]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "internal",
        "client"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of at most 100 comments, oldest first; links.next names the later page while one exists (XM-689).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/CommentView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "postTicketComment",
    "summary": "Post a comment in the internal or the client thread, with files that follow the thread",
    "x-feature": "F-WRK-21",
    "x-audience": "public",
    "x-assistant": {
     "tool": "post_ticket_comment",
     "kind": "write",
     "requires": {
      "scope": "resource",
      "capability": "comment",
      "resource": "ticket"
     },
     "scope": [
      "ticketKey"
     ],
     "confirm": "always",
     "pages": [
      "ticket-panel"
     ],
     "description": "Post a comment on one ticket that you can comment on. Arguments: {\"ticketKey\":\"…\",\"body\":{\"thread\":\"internal\",\"body\":{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"…\"}]}]}}}; thread is \"internal\" (your team only) or \"client\" (the client sees it). The person confirms."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CommentCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The comment.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CommentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/description/collab-sessions": {
   "post": {
    "operationId": "openDescriptionSession",
    "summary": "Open a live session (write or watch) of a ticket's description and receive a short-lived token for the collaboration server",
    "x-feature": "F-WRK-25",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DocSessionRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The grant; mode may be narrower than requested, with the reason.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketSessionGrant"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/description/collab-sessions/{sessionId}/renew": {
   "post": {
    "operationId": "renewDescriptionSession",
    "summary": "Re-decide access to a ticket description's live session and receive a fresh single-use token with the current mode",
    "x-feature": "F-WRK-25",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/DocSessionIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "A fresh grant; the mode may be narrower than before.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketSessionGrant"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/duplicate": {
   "post": {
    "operationId": "duplicateTicket",
    "summary": "Make a copy of the ticket in the same project or in another project (XM-1108; F-WRK-16.R15–R22)",
    "x-feature": "F-WRK-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketCopyRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The copy, through the caller's mask; copiedFrom names the source.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketDetail"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/history": {
   "get": {
    "operationId": "listTicketHistory",
    "summary": "The ticket's recorded changes that the caller may see, newest first, 50 per page",
    "x-feature": "F-WRK-36",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "field",
      "in": "query",
      "required": false,
      "description": "A comma list of history fields.",
      "schema": {
       "type": "string",
       "maxLength": 400
      }
     },
     {
      "name": "actorKind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 80
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "A page of entries.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TicketHistoryPage"
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/history/entries/{entryId}/redaction": {
   "post": {
    "operationId": "redactTicketHistoryValue",
    "summary": "Redact the inline text of one side of a history entry (an Admin only); the text is replaced by a notice",
    "x-feature": "F-WRK-36",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "entryId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "side"
        ],
        "additionalProperties": false,
        "properties": {
         "side": {
          "type": "string",
          "enum": [
           "before",
           "after"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The entry with the redacted side.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketHistoryEntryView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/history/text-revisions/{revisionId}": {
   "get": {
    "operationId": "getTicketTextRevision",
    "summary": "One kept version of the ticket's description or long-text field",
    "x-feature": "F-WRK-36",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/TextRevisionIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The revision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TextRevisionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/history/text-revisions/{revisionId}/redaction": {
   "post": {
    "operationId": "redactTicketTextRevision",
    "summary": "Redact one kept text revision (an Admin only); the text is replaced by a notice, and the audit holds who and when",
    "x-feature": "F-WRK-36",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/TextRevisionIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The redacted revision.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TextRevisionView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/merge-requests": {
   "get": {
    "operationId": "listTicketMergeRequests",
    "summary": "The merge requests linked to a ticket (read-only projection of Integrations' facts)",
    "x-feature": "F-WRK-20",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "Links, most recently changed first (at most 50), with the ticket's exact number of links and `more` when it has more than the listed ones — never a silent cut (XM-213; KDC-07). A reader whose mask hides merge requests gets an empty list, `total` 0 and `more` false.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "total",
          "more"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/MergeRequestLinkView"
           }
          },
          "total": {
           "type": "integer",
           "minimum": 0,
           "description": "The ticket's linked merge requests in all, as Integrations reports them (XM-213)."
          },
          "more": {
           "type": "boolean",
           "description": "True when `total` exceeds the links listed (KDC-07)."
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/move": {
   "post": {
    "operationId": "moveTicketToProject",
    "summary": "Move the ticket to another project — a copy in the target and the trash of the source (XM-1108; F-WRK-16.R15–R22)",
    "x-feature": "F-WRK-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketCopyRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The copy in the target project, through the caller's mask; copiedFrom names the source (kind move).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketDetail"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/opportunities": {
   "get": {
    "operationId": "listTicketOpportunities",
    "summary": "The opportunities whose Build decision links this ticket — the ticket panel's back-link",
    "x-feature": "F-DSC-04",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "ticketKey",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/TicketKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Up to 10 linking opportunities, newest decision first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 10,
           "items": {
            "$ref": "#/components/schemas/TicketOpportunityLink"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/parent": {
   "put": {
    "operationId": "setTicketParent",
    "summary": "Set, change or remove a ticket's parent",
    "x-feature": "F-WRK-31",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ParentChangeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The ticket's hierarchy summary and new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "key",
            "hierarchy",
            "version"
           ],
           "properties": {
            "key": {
             "$ref": "#/components/schemas/TicketKey"
            },
            "hierarchy": {
             "$ref": "#/components/schemas/HierarchySummary"
            },
            "version": {
             "type": "integer",
             "minimum": 1
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/position": {
   "put": {
    "operationId": "placeTicket",
    "summary": "Move, reorder, plan or unplan a ticket by neighbours (positional; an optional If-Match, idempotent)",
    "x-feature": "F-WRK-03",
    "x-audience": "public",
    "x-assistant": {
     "tool": "move_ticket",
     "kind": "write",
     "requires": {
      "scope": "resource",
      "capability": "changeStatus",
      "resource": "ticket"
     },
     "scope": [
      "ticketKey"
     ],
     "confirm": "always",
     "pages": [
      "work-board",
      "ticket-panel"
     ],
     "description": "Change the status (stage) of one ticket: body.stageId is a stage of its project (get_project lists them); a done stage may take body.resolution. Only stageId and resolution, never a sprint. Call it at once: Youniton shows the card that the person confirms; never ask for a yes in words."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "If-Match",
      "in": "header",
      "required": false,
      "description": "OPTIONAL (R15; register §212; XM-857): the ticket's version in quotes. A different version answers 412 stale-version with currentVersion, and nothing moves; absent compares nothing.",
      "schema": {
       "type": "string",
       "pattern": "^\"[0-9]+\"$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketPlacementRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new placement; ETag carries the version; meta.warnings may hold stage.wip_limit_exceeded and, for a sharing manager who moved a client-visible ticket into a stage hidden from clients, ticket.stage_hidden_from_clients (F-WRK-16.R09).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketPlacementResult"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 3,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/presence": {
   "post": {
    "operationId": "relayTicketPresence",
    "summary": "Relay one content-free activity signal on the ticket's presence channel (F-WRK-37)",
    "description": "Published to the others on the ticket's presence channel (`toOthers()` with `X-Socket-ID`) as the Pusher event `presence`; never stored. One signal per person per ticket in 2 s; an `idle` that ends an activity is exempt.",
    "x-feature": "F-WRK-37",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "X-Socket-ID",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^[0-9]{1,20}\\.[0-9]{1,20}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketPresenceSignal"
       }
      }
     }
    },
    "responses": {
     "204": {
      "description": "Relayed, or nothing to end."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/realtime": {
   "get": {
    "operationId": "getTicketPresenceChannel",
    "summary": "The ticket's presence channel, with the project's audience epoch (F-WRK-37)",
    "description": "`presence-tenant.{t}.project.{p}.ticket.{ticket}.v{n}.a{m}` (R03a). The SPA reads it when it opens the ticket panel and again on `channels.rotated`. Internal readers of the ticket only; anyone else 404.",
    "x-feature": "F-WRK-37",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The channel to join.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "presenceChannel"
           ],
           "properties": {
            "presenceChannel": {
             "$ref": "#/components/schemas/PresenceChannelName"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/relations": {
   "get": {
    "operationId": "listTicketRelations",
    "summary": "The ticket's relations that the caller can see, grouped by phrase",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The groups.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketRelationGroupsView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "addTicketRelation",
    "summary": "Link this ticket to another ticket with a relation kind and a direction",
    "x-feature": "F-WRK-33",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketRelationCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The relation as this ticket reads it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketRelationView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "description": "A problem (application/problem+json); the code names the reason. `ticket_relation.graph_busy` has `Retry-After`.",
      "headers": {
       "Retry-After": {
        "description": "With `ticket_relation.graph_busy` only. Seconds until the same request can go again with the same `Idempotency-Key`.",
        "schema": {
         "type": "integer",
         "minimum": 1
        }
       }
      },
      "content": {
       "application/problem+json": {
        "schema": {
         "$ref": "#/components/schemas/Problem"
        }
       }
      }
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/resolution": {
   "put": {
    "operationId": "setTicketResolution",
    "summary": "Set the resolution of a ticket in a done stage — completed, cancelled or duplicate",
    "x-feature": "F-PRJ-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "If-Match",
      "in": "header",
      "required": false,
      "description": "OPTIONAL (fix round 24 Nov 2026, F1, the lost updates; as placeTicket, XM-857): the ticket's version in quotes. A different version answers 412 stale-version, and nothing changes; absent compares nothing.",
      "schema": {
       "type": "string",
       "pattern": "^\"[0-9]+\"$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketResolutionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The ticket's resolution and new version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "key",
            "resolution",
            "version"
           ],
           "properties": {
            "key": {
             "$ref": "#/components/schemas/TicketKey"
            },
            "resolution": {
             "$ref": "#/components/schemas/TicketResolutionView"
            },
            "version": {
             "type": "integer",
             "minimum": 1
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/restore": {
   "post": {
    "operationId": "restoreTicket",
    "summary": "Restore a trashed ticket within the retention",
    "x-feature": "F-WRK-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The restored ticket; meta.warnings may hold ticket.stage_hidden_from_clients.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketDetail"
          },
          "meta": {
           "type": "object",
           "properties": {
            "warnings": {
             "type": "array",
             "maxItems": 5,
             "items": {
              "$ref": "#/components/schemas/Warning"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/sprint": {
   "put": {
    "operationId": "moveTicketToSprint",
    "summary": "Move one ticket into an open sprint or back to the backlog (a wrapper of placeTicket with sprint only; If-Match)",
    "x-feature": "F-WRK-07",
    "x-audience": "public",
    "x-assistant": {
     "tool": "move_ticket_to_sprint",
     "kind": "write",
     "requires": {
      "scope": "resource",
      "capability": "plan",
      "resource": "ticket"
     },
     "scope": [
      "ticketKey"
     ],
     "confirm": "always",
     "pages": [],
     "description": "Move one ticket into an open sprint of its project (an id of list_sprints) or back to the backlog (null). The person confirms first."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TicketSprintMoveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The new placement, as placeTicket answers it; ETag carries the version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketPlacementResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/type-change": {
   "post": {
    "operationId": "changeTicketType",
    "summary": "Change the ticket's type with the chosen parent and children dispositions, in one step",
    "x-feature": "F-WRK-32",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TypeChangeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TypeChangeResult"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/type-change-preview": {
   "get": {
    "operationId": "previewTicketTypeChange",
    "summary": "What a change of the ticket's type would do, for the caller",
    "x-feature": "F-WRK-32",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "typeKey",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/TicketTypeKey"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The preview.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TypeChangePreview"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/watchers": {
   "get": {
    "operationId": "listTicketWatchers",
    "summary": "The watchers of the ticket — the reporter, the other members who watch, the caller's state (XM-1102; F-WRK-16.R23–R27)",
    "x-feature": "F-WRK-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The Watchers row of the panel.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketWatchersView"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/watchers/{memberId}": {
   "put": {
    "operationId": "watchTicket",
    "summary": "The member watches the ticket — the caller (\"Watch ticket\", view) or another member (edit); idempotent by state (XM-1102; F-WRK-16.R24–R26)",
    "x-feature": "F-WRK-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "description": "A member id, or me for the caller (XM-1648; R27).",
      "schema": {
       "oneOf": [
        {
         "$ref": "#/components/schemas/Uuid"
        },
        {
         "type": "string",
         "enum": [
          "me"
         ]
        }
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The watchers after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketWatchersView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "unwatchTicket",
    "summary": "The member stops watching the ticket — the reporter is then muted; idempotent by state (XM-1102; F-WRK-16.R24, R26)",
    "x-feature": "F-WRK-16",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "name": "memberId",
      "in": "path",
      "required": true,
      "description": "A member id, or me for the caller (XM-1648; R27).",
      "schema": {
       "oneOf": [
        {
         "$ref": "#/components/schemas/Uuid"
        },
        {
         "type": "string",
         "enum": [
          "me"
         ]
        }
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The watchers after the change.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketWatchersView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/tickets/{ticketKey}/worklogs": {
   "get": {
    "operationId": "getTicketTime",
    "summary": "The ticket's Time section — total and the entries the reader may read",
    "x-feature": "F-TIM-07",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/TicketKeyPath"
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Entry count, total and entries newest first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TicketTime"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/categories": {
   "get": {
    "operationId": "listTimeCategories",
    "summary": "The tenant's non-ticket categories (active first, then archived for Admins)",
    "x-feature": "F-TIM-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Categories in their order.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TimeCategoryRef"
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "put": {
    "operationId": "replaceTimeCategories",
    "summary": "Save the category list — add, rename, reorder, archive",
    "x-feature": "F-TIM-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "array",
        "minItems": 1,
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/TimeCategoryInput"
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The saved list.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TimeCategoryRef"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/logging-periods": {
   "get": {
    "operationId": "listLoggingPeriods",
    "summary": "The logging periods of a range in the reader's Team timesheets reach (every state)",
    "x-feature": "F-TIM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "On or after `from`; the range is at most 400 days.",
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The periods that overlap the range, in start order.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/LoggingPeriods"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "post": {
    "operationId": "closeLoggingPeriod",
    "summary": "Close a logging period now, or announce its close for a date (a holder of close_logging_periods, inside the reach)",
    "x-feature": "F-TIM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "If-Match",
      "in": "header",
      "required": false,
      "description": "The version of the existing period of this kind, start and scope; a different version is `412`.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LoggingPeriodCloseRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The period, closed or announced. The change is audited (`time.logging_period_closed` or `time.logging_period_announced`).",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/LoggingPeriodView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/logging-periods/history": {
   "get": {
    "operationId": "listLoggingPeriodHistory",
    "summary": "The announcements, closes and reopens of the logging periods in the reach, newest first (a holder of close_logging_periods)",
    "x-feature": "F-TIM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of 50 rows; `meta.nextCursor` reads the next page.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/LoggingPeriodHistory"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/logging-periods/{periodId}/reopen": {
   "post": {
    "operationId": "reopenLoggingPeriod",
    "summary": "Reopen a closed logging period with a reason",
    "x-feature": "F-TIM-13",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "periodId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "reason"
        ],
        "properties": {
         "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The period, reopened. The reopen is audited with its reason (`time.logging_period_reopened`).",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/LoggingPeriodView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/on-behalf-log": {
   "get": {
    "operationId": "listOnBehalfLog",
    "summary": "The time written on behalf of the people in the reader's Team timesheets or on-behalf reach, newest first, 50 a page",
    "x-feature": "F-TIM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "On or after `from`; the range is at most 400 days.",
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "The `meta.nextCursor` of the previous page.",
      "schema": {
       "type": "string",
       "maxLength": 512
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of rows.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OnBehalfLog"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/on-behalf/people": {
   "get": {
    "operationId": "listOnBehalfPeople",
    "summary": "The people of the actor's log_time_on_behalf reach for the \"For\" field, by name, 20 a page",
    "x-feature": "F-TIM-14",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "description": "A part of the name, in any case.",
      "schema": {
       "type": "string",
       "maxLength": 100
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "The `meta.nextCursor` of the previous page.",
      "schema": {
       "type": "string",
       "maxLength": 4
      }
     }
    ],
    "responses": {
     "200": {
      "description": "One page of people.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/OnBehalfPeople"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/periods/{date}": {
   "get": {
    "operationId": "getWeekGrid",
    "summary": "The timesheet period containing the date — the member's worklog grid across projects",
    "x-feature": "F-TIM-01",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "date",
      "in": "path",
      "required": true,
      "description": "Any date of the wanted period (the catalogue's periodStart is accepted as such).",
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "memberId",
      "in": "query",
      "required": false,
      "description": "Another member's grid, for approvers and all-entries viewers.",
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The period with rows, totals, capacity and the member's timesheets of the period.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WeekGrid"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/project-totals": {
   "get": {
    "operationId": "getProjectTotals",
    "summary": "The reader's projects with a time level, with the minutes and the billable minutes of a period that the level lets the reader read",
    "x-feature": "F-TIM-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "On or after `from`; the period is at most 42 days.",
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The projects (F-TIM-12.R09). A reader with no time level gets no project; a client guest gets 404 (not a guest route).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectTotals"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/projects": {
   "get": {
    "operationId": "listTimeProjects",
    "summary": "The projects where the member may log time (R11), by key, a cursor page with the total",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      }
     },
     {
      "name": "page[size]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 20
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of the projects by key; meta.total counts all that match q; links.next while more remain.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TimeProjectRef"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "size",
            "hasMore",
            "total",
            "truncated"
           ],
           "properties": {
            "size": {
             "type": "integer",
             "minimum": 1,
             "maximum": 100
            },
            "hasMore": {
             "type": "boolean"
            },
            "total": {
             "type": "integer",
             "minimum": 0,
             "description": "The loggable projects that match q, on all pages."
            },
            "truncated": {
             "type": "boolean",
             "description": "The same as hasMore (more pages remain; KDC-07)."
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/time/settings": {
   "get": {
    "operationId": "getTimeSettings",
    "summary": "The Time settings in force, any pending version and the next period boundary",
    "x-feature": "F-TIM-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "The settings; ETag carries the settings version.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimeSettingsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "put": {
    "operationId": "changeTimeSettings",
    "summary": "Change Time settings — period-bound keys from the next boundary, the others at once",
    "x-feature": "F-TIM-11",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TimeSettingsUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The settings with the pending version, its effective date and any transition period.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimeSettingsView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/settings/validate": {
   "post": {
    "operationId": "validateTimeSettings",
    "summary": "Dry run — the boundary, the transition period and the consequence sentences of a change",
    "x-feature": "F-TIM-11",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TimeSettingsUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The consequences; nothing was written.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SettingsValidation"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/team-timesheets": {
   "get": {
    "operationId": "getTeamTimesheets",
    "summary": "The people of the reader's Team timesheets reach for a period, with minutes per day, the billable split and the status",
    "x-feature": "F-TIM-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "On or after `from`; the period is at most 42 days.",
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "groupBy",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "team",
        "project",
        "client"
       ],
       "default": "team"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Each person of the reach once, by name. Every read writes the audit record `time.team_timesheets_read`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TeamTimesheets"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/team-timesheets/entries": {
   "get": {
    "operationId": "listTeamTimesheetEntries",
    "summary": "One person's worklogs of the period (a person of the reader's reach), newest first, 100 a page",
    "x-feature": "F-TIM-12",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "memberId",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "The entries; each drill-down writes the audit record `time.team_timesheets_read`.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/TeamTimesheetEntry"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/time/ticket-candidates": {
   "get": {
    "operationId": "listTimeTicketCandidates",
    "summary": "Tickets the member may log time on, for the Log time picker (at most 20)",
    "x-feature": "F-TIM-02",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 120
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matching tickets, or recently logged ones for an empty query.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 20,
           "items": {
            "$ref": "#/components/schemas/TimeTicketCandidate"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   }
  },
  "/timesheets": {
   "get": {
    "operationId": "listTimesheets",
    "summary": "Timesheets by member, project, state and period — the Approvals panel and approval queues",
    "x-feature": "F-TIM-04",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter",
      "in": "query",
      "required": false,
      "style": "deepObject",
      "explode": true,
      "description": "filter[memberId]=me|<id>, filter[projectKey], filter[state]=draft,submitted,approved,returned, filter[periodFrom], filter[periodTo].",
      "schema": {
       "type": "object",
       "properties": {
        "memberId": {
         "type": "string",
         "maxLength": 36
        },
        "projectKey": {
         "type": "string",
         "maxLength": 10
        },
        "state": {
         "type": "string",
         "maxLength": 40
        },
        "periodFrom": {
         "$ref": "#/components/schemas/DateOnly"
        },
        "periodTo": {
         "$ref": "#/components/schemas/DateOnly"
        }
       }
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Timesheets, newest period first.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/TimesheetView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/timesheets/export": {
   "post": {
    "operationId": "exportTimesheets",
    "summary": "Export the visible worklogs of a range as CSV — streamed up to 100,000 rows, otherwise an operation",
    "x-feature": "F-TIM-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TimesheetExportRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The CSV file (Content-Disposition attachment), UTF-8 with a byte-order mark.",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "202": {
      "description": "A large export runs as an operation; Location points to it.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Operation"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/timesheets/{timesheetId}": {
   "get": {
    "operationId": "getTimesheet",
    "summary": "One timesheet, with its revisions and decisions on include=revisions",
    "x-feature": "F-TIM-04",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "timesheetId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "revisions"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The timesheet and, when asked, its history.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimesheetDetail"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/timesheets/{timesheetId}/approve": {
   "post": {
    "operationId": "approveTimesheet",
    "summary": "Approve the named (latest) revision of a submitted timesheet",
    "x-feature": "F-TIM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "timesheetId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "revision"
        ],
        "properties": {
         "revision": {
          "type": "integer",
          "minimum": 1
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The approved timesheet.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimesheetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/timesheets/{timesheetId}/reopen": {
   "post": {
    "operationId": "reopenTimesheet",
    "summary": "Reopen one member's submitted or approved timesheet for filling, with a reason",
    "x-feature": "F-TIM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "timesheetId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "reason"
        ],
        "properties": {
         "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The timesheet, Draft again, with its history kept.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimesheetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/timesheets/{timesheetId}/return": {
   "post": {
    "operationId": "returnTimesheet",
    "summary": "Return a submitted timesheet to its member with a note",
    "x-feature": "F-TIM-05",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "timesheetId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "note"
        ],
        "properties": {
         "note": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The returned timesheet.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimesheetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/timesheets/{timesheetId}/submit": {
   "post": {
    "operationId": "submitTimesheet",
    "summary": "Submit the sheet for approval, freezing a revision",
    "x-feature": "F-TIM-04",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "timesheetId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The sheet, Submitted, with its new revision number.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimesheetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/timesheets/{timesheetId}/withdraw": {
   "post": {
    "operationId": "withdrawTimesheet",
    "summary": "The member takes back a submission before any decision",
    "x-feature": "F-TIM-04",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "timesheetId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "revision"
        ],
        "additionalProperties": false,
        "properties": {
         "revision": {
          "type": "integer",
          "minimum": 1,
          "description": "The submitted revision being withdrawn (the latest)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The sheet, Draft again, with the withdrawal in its decisions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/TimesheetView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/upload-intents": {
   "post": {
    "operationId": "startUpload",
    "summary": "Authorise an upload to a target, reserve its quota and answer a presigned PUT or multipart parameters",
    "x-feature": "F-FIL-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UploadIntentRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The pending file with its upload instructions.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/UploadIntentView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/upload-intents/{fileId}/complete": {
   "post": {
    "operationId": "completeUpload",
    "summary": "Complete the upload — the server completes multipart, verifies the size, detects the type and starts the scan",
    "x-feature": "F-FIL-01",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     },
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UploadCompleteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The file, now scanning.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/StoredFileView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/upload-intents/{fileId}/sign": {
   "post": {
    "operationId": "signUploadOperation",
    "summary": "Sign one multipart operation (create, part, abort) for the file's own staging key",
    "x-feature": "F-FIL-01",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "fileId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UploadSignRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The signed request, valid 15 minutes.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SignedRequestView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/views/{view}/default": {
   "put": {
    "operationId": "saveWorkspaceViewDefault",
    "summary": "Save the workspace default of a workspace view (administer; audited)",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/WorkspaceViewKindPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ViewDefaultDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "resetWorkspaceViewDefault",
    "summary": "Reset the workspace default of a workspace view to the system default (administer; audited)",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/WorkspaceViewKindPath"
     }
    ],
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/views/{view}/preference": {
   "put": {
    "operationId": "saveWorkspaceViewPreference",
    "summary": "Save the caller's display preference of a workspace view (My tickets, Projects)",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/WorkspaceViewKindPath"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ViewPreferenceDraft"
       }
      }
     }
    },
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "resetWorkspaceViewPreference",
    "summary": "Reset the caller's display preference of a workspace view",
    "x-feature": "F-WRK-41",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "$ref": "#/components/parameters/WorkspaceViewKindPath"
     }
    ],
    "responses": {
     "200": {
      "$ref": "#/components/responses/ViewPreferenceAnswer"
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/webhook-endpoints": {
   "get": {
    "operationId": "listWebhookEndpoints",
    "summary": "The tenant's webhook endpoints (never their secrets)",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Endpoints.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/WebhookEndpointView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "pendingDeliveries"
           ],
           "properties": {
            "pendingDeliveries": {
             "type": "integer",
             "minimum": 0,
             "description": "A13 (XM-1298, G-AUA-28): the tenant's deliveries still pending or retrying — while webhooks are off, the ones that will not be sent."
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     }
    }
   },
   "post": {
    "operationId": "createWebhookEndpoint",
    "summary": "Register an HTTPS endpoint; the answer carries its secret once",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEndpointInput"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created; the secret is shown once.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WebhookEndpointSecretView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/webhook-endpoints/{endpointId}": {
   "patch": {
    "operationId": "changeWebhookEndpoint",
    "summary": "Rename, repoint, open or close to project rules, pause, resume or disable an endpoint",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/WebhookEndpointIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WebhookEndpointInput"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Changed.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WebhookEndpointView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "deleteWebhookEndpoint",
    "summary": "Delete an endpoint no rule names; pending deliveries are suppressed",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/WebhookEndpointIdPath"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     }
    ],
    "responses": {
     "204": {
      "description": "Deleted (or already deleted)."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/webhook-endpoints/{endpointId}/deliveries": {
   "get": {
    "operationId": "listWebhookEndpointDeliveries",
    "summary": "The endpoint's delivery log, newest first",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/WebhookEndpointIdPath"
     },
     {
      "name": "filter[status]",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "pending",
        "delivered",
        "retrying",
        "failed",
        "abandoned",
        "suppressed"
       ]
      }
     },
     {
      "name": "filter[source]",
      "in": "query",
      "required": false,
      "description": "Keeps the deliveries of one kind of source (CFL-534).",
      "schema": {
       "type": "string",
       "enum": [
        "automation_run",
        "help_desk_connection"
       ]
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "One page of deliveries (50).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data",
          "meta"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 50,
           "items": {
            "$ref": "#/components/schemas/OutboundDeliveryView"
           }
          },
          "meta": {
           "type": "object",
           "required": [
            "page"
           ],
           "properties": {
            "page": {
             "$ref": "#/components/schemas/CursorPageMeta"
            }
           }
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/webhook-endpoints/{endpointId}/rotate-secret": {
   "post": {
    "operationId": "rotateWebhookEndpointSecret",
    "summary": "Rotate the secret; the previous one keeps signing for 24 hours; the new one is shown once",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/WebhookEndpointIdPath"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "responses": {
     "200": {
      "description": "Rotated.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WebhookEndpointSecretView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/webhook-endpoints/{endpointId}/test": {
   "post": {
    "operationId": "sendWebhookEndpointTest",
    "summary": "Send a signed test event now (never retried)",
    "x-feature": "F-AUT-10",
    "x-audience": "spa",
    "x-idempotency": "exempt",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/WebhookEndpointIdPath"
     }
    ],
    "responses": {
     "200": {
      "description": "The test outcome.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "object",
           "required": [
            "outcome"
           ],
           "properties": {
            "outcome": {
             "type": "string",
             "enum": [
              "delivered",
              "failed",
              "refused"
             ]
            },
            "statusCode": {
             "type": "integer",
             "minimum": 100,
             "maximum": 599
            },
            "reason": {
             "type": "string",
             "maxLength": 60
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "429": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/worklogs": {
   "post": {
    "operationId": "logTime",
    "summary": "Log time for the signed-in member on a ticket or a category",
    "x-feature": "F-TIM-02",
    "x-audience": "public",
    "x-assistant": {
     "tool": "log_time",
     "kind": "write",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "always",
     "pages": [
      "time",
      "ticket-panel"
     ],
     "description": "Log your own time on a ticket or a category, for example \"log 2h on ORB-146 today\": ticketKey ORB-146, workedOn today's date, duration 2h. The person confirms the exact entry first."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IdempotencyKeyHeader"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WorklogCreateRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "The worklog with its timesheet.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorklogView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "get": {
    "operationId": "listWorklogs",
    "summary": "The worklogs behind one grid cell (member, date and row), or the caller's worklogs of a range of dates",
    "x-feature": "F-TIM-03",
    "x-audience": "public",
    "x-assistant": {
     "tool": "list_my_worklogs",
     "kind": "read",
     "requires": {
      "scope": "tenant",
      "capability": null
     },
     "scope": [],
     "confirm": "never",
     "pages": [
      "time"
     ],
     "description": "Read your own time entries from filter.from to filter.to (dates, at most 62 days): each entry's id, ticket, date, minutes and note."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "filter",
      "in": "query",
      "required": true,
      "style": "deepObject",
      "explode": true,
      "description": "A range (F-TIM-03.R11): filter[from] and filter[to], both included, at most 62 days, the caller's own worklogs only (filter[memberId] absent or me); no filter[date] and no row with a range. A cell: filter[memberId] (default me), filter[date], filter[ticketKey] or filter[categoryId] with filter[projectKey].",
      "schema": {
       "type": "object",
       "properties": {
        "memberId": {
         "type": "string",
         "maxLength": 36
        },
        "date": {
         "$ref": "#/components/schemas/DateOnly"
        },
        "ticketKey": {
         "type": "string",
         "maxLength": 30
        },
        "categoryId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "projectKey": {
         "type": "string",
         "maxLength": 10
        },
        "from": {
         "$ref": "#/components/schemas/DateOnly"
        },
        "to": {
         "$ref": "#/components/schemas/DateOnly"
        }
       }
      }
     },
     {
      "$ref": "#/components/parameters/PageCursor"
     }
    ],
    "responses": {
     "200": {
      "description": "Worklogs oldest first with their affordances; a range in the order (date, start time with untimed entries last, id).",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/WorklogView"
           }
          },
          "meta": {
           "$ref": "#/components/schemas/CursorPageMeta"
          },
          "links": {
           "$ref": "#/components/schemas/CursorLinks"
          }
         }
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  },
  "/worklogs/{worklogId}": {
   "get": {
    "operationId": "getWorklog",
    "summary": "One worklog as the caller reads it, with its ETag (G230 — the target read of the assistant's change and delete of an entry)",
    "x-feature": "F-TIM-03",
    "x-audience": "public",
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "name": "worklogId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The worklog; the ETag is its version.",
      "headers": {
       "ETag": {
        "schema": {
         "type": "string"
        }
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorklogView"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "patch": {
    "operationId": "editWorklog",
    "summary": "Change a worklog's duration, note, date within its period, or subject (another ticket, a category or another project — R12)",
    "x-feature": "F-TIM-03",
    "x-audience": "public",
    "x-assistant": {
     "tool": "edit_worklog",
     "kind": "write",
     "requires": {
      "scope": "resource",
      "capability": "edit",
      "resource": "worklog"
     },
     "scope": [
      "worklogId"
     ],
     "confirm": "always",
     "pages": [
      "time"
     ],
     "description": "Change one of your own time entries (duration, date or note); get its id from list_my_worklogs. Youniton shows the person a card to confirm: never ask for a yes in words."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "worklogId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/merge-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/WorklogPatch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The changed worklog.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "data"
         ],
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WorklogView"
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   },
   "delete": {
    "operationId": "clearWorklog",
    "summary": "Delete a worklog (clear)",
    "x-feature": "F-TIM-03",
    "x-audience": "public",
    "x-assistant": {
     "tool": "delete_worklog",
     "kind": "write",
     "requires": {
      "scope": "resource",
      "capability": "clear",
      "resource": "worklog"
     },
     "scope": [
      "worklogId"
     ],
     "confirm": "always",
     "pages": [
      "time"
     ],
     "description": "Delete one of your own time entries; get its id from list_my_worklogs. Youniton shows the person a card of the entry to confirm: never ask for a yes in words."
    },
    "parameters": [
     {
      "$ref": "#/components/parameters/TenantHeader"
     },
     {
      "$ref": "#/components/parameters/IfMatchHeader"
     },
     {
      "name": "worklogId",
      "in": "path",
      "required": true,
      "schema": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     {
      "name": "reason",
      "in": "query",
      "required": false,
      "description": "Required for an approver's change of a submitted sheet (1–500 characters).",
      "schema": {
       "type": "string",
       "maxLength": 500
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Cleared."
     },
     "403": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "404": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "409": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "412": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "422": {
      "$ref": "#/components/responses/ProblemResponse"
     },
     "428": {
      "$ref": "#/components/responses/ProblemResponse"
     }
    }
   }
  }
 },
 "components": {
  "parameters": {
   "AcceptanceCriterionIdPath": {
    "name": "criterionId",
    "in": "path",
    "required": true,
    "description": "A criterion of a ticket that the caller can view; otherwise one 404 (acceptance_criterion.not_found).",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "AgentIdentityIdPath": {
    "name": "identityId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "AiProviderScope": {
    "name": "scope",
    "in": "path",
    "required": true,
    "description": "`platform` for the platform default, else a tenant id.",
    "schema": {
     "type": "string",
     "maxLength": 36,
     "pattern": "^(platform|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
    }
   },
   "AssistEventsAfter": {
    "name": "after",
    "in": "query",
    "required": false,
    "description": "The last event sequence the client holds; SSE's Last-Event-ID carries the same value.",
    "schema": {
     "type": "integer",
     "minimum": 0
    }
   },
   "AssistLastEventId": {
    "name": "Last-Event-ID",
    "in": "header",
    "required": false,
    "schema": {
     "type": "string",
     "pattern": "^[0-9]{1,18}$"
    }
   },
   "AssistProposalIdPath": {
    "name": "proposal",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "AssistRunIdPath": {
    "name": "run",
    "in": "path",
    "required": true,
    "description": "The run id; unknown and not visible are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "AutomationRuleIdPath": {
    "name": "ruleId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "AutomationRunIdPath": {
    "name": "runId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "BoardSortQuery": {
    "name": "sort",
    "in": "query",
    "required": false,
    "description": "XM-708 (F-WRK-02.R12): the order of the cards in each column or lane cell — rank (the manual order), priority (High first), dueDate (earliest first, none last) or title (A–Z by the first 64 characters); each order ends with the rank. title needs Title and dueDate needs Due date in the reader's mask, else 400 query.invalid naming sort with title_not_visible or due_date_not_visible.",
    "schema": {
     "type": "string",
     "enum": [
      "rank",
      "priority",
      "dueDate",
      "title"
     ],
     "default": "rank"
    }
   },
   "CashInvoiceIdPath": {
    "name": "invoiceId",
    "in": "path",
    "required": true,
    "description": "An invoice's id of the simple list; a missing one is 404 (invoice.not_found).",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "ClientOrganisationIdPath": {
    "name": "organisationId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "ContactIdPath": {
    "name": "contactId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "ConversationIdPath": {
    "name": "conversationId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "CustomFieldIdPath": {
    "name": "fieldId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "DocCommentIdPath": {
    "name": "commentId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "DocPageIdPath": {
    "name": "pageId",
    "in": "path",
    "required": true,
    "description": "A doc page id; a hidden, foreign or (for readers without edit_docs) trashed page answers 404 doc_page.not_found.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "DocSessionIdPath": {
    "name": "sessionId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "DocSpaceIdPath": {
    "name": "spaceId",
    "in": "path",
    "required": true,
    "description": "A space id; a hidden, foreign or purged space answers 404 doc_space.not_found.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "DocTemplateIdPath": {
    "name": "templateId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "DocThreadIdPath": {
    "name": "threadId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "DocVersionNumberPath": {
    "name": "number",
    "in": "path",
    "required": true,
    "schema": {
     "type": "integer",
     "minimum": 1
    }
   },
   "ExpenseIdPath": {
    "name": "expenseId",
    "in": "path",
    "required": true,
    "description": "An expense's id; hidden and missing are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "ExpenseReceiptFileIdPath": {
    "name": "fileId",
    "in": "path",
    "required": true,
    "description": "A receipt file's id on this expense.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "FinanceMemberIdPath": {
    "name": "memberId",
    "in": "path",
    "required": true,
    "description": "A member's id; a member outside the tenant and a missing one are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "FlowApprovalIdPath": {
    "name": "approvalId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "HumanTaskIdPath": {
    "name": "taskId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "IdempotencyKeyHeader": {
    "name": "Idempotency-Key",
    "in": "header",
    "required": true,
    "description": "Durable command receipt key (05-api §7.2); the generated client sends one UUIDv7 per user intent.",
    "schema": {
     "type": "string",
     "minLength": 8,
     "maxLength": 128,
     "pattern": "^[A-Za-z0-9._:-]+$"
    }
   },
   "IfMatchHeader": {
    "name": "If-Match",
    "in": "header",
    "required": true,
    "description": "The resource version in quotes (05-api §7.1); missing answers 428, different answers 412.",
    "schema": {
     "type": "string",
     "pattern": "^\"[0-9]+\"$"
    }
   },
   "InboundEndpointIdPath": {
    "name": "endpointId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "KnowledgeItemKeyPath": {
    "name": "itemKey",
    "in": "path",
    "required": true,
    "description": "A knowledge item key, upper-cased and resolved through the project key aliases; hidden and missing are one 404.",
    "schema": {
     "$ref": "#/components/schemas/KnowledgeItemKey"
    }
   },
   "LabelIdPath": {
    "name": "labelId",
    "in": "path",
    "required": true,
    "description": "A label of the path's project; another project's or tenant's label is one 404 (label.not_found).",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "MemoryDirectoryIdPath": {
    "name": "directoryId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "MemoryEntryIdPath": {
    "name": "entryId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "MemoryEntryPathQuery": {
    "name": "path",
    "in": "query",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/MemoryEntryPathValue"
    }
   },
   "MemorySegmentKeyPath": {
    "name": "segmentKey",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/MemorySegmentKey"
    }
   },
   "MessageIdPath": {
    "name": "messageId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "OptionalIdempotencyKeyHeader": {
    "name": "Idempotency-Key",
    "in": "header",
    "required": false,
    "description": "G262: the same durable command receipt key on a DELETE that takes it optionally. With a key, a retry answers the stored status; without a key, the request runs as before.",
    "schema": {
     "type": "string",
     "minLength": 8,
     "maxLength": 128,
     "pattern": "^[A-Za-z0-9._:-]+$"
    }
   },
   "OptionalTenantHeader": {
    "name": "X-Kanso-Tenant",
    "in": "header",
    "required": false,
    "description": "The current tenant for /me operations that read or write membership-level fields (job title, default project, usability per tenant).",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "OutboundDeliveryIdPath": {
    "name": "deliveryId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "PageCursor": {
    "name": "page[cursor]",
    "in": "query",
    "required": false,
    "description": "The opaque cursor of the previous page's links.next (05-api §5).",
    "schema": {
     "type": "string",
     "maxLength": 512
    }
   },
   "ParticipantMemberIdPath": {
    "name": "memberId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "PlanVersionIdPath": {
    "name": "planVersionId",
    "in": "path",
    "required": true,
    "description": "A plan version's id; hidden and missing are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "PlatformCredentialKindPath": {
    "name": "kind",
    "in": "path",
    "required": true,
    "description": "A kind of the registry; any other text is `404 platform_credentials.kind_not_found`.",
    "schema": {
     "$ref": "#/components/schemas/PlatformCredentialKind"
    }
   },
   "ProjectKeyPath": {
    "name": "projectKey",
    "in": "path",
    "required": true,
    "description": "A project key, upper-cased and resolved through the key aliases (04 §5.3); hidden and missing are one 404.",
    "schema": {
     "type": "string",
     "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$",
     "example": "ORB"
    }
   },
   "ProjectViewKindPath": {
    "name": "view",
    "in": "path",
    "required": true,
    "description": "A project view (kebab-case segment). Another value is 404 view.not_found.",
    "schema": {
     "type": "string",
     "enum": [
      "backlog",
      "list",
      "epics",
      "help-desk-queue"
     ]
    }
   },
   "RateVersionIdPath": {
    "name": "rateVersionId",
    "in": "path",
    "required": true,
    "description": "A rate version's id; hidden and missing are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "RecoveryRequestId": {
    "name": "requestId",
    "in": "path",
    "required": true,
    "description": "An account-recovery request id.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "RelationKindKeyPath": {
    "name": "kindKey",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/TicketTypeKey"
    }
   },
   "ReportRunIdPath": {
    "name": "reportRunId",
    "in": "path",
    "required": true,
    "description": "A run's id; another reader's run and a missing one are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "ReportScheduleIdPath": {
    "name": "reportScheduleId",
    "in": "path",
    "required": true,
    "description": "A schedule's id; hidden and missing are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "RepositoryConnectionIdPath": {
    "name": "connectionId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "RowColumnsQuery": {
    "name": "columns",
    "in": "query",
    "required": false,
    "description": "XM-1110 (F-WRK-14.R13, F-WRK-06.R14): the Display-settings columns that the view shows, comma-separated, from the XM-943 list vocabulary (rank, type, epic, status, priority, assignee, reporter, due_date, start_date, estimate, points, labels, sprint, client_visible, created, updated). The rows answer the optional columns reporter, created (createdAt), updated (updatedAt) and sprint, and on a BacklogRow also start_date (startDate) and client_visible (clientVisible), only when the list names them. An unknown id or an empty item is 400 query.invalid at columns. The columns never change the rows.",
    "schema": {
     "type": "string",
     "minLength": 1,
     "maxLength": 200,
     "example": "reporter,sprint,created,updated"
    }
   },
   "SavedReportIdPath": {
    "name": "savedReportId",
    "in": "path",
    "required": true,
    "description": "A saved report's id; hidden and missing are one 404.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "SettingGroupPath": {
    "name": "group",
    "in": "path",
    "required": true,
    "description": "A settings group — a key without its last segment, or the group a key's placement names (`docs`, `portal.approvals`).",
    "schema": {
     "type": "string",
     "maxLength": 100,
     "pattern": "^[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$",
     "example": "work"
    }
   },
   "SharedLabelIdPath": {
    "name": "labelId",
    "in": "path",
    "required": true,
    "description": "A shared label of the tenant (F-WRK-22.R20); a project's label, another tenant's or a merged one is one 404 (label.not_found).",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "SpendingItemIdPath": {
    "name": "itemId",
    "in": "path",
    "required": true,
    "description": "A spending item's id; hidden and missing are one 404 (spending.not_found).",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "SpendingMonthPath": {
    "name": "month",
    "in": "path",
    "required": true,
    "description": "The month of a one-month amount (F-FIN-16.R23), `YYYY-MM`.",
    "schema": {
     "$ref": "#/components/schemas/YearMonth"
    }
   },
   "TenantHeader": {
    "name": "X-Kanso-Tenant",
    "in": "header",
    "required": true,
    "description": "The tenant id of the call (05-api §8.3); unknown, foreign or inactive answers 404 tenant.not_found.",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "TextRevisionIdPath": {
    "name": "revisionId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "TicketKeyPath": {
    "name": "ticketKey",
    "in": "path",
    "required": true,
    "description": "A ticket key, upper-cased and resolved through the project key aliases (04 §5.3); hidden and missing are one 404.",
    "schema": {
     "$ref": "#/components/schemas/TicketKey"
    }
   },
   "TicketListFilterQuery": {
    "name": "filter",
    "in": "query",
    "required": false,
    "style": "deepObject",
    "explode": true,
    "description": "The generic ticket list's filters (F-WRK-14.R09; XM-708) — the shared Work filters, filter[stageKind]=todo,in_progress, the due-date range filter[dueDate][gte]=2026-09-28&filter[dueDate][lte]=2026-11-01 (the Calendar, G-WK2-2) and filter[sprint]=active|none|<id>.",
    "schema": {
     "$ref": "#/components/schemas/TicketListFilterInput"
    }
   },
   "TicketRelationIdPath": {
    "name": "relationId",
    "in": "path",
    "required": true,
    "description": "A relation whose two tickets the caller can view; otherwise one 404 (ticket_relation.not_found).",
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "TicketTypeKeyPath": {
    "name": "typeKey",
    "in": "path",
    "required": true,
    "description": "A type key of the path's project; another project's type is one 404 (ticket_type.not_found).",
    "schema": {
     "$ref": "#/components/schemas/TicketTypeKey"
    }
   },
   "WebhookEndpointIdPath": {
    "name": "endpointId",
    "in": "path",
    "required": true,
    "schema": {
     "$ref": "#/components/schemas/Uuid"
    }
   },
   "WorkFilterQuery": {
    "name": "filter",
    "in": "query",
    "required": false,
    "style": "deepObject",
    "explode": true,
    "description": "The filters shared by the Work views (D-071) — filter[assigneeId]=me|none|<id> or a comma list of up to 100 of them (any of; XM-708), filter[clientVisible]=true, filter[epicId]=none|<id>, filter[priority]=high,medium, filter[due]=overdue|this_week|next_week|none — and custom-field filters filter[cf.<key>] with the type's operators (F-WRK-28; 05 §5). Since XM-1166 also the facet operators filter[stage|label|epicId|type][anyOf|allOf|noneOf|empty|notEmpty] with their negated keys not.<operator>, and filter[title][contains|not.contains].",
    "schema": {
     "$ref": "#/components/schemas/WorkFilterInput"
    }
   },
   "WorkSearchQuery": {
    "name": "q",
    "in": "query",
    "required": false,
    "description": "XM-708 (F-WRK-01.R11): the search text of the Work views (\"Find a ticket…\") — the key exactly or by prefix, the title \"contains\" from three characters (by prefix below). For a reader whose mask hides Title it matches the key only. 1–120 characters, else 400 query.invalid naming q.",
    "schema": {
     "type": "string",
     "minLength": 1,
     "maxLength": 120
    }
   },
   "WorkspaceViewKindPath": {
    "name": "view",
    "in": "path",
    "required": true,
    "description": "A workspace view (kebab-case segment). Another value is 404 view.not_found.",
    "schema": {
     "type": "string",
     "enum": [
      "my-tickets",
      "projects",
      "dashboard"
     ]
    }
   }
  },
  "responses": {
   "NotFound": {
    "description": "Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "ProblemResponse": {
    "description": "A problem (application/problem+json); the code names the reason.",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "TenantNotFound": {
    "description": "Missing, purged or hidden tenant (one neutral answer).",
    "content": {
     "application/problem+json": {
      "schema": {
       "$ref": "#/components/schemas/Problem"
      }
     }
    }
   },
   "ViewPreferenceAnswer": {
    "description": "The caller's effective preference after the write. ETag is the written resource's version (the caller's preference, or the default).",
    "headers": {
     "ETag": {
      "schema": {
       "type": "string"
      }
     }
    },
    "content": {
     "application/json": {
      "schema": {
       "type": "object",
       "required": [
        "data"
       ],
       "properties": {
        "data": {
         "$ref": "#/components/schemas/ViewPreference"
        }
       }
      }
     }
    }
   }
  },
  "schemas": {
   "AcceptanceCriteriaBatchRequest": {
    "type": "object",
    "required": [
     "criteria"
    ],
    "additionalProperties": false,
    "description": "A paste of several lines: one row for each line, in this order (R05).",
    "properties": {
     "criteria": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
       "type": "object",
       "required": [
        "text"
       ],
       "additionalProperties": false,
       "properties": {
        "text": {
         "$ref": "#/components/schemas/RichTextDocument"
        }
       }
      }
     },
     "after": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "AcceptanceCriteriaList": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/AcceptanceCriterionView"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "summary",
       "can"
      ],
      "properties": {
       "summary": {
        "$ref": "#/components/schemas/AcceptanceSummaryView"
       },
       "can": {
        "type": "object",
        "required": [
         "edit"
        ],
        "description": "`edit` on the ticket in an active project — the rule of every write (R02).",
        "properties": {
         "edit": {
          "type": "boolean"
         }
        }
       }
      }
     }
    }
   },
   "AcceptanceCriterionCreateRequest": {
    "type": "object",
    "required": [
     "text"
    ],
    "additionalProperties": false,
    "properties": {
     "text": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "after": {
      "description": "The criterion of the same ticket after which the new row goes; absent or null puts it at the end (R05).",
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "AcceptanceCriterionMetRequest": {
    "type": "object",
    "required": [
     "met"
    ],
    "additionalProperties": false,
    "properties": {
     "met": {
      "type": "boolean"
     }
    }
   },
   "AcceptanceCriterionPatch": {
    "type": "object",
    "required": [
     "text"
    ],
    "additionalProperties": false,
    "properties": {
     "text": {
      "$ref": "#/components/schemas/RichTextDocument"
     }
    }
   },
   "AcceptanceCriterionPositionRequest": {
    "type": "object",
    "required": [
     "after"
    ],
    "additionalProperties": false,
    "description": "The criterion of the same ticket after which this row goes; null puts it first (R07).",
    "properties": {
     "after": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "AcceptanceCriterionView": {
    "type": "object",
    "required": [
     "id",
     "text",
     "plainText",
     "position",
     "met",
     "mentions",
     "version"
    ],
    "description": "One criterion (F-WRK-39 §7). `metBy` and `metAt` are present only when the criterion is met. An erased or removed member who ticked it reads as the former member (R08).",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "text": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "plainText": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 199
     },
     "met": {
      "type": "boolean"
     },
     "metBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "metAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "mentions": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AcceptanceSummaryView": {
    "type": "object",
    "required": [
     "met",
     "total"
    ],
    "description": "\"N of M met\" (F-WRK-39.R09): the met criteria and all criteria of the ticket.",
    "properties": {
     "met": {
      "type": "integer",
      "minimum": 0,
      "maximum": 200
     },
     "total": {
      "type": "integer",
      "minimum": 0,
      "maximum": 200
     }
    }
   },
   "AccessExtensionPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "grant": {
      "$ref": "#/components/schemas/ExtensionGrant"
     },
     "projects": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "expiresAt": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Instant"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "AccessExtensionRequest": {
    "type": "object",
    "required": [
     "grant",
     "reason"
    ],
    "additionalProperties": false,
    "properties": {
     "grant": {
      "$ref": "#/components/schemas/ExtensionGrant"
     },
     "projects": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Reviews NOVA while Lena is on leave"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "AccessExtensionView": {
    "type": "object",
    "required": [
     "id",
     "grant",
     "reason",
     "state",
     "grantedBy",
     "grantedAt",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "grant": {
      "$ref": "#/components/schemas/ExtensionGrant"
     },
     "projects": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/NamedRef"
      }
     },
     "reason": {
      "type": "string",
      "maxLength": 200
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "state": {
      "type": "string",
      "enum": [
       "live",
       "revoked",
       "expired"
      ]
     },
     "grantedBy": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "grantedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AccessOperandView": {
    "type": "object",
    "required": [
     "attribute",
     "maintenance"
    ],
    "properties": {
     "attribute": {
      "type": "string",
      "enum": [
       "ticket.priority",
       "ticket.labels",
       "ticket.assignee",
       "ticket.custom_field"
      ]
     },
     "field": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,39}$"
     },
     "labelId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "maintenance": {
      "type": "string",
      "enum": [
       "maintainers_only",
       "consequence_checked"
      ]
     }
    }
   },
   "AccessSchemaView": {
    "type": "object",
    "required": [
     "grammarVersion",
     "attributes",
     "capabilities",
     "fields",
     "customFields",
     "scopes",
     "timeLevels",
     "docsScopes",
     "relationshipsLevels",
     "templates",
     "limits"
    ],
    "properties": {
     "grammarVersion": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "description": "The current grammar version (6, XM-1576). The bound is the registry cap (GrammarVersion::MAX), not the current version (the XM-1542 lesson; XM-1572)."
     },
     "attributes": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "attribute",
        "type",
        "operators",
        "operandSource",
        "operandClass",
        "since"
       ],
       "properties": {
        "attribute": {
         "type": "string",
         "maxLength": 40
        },
        "field": {
         "type": "string"
        },
        "label": {
         "type": "string",
         "maxLength": 60
        },
        "type": {
         "type": "string",
         "enum": [
          "boolean",
          "enum",
          "member",
          "project_set",
          "label_set",
          "single_select",
          "multi_select",
          "checkbox"
         ]
        },
        "operators": {
         "type": "array",
         "maxItems": 3,
         "items": {
          "type": "string",
          "enum": [
           "is",
           "is_not",
           "in"
          ]
         }
        },
        "operandSource": {
         "type": "string",
         "enum": [
          "boolean",
          "priority",
          "me",
          "projects",
          "labels",
          "options"
         ]
        },
        "operandClass": {
         "type": "string",
         "enum": [
          "immutable",
          "sharing_switch",
          "person_binding",
          "classification"
         ]
        },
        "since": {
         "type": "integer",
         "minimum": 1
        }
       }
      }
     },
     "capabilities": {
      "type": "array",
      "maxItems": 40,
      "items": {
       "type": "object",
       "required": [
        "key",
        "chip",
        "lockedFor"
       ],
       "properties": {
        "key": {
         "$ref": "#/components/schemas/CapabilityKey"
        },
        "chip": {
         "type": "boolean"
        },
        "lockedFor": {
         "type": "array",
         "maxItems": 2,
         "items": {
          "type": "string",
          "enum": [
           "client",
           "internal"
          ]
         }
        },
        "requires": {
         "$ref": "#/components/schemas/CapabilityKey",
         "description": "The capability a document or a grant must hold beside this one (F-FIN-04.R03): manage_finance and set_project_rates need view_finance, manage_rates needs view_rates, close_logging_periods needs view_team_timesheets (XM-947), manage_cashflow needs view_cashflow (XM-1576, finance FA-8)."
        },
        "hint": {
         "type": "string",
         "maxLength": 200,
         "description": "The warning that the role editor and the extension dialog show next to the capability (F-FIN-04.R21, §12; F-FIN-03.R13)."
        }
       }
      }
     },
     "fields": {
      "type": "array",
      "maxItems": 18,
      "description": "The whole built-in field vocabulary, one entry per field — the 18 of TicketField registry version 3 (XM-1092 adds the guarded priority and reporter).",
      "items": {
       "type": "object",
       "required": [
        "key",
        "lockedFor",
        "guardedFor"
       ],
       "properties": {
        "key": {
         "$ref": "#/components/schemas/TicketFieldKey"
        },
        "lockedFor": {
         "type": "array",
         "maxItems": 1,
         "items": {
          "type": "string",
          "enum": [
           "client"
          ]
         }
        },
        "guardedFor": {
         "type": "array",
         "maxItems": 1,
         "items": {
          "type": "string",
          "enum": [
           "client"
          ]
         }
        }
       }
      }
     },
     "customFields": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "type": "object",
       "required": [
        "id",
        "key",
        "name",
        "type",
        "clientClass",
        "usableInConditions"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "key": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,39}$"
        },
        "name": {
         "type": "string",
         "maxLength": 60
        },
        "type": {
         "type": "string",
         "enum": [
          "short_text",
          "long_text",
          "number",
          "date",
          "single_select",
          "multi_select",
          "member",
          "url",
          "checkbox"
         ]
        },
        "clientClass": {
         "type": "string",
         "enum": [
          "guarded",
          "never_client"
         ]
        },
        "usableInConditions": {
         "type": "boolean"
        }
       }
      }
     },
     "scopes": {
      "type": "array",
      "maxItems": 3,
      "items": {
       "type": "string",
       "enum": [
        "all",
        "own_teams",
        "only"
       ]
      }
     },
     "timeLevels": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "type": "string",
       "enum": [
        "none",
        "monthly_totals",
        "weekly_totals",
        "own_entries",
        "all_entries"
       ]
      }
     },
     "docsScopes": {
      "type": "array",
      "maxItems": 3,
      "items": {
       "type": "string",
       "enum": [
        "all",
        "client_tagged",
        "none"
       ]
      }
     },
     "relationshipsLevels": {
      "type": "array",
      "maxItems": 3,
      "items": {
       "type": "string",
       "enum": [
        "none",
        "view",
        "manage"
       ]
      }
     },
     "timesheetScopes": {
      "type": "array",
      "maxItems": 3,
      "description": "Grammar 5 (XM-946, XM-959) — the team scopes of the `timesheets` clause, narrow to wide.",
      "items": {
       "$ref": "#/components/schemas/TimesheetScopeKey"
      }
     },
     "templates": {
      "type": "array",
      "maxItems": 50,
      "description": "The role templates (F-ACC-06.R02). The bound is the cap of the template registry, not its current size (XM-1542): a client checks the bound, so a bound equal to the size breaks every older client at each new template. An added template is additive.",
      "items": {
       "type": "object",
       "required": [
        "key",
        "name",
        "audience"
       ],
       "properties": {
        "key": {
         "type": "string",
         "enum": [
          "agency_client",
          "internal_stakeholder",
          "contractor",
          "read_only_auditor",
          "blank"
         ]
        },
        "name": {
         "type": "string"
        },
        "audience": {
         "type": "string",
         "enum": [
          "internal",
          "client"
         ]
        }
       }
      }
     },
     "limits": {
      "type": "object",
      "required": [
       "maxConditions",
       "maxOperands",
       "maxProjects"
      ],
      "properties": {
       "maxConditions": {
        "type": "integer",
        "enum": [
         5
        ]
       },
       "maxOperands": {
        "type": "integer",
        "enum": [
         100
        ]
       },
       "maxProjects": {
        "type": "integer",
        "enum": [
         100
        ]
       }
      }
     }
    }
   },
   "AccountAvatarView": {
    "type": "object",
    "description": "XM-1381 (F-IDN-11.R10) — the stored account avatar after an upload; the image itself is served by getMyAvatar and getMemberAvatar.",
    "required": [
     "version",
     "contentType",
     "sizeBytes",
     "updatedAt"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "contentType": {
      "type": "string",
      "enum": [
       "image/webp"
      ]
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2097152
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "crop": {
      "type": "object",
      "description": "F-IDN-11.R13 — the framed square in the kept original's pixels; absent for an avatar stored before.",
      "required": [
       "x",
       "y",
       "size"
      ],
      "properties": {
       "x": {
        "type": "integer",
        "minimum": 0
       },
       "y": {
        "type": "integer",
        "minimum": 0
       },
       "size": {
        "type": "integer",
        "minimum": 1
       }
      }
     }
    }
   },
   "AccountDocument": {
    "type": "object",
    "required": [
     "id",
     "email",
     "name",
     "initials",
     "timeZone",
     "language",
     "preferences",
     "presence",
     "isOperator",
     "twoFactor",
     "memberships",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "initials": {
      "type": "string",
      "maxLength": 2
     },
     "timeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "language": {
      "$ref": "#/components/schemas/Locale"
     },
     "languages": {
      "type": "array",
      "maxItems": 3,
      "items": {
       "$ref": "#/components/schemas/Locale"
      },
      "description": "XM-1630 (register §129 point 5) — the profile picker's languages: the languages that the catalogue offers (LocaleCatalogue, as the console's `languages`), with the account's own language. `PATCH /me/profile` refuses a change to another language (422 `locale.unsupported` at `/language`)."
     },
     "preferences": {
      "$ref": "#/components/schemas/AccountPreferences"
     },
     "presence": {
      "type": "string",
      "enum": [
       "available",
       "focus",
       "away"
      ]
     },
     "isOperator": {
      "type": "boolean",
      "description": "True only while the account has an active platform operator (the link of the account to an operator with status active; identity §3.1, XM-645). False for an open, revoked or expired invitation and after a removal. It gives no operator detail, role or grant. The UI shows the console links from it (F-PLT-01.R07, F-IDN-21.R07); the console itself checks the operator again at each request (F-PLT-01.R02)."
     },
     "twoFactor": {
      "type": "object",
      "required": [
       "enrolled",
       "setupRequired"
      ],
      "properties": {
       "enrolled": {
        "type": "boolean"
       },
       "setupRequired": {
        "type": "boolean",
        "description": "The current tenant requires 2FA and the account is not enrolled (\"Set up 2FA\" chip, D-054)."
       }
      }
     },
     "memberships": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/AccountMembershipRef"
      }
     },
     "currentMembership": {
      "$ref": "#/components/schemas/CurrentMembershipFields"
     },
     "impersonation": {
      "description": "The console Owner's impersonation of this session (F-PLT-22; register §230 add. 34), or null for a normal session. Under an impersonation the document is the user's, and `memberships` lists the impersonation's tenant only. The portal shows its banner from it.",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "$ref": "#/components/schemas/ImpersonationState"
       }
      ]
     },
     "limited": {
      "description": "G414 F1 (owner, 3 December 2026 23:1x, \"F1 - yes.\"): the limiter that blocks this account now, or null. While the `not-found` limiter (05-api §8.4) blocks the account, every route of the tenant API answers 429 `rate_limit.exceeded`, but `GET /me`, `GET /me/memberships`, `GET /me/impersonation` and `POST /me/impersonation/exit` stay reachable (`NotFoundBlockExemptRoute`, by route name). These routes take no id, so they give no enumeration signal. `GET /me` then answers 200 with this field, and the SPA shell shows \"Too many missing items were opened. Try again in N min.\" until `retryAfter`. The name has no word of the finance vocabulary (`docs/assist/finance.v1.json` of the web app; \"rate\" is one), so the assistant's finance boundary keeps the account document.",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "$ref": "#/components/schemas/AccountLimitBlock"
       }
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AccountLimitBlock": {
    "type": "object",
    "required": [
     "limiter",
     "retryAfter",
     "retryAfterSeconds"
    ],
    "properties": {
     "limiter": {
      "type": "string",
      "description": "The name of the limiter, the same as the `limiter` of the 429 problem. Today only `not-found`."
     },
     "retryAfter": {
      "type": "string",
      "format": "date-time",
      "description": "The end of the block, the same as the `retryAfter` of the 429 problem."
     },
     "retryAfterSeconds": {
      "type": "integer",
      "minimum": 1,
      "description": "The seconds to the end of the block when the server answered, the same as the `Retry-After` header of the 429."
     }
    }
   },
   "AccountMembershipCard": {
    "type": "object",
    "description": "One membership card of GET /me/memberships (F-IDN-21.R08; XM-1021): the row of AccountMembershipRef and the facts that the reader may see. An absent member is a fact that the card does not give.",
    "required": [
     "tenantId",
     "slug",
     "name",
     "audience",
     "memberId"
    ],
    "properties": {
     "tenantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "slug": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
     },
     "name": {
      "type": "string",
      "maxLength": 200
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "lastUsedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "suspended": {
      "type": "boolean",
      "description": "The tenant is suspended. The card then has no fact (F-PLT-09.R03)."
     },
     "clientOrganisationName": {
      "type": "string",
      "maxLength": 120,
      "description": "A client membership's organisation (\"Client · <organisation>\", F-IDN-21.R02); absent for members."
     },
     "roleName": {
      "type": "string",
      "maxLength": 60,
      "description": "The member's role in the tenant. An internal membership of an active tenant only."
     },
     "planName": {
      "type": "string",
      "maxLength": 40,
      "description": "The tenant's plan. An internal membership of an active tenant only."
     },
     "memberCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The tenant's active internal members (the usage projection, platform tenant_usage.members_total). An internal membership of an active tenant only."
     },
     "unreadCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10,
      "description": "The unread notifications of the member's bell in the tenant, up to 10 (\"9+\", F-NOT-01.R03). An active tenant only."
     },
     "unreadCountExact": {
      "type": "boolean",
      "description": "False when unreadCount is a lower bound (the bell's bounded count, F-NOT-01.R03)."
     }
    }
   },
   "AccountMembershipRef": {
    "type": "object",
    "required": [
     "tenantId",
     "slug",
     "name",
     "audience",
     "memberId"
    ],
    "properties": {
     "tenantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "slug": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
     },
     "name": {
      "type": "string",
      "maxLength": 200
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "lastUsedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "suspended": {
      "type": "boolean",
      "description": "The tenant is suspended — listed disabled in the switcher (F-IDN-21.R02); absent or false otherwise."
     },
     "clientOrganisationName": {
      "type": "string",
      "maxLength": 120,
      "description": "A client membership's organisation — \"Client · <organisation>\" in the switcher (F-IDN-21.R02; XM-34); absent for members, and when the guest has no client project."
     }
    }
   },
   "AccountPreferences": {
    "type": "object",
    "properties": {
     "weekStart": {
      "type": "string",
      "enum": [
       "monday",
       "sunday"
      ]
     },
     "timeFormat": {
      "type": "string",
      "enum": [
       "h24",
       "h12"
      ]
     },
     "theme": {
      "type": "string",
      "enum": [
       "light",
       "system",
       "dark"
      ]
     }
    }
   },
   "AccountRecoveryCancel": {
    "type": "object",
    "required": [
     "cancelToken"
    ],
    "additionalProperties": false,
    "properties": {
     "cancelToken": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true
     }
    }
   },
   "AccountRecoveryEmailProof": {
    "type": "object",
    "required": [
     "token"
    ],
    "additionalProperties": false,
    "properties": {
     "token": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true
     }
    }
   },
   "AccountRecoveryNoticeAct": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "AccountRecoveryPrimaryEvidence": {
    "type": "object",
    "additionalProperties": false,
    "description": "Exactly one of password or provider.",
    "properties": {
     "password": {
      "type": "string",
      "maxLength": 128,
      "writeOnly": true
     },
     "provider": {
      "type": "string",
      "enum": [
       "google",
       "microsoft"
      ]
     }
    }
   },
   "AccountRecoveryStart": {
    "type": "object",
    "required": [
     "email"
    ],
    "additionalProperties": false,
    "properties": {
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     }
    }
   },
   "AccountRecoveryTokenEvidence": {
    "type": "object",
    "required": [
     "token"
    ],
    "additionalProperties": false,
    "properties": {
     "token": {
      "type": "string",
      "maxLength": 200,
      "writeOnly": true
     }
    }
   },
   "AccountRecoveryView": {
    "type": "object",
    "required": [
     "id",
     "state",
     "evidence",
     "initiatorKind",
     "createdAt",
     "expiresAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "state": {
      "type": "string",
      "enum": [
       "requested",
       "approved",
       "held",
       "completed",
       "cancelled",
       "rejected",
       "expired"
      ]
     },
     "path": {
      "type": "string",
      "enum": [
       "standard",
       "extended",
       "attested"
      ]
     },
     "initiatorKind": {
      "type": "string",
      "enum": [
       "self",
       "tenant_admin",
       "operator"
      ]
     },
     "evidence": {
      "type": "array",
      "maxItems": 7,
      "items": {
       "type": "object",
       "required": [
        "kind",
        "result"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "E1_email",
          "E2_primary",
          "P1_trusted_device",
          "P2_prior_session",
          "P3_access_token",
          "S1_support",
          "T1_tenant_attestation"
         ]
        },
        "result": {
         "type": "string",
         "enum": [
          "passed",
          "failed"
         ]
        },
        "verifiedAt": {
         "$ref": "#/components/schemas/Instant"
        }
       }
      }
     },
     "missing": {
      "type": "array",
      "maxItems": 7,
      "items": {
       "type": "string"
      }
     },
     "completesAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "submittedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "waitHours": {
      "type": "integer",
      "minimum": 1,
      "maximum": 720,
      "description": "XM-1025 (G-REC-02). The standard wait in hours (`identity.accountRecovery.waitHours`). Only in the person's view."
     },
     "extendedWaitHours": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440,
      "description": "XM-1025 (G-REC-02). The extended wait in hours (`identity.accountRecovery.extendedWaitHours`). Only in the person's view."
     },
     "providers": {
      "type": "array",
      "maxItems": 2,
      "description": "XM-1024 (G-REC-01). The account's own identities that can prove E2 by a round trip: linked to the account and configured on the platform. Only in the person's view.",
      "items": {
       "type": "string",
       "enum": [
        "google",
        "microsoft"
       ]
      }
     },
     "redirectUrl": {
      "type": "string",
      "format": "uri",
      "description": "XM-1024. Only in the answer that starts an E2 provider round trip; the page goes to this address."
     }
    }
   },
   "AccountSessionRow": {
    "type": "object",
    "required": [
     "id",
     "deviceLabel",
     "deviceClass",
     "location",
     "lastSeenAt",
     "current"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "deviceLabel": {
      "type": "string",
      "maxLength": 80
     },
     "deviceClass": {
      "type": "string",
      "enum": [
       "desktop",
       "phone",
       "tablet",
       "unknown"
      ]
     },
     "client": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "Firefox 146 · macOS",
      "description": "XM-1013 (G-ACC-04): the browser or other client with its major version and the operating system, from the user-agent parse stored at sign-in. Absent for a session without a stored parse (signed in before XM-1013) or when the user agent names no client. Never the raw user agent."
     },
     "location": {
      "type": "string",
      "maxLength": 120,
      "example": "Vilnius, Lithuania"
     },
     "lastSeenAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "authenticatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "current": {
      "type": "boolean"
     },
     "kind": {
      "type": "string",
      "enum": [
       "own",
       "platform_support"
      ],
      "description": "`platform_support` — the console Owner's impersonation session of this account (F-PLT-22.R17): the list shows it as \"Platform support session\", read-only (no single sign-out: `DELETE /me/sessions/{id}` answers 404); \"Sign out all other sessions\" ends it. Absent reads as `own`."
     },
     "support": {
      "type": "object",
      "description": "XM-1409 (F-PLT-22.R12): on a `platform_support` row only — who, when, how long and the mode of the support session. Who is always \"Youniton support\": never the operator's name, id or console role (register §230 add. 2, Q19 (a)). Absent on the account's own sessions.",
      "required": [
       "actorLabel",
       "startedAt",
       "expiresAt",
       "durationMinutes",
       "mode"
      ],
      "properties": {
       "actorLabel": {
        "type": "string",
        "enum": [
         "Youniton support"
        ]
       },
       "startedAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "expiresAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "durationMinutes": {
        "type": "integer",
        "minimum": 1,
        "maximum": 240,
        "description": "The whole minutes from `startedAt` to `expiresAt`, rounded up."
       },
       "mode": {
        "type": "string",
        "enum": [
         "read_only",
         "read_write"
        ]
       }
      }
     }
    }
   },
   "AccountSignInMethodRow": {
    "type": "object",
    "required": [
     "method",
     "state",
     "usableHere"
    ],
    "properties": {
     "method": {
      "type": "string",
      "enum": [
       "password",
       "google",
       "microsoft",
       "saml"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "set",
       "not_set",
       "linked",
       "not_linked",
       "managed_by_tenant"
      ]
     },
     "identityId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "changedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "usableHere": {
      "type": "boolean",
      "description": "The current tenant and the person's teams allow it (\"Not usable for <tenant>\" otherwise)."
     },
     "unusableReason": {
      "type": "string",
      "enum": [
       "method_disabled",
       "audience",
       "team_policy",
       "sso_enforced"
      ]
     },
     "enforcedForTeam": {
      "type": "string"
     },
     "samlDomain": {
      "type": "string"
     },
     "can": {
      "type": "object",
      "properties": {
       "link": {
        "type": "boolean"
       },
       "unlink": {
        "type": "boolean"
       },
       "set": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ActivityDecisionKey": {
    "type": "string",
    "enum": [
     "approved",
     "changes_requested"
    ],
    "x-extensible-enum": true,
    "description": "The known decisions of a client approval (F-WRK-24.R02)."
   },
   "ActivityEntry": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "at",
     "actor",
     "facts"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "description": "The ActivityKind registry (§3.7; F-WRK-24.R01) as an open set: the known kinds are ActivityKindKey; a later release can send a kind that is not on that list (x-extensible-enum, 05-api §9). A client decodes it as a string and shows a neutral line or skips the entry; an unknown kind never stops the page (BE-PRJ-OVERVIEW O3; REV-BPO-04).",
      "anyOf": [
       {
        "$ref": "#/components/schemas/ActivityKindKey"
       },
       {
        "$ref": "#/components/schemas/ActivityLaterValue"
       }
      ]
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     },
     "actor": {
      "$ref": "#/components/schemas/CommentAuthorView"
     },
     "ticket": {
      "type": "object",
      "required": [
       "key"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/TicketKey"
       },
       "title": {
        "type": "string",
        "maxLength": 200
       }
      }
     },
     "facts": {
      "$ref": "#/components/schemas/ActivityFactsView"
     }
    }
   },
   "ActivityFactsView": {
    "type": "object",
    "description": "The facts of one entry, each rendered now through the reader's mask (F-WRK-24.R02, R03); a member is present only for the kinds that carry it — fromStage and toStage (moved, work_started; toStage also ticket_created), cause (moved), approvalRequested (moved), sprint (planned, unplanned, sprint_started, sprint_completed), epic (epic_completed), minutes (time_logged, estimate_set), visible (client_visibility_changed), excerpt (client_comment), decision (approval_decided), clientVersion (tickets_reshared, attachments_reshared).",
    "properties": {
     "fromStage": {
      "$ref": "#/components/schemas/TicketStage"
     },
     "toStage": {
      "$ref": "#/components/schemas/TicketStage"
     },
     "cause": {
      "description": "An open set (REV-BPO-04) — the known causes are ActivityMoveCauseKey; a client tolerates a later cause.",
      "anyOf": [
       {
        "$ref": "#/components/schemas/ActivityMoveCauseKey"
       },
       {
        "$ref": "#/components/schemas/ActivityLaterValue"
       }
      ]
     },
     "approvalRequested": {
      "type": "boolean",
      "description": "A move with a client approval request by the same actor within a minute — \"and requested client approval\" (F-WRK-24.R04, §16 decision 3)."
     },
     "sprint": {
      "type": "object",
      "required": [
       "id"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
       }
      }
     },
     "epic": {
      "type": "object",
      "required": [
       "id"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       }
      }
     },
     "minutes": {
      "type": "integer",
      "minimum": 0
     },
     "visible": {
      "type": "boolean"
     },
     "excerpt": {
      "type": "string",
      "maxLength": 280,
      "description": "A client-thread comment the reader may see, read now (never stored)."
     },
     "decision": {
      "description": "An open set (REV-BPO-04) — the known decisions are ActivityDecisionKey; a client tolerates a later decision.",
      "anyOf": [
       {
        "$ref": "#/components/schemas/ActivityDecisionKey"
       },
       {
        "$ref": "#/components/schemas/ActivityLaterValue"
       }
      ]
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "ActivityKindKey": {
    "type": "string",
    "enum": [
     "ticket_created",
     "moved",
     "planned",
     "unplanned",
     "assigned",
     "client_visibility_changed",
     "comment_posted",
     "client_comment",
     "attachment_added",
     "merge_request_opened",
     "merge_request_merged",
     "approval_requested",
     "approval_reviewers_recovered",
     "approval_decided",
     "time_logged",
     "work_started",
     "estimate_set",
     "sprint_started",
     "sprint_completed",
     "epic_completed",
     "tickets_reshared",
     "attachments_reshared"
    ],
    "x-extensible-enum": true
   },
   "ActivityLaterValue": {
    "type": "string",
    "pattern": "^[a-z][a-z0-9_]*$",
    "maxLength": 60,
    "description": "A value of an open activity vocabulary (kind, cause, decision) that a later release adds (05-api §9). This release sends only the known values; the member accepts other keys so that a client decodes them and does not fail the page (REV-BPO-04)."
   },
   "ActivityMoveCauseKey": {
    "type": "string",
    "enum": [
     "user",
     "automation",
     "import",
     "stage_merged",
     "sprint_completed"
    ],
    "x-extensible-enum": true,
    "description": "The known causes of a move (MoveCauseKind; F-WRK-24.R02)."
   },
   "AgentAbility": {
    "type": "string",
    "enum": [
     "memory:read",
     "memory:write",
     "transcripts:read",
     "decisions:accept",
     "meetings:write",
     "tickets:read",
     "actions:propose"
    ],
    "x-extensible-enum": true
   },
   "AgentActionRequest": {
    "type": "object",
    "required": [
     "action",
     "items"
    ],
    "description": "Spec BF-3 (F-AST-19) — an agent identity's request for one exact proposal of the workflow agent_action.",
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "ticket.create",
       "ticket.set_fields",
       "ticket.assign",
       "ticket.comment"
      ],
      "x-extensible-enum": true,
      "description": "An agent-proposable entry of the ActionCatalogue that the identity's allowedActions and assist.enabledActions hold."
     },
     "items": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "arguments"
       ],
       "properties": {
        "arguments": {
         "type": "object",
         "description": "The action schema's arguments (assist §3.14); expectedVersion is optional — without it the current version is bound."
        }
       }
      }
     }
    }
   },
   "AgentActionView": {
    "type": "object",
    "required": [
     "proposalId",
     "runId",
     "state",
     "action",
     "itemCount",
     "reviewers",
     "reviewUrl",
     "expiresAt"
    ],
    "properties": {
     "proposalId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "approved",
       "rejected",
       "expired",
       "stale",
       "void",
       "executed",
       "refused"
      ]
     },
     "action": {
      "type": "string",
      "maxLength": 40,
      "example": "ticket.comment"
     },
     "itemCount": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20
     },
     "reviewers": {
      "type": "array",
      "maxItems": 6,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "reviewUrl": {
      "type": "string",
      "maxLength": 2048,
      "example": "/northwind/approvals/ai?proposal=0193a1c2-5d6e-7f80-9a1b-2c3d4e5f6a7b"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "results": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "itemNo",
        "state"
       ],
       "properties": {
        "itemNo": {
         "type": "integer",
         "minimum": 1
        },
        "state": {
         "type": "string",
         "enum": [
          "committed",
          "refused"
         ]
        },
        "ticketKey": {
         "$ref": "#/components/schemas/TicketKey"
        },
        "ticketVersion": {
         "type": "integer",
         "minimum": 1
        },
        "commentId": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      }
     },
     "refusal": {
      "$ref": "#/components/schemas/Problem"
     }
    }
   },
   "AgentIdentityInput": {
    "type": "object",
    "required": [
     "name",
     "kind",
     "ownerMemberId",
     "projectKeys",
     "abilities"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "Atlas coding agent"
     },
     "kind": {
      "$ref": "#/components/schemas/AgentIdentityKind"
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "ownerMemberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "projectKeys": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     "abilities": {
      "type": "array",
      "minItems": 1,
      "maxItems": 7,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/AgentAbility"
      }
     },
     "allowedActions": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "pattern": "^[a-z]+\\.[a-z_]+$"
      }
     },
     "approverMemberIds": {
      "type": "array",
      "maxItems": 5,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "writeMode": {
      "type": "string",
      "enum": [
       "tenant_default",
       "review"
      ],
      "default": "tenant_default"
     },
     "rateOverride": {
      "$ref": "#/components/schemas/AgentRateOverride"
     },
     "allowedRanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 43,
       "example": "203.0.113.0/24"
      }
     },
     "segments": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/MemorySegmentKey"
      },
      "default": [
       "general"
      ]
     },
     "defaultSegment": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     }
    }
   },
   "AgentIdentityKind": {
    "type": "string",
    "enum": [
     "agent",
     "service",
     "meeting_assistant"
    ],
    "x-extensible-enum": true
   },
   "AgentIdentityPatch": {
    "type": "object",
    "description": "JSON Merge Patch over the members of AgentIdentityInput except kind and ownerMemberId.",
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "projectKeys": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     "abilities": {
      "type": "array",
      "minItems": 1,
      "maxItems": 7,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/AgentAbility"
      }
     },
     "allowedActions": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "pattern": "^[a-z]+\\.[a-z_]+$"
      }
     },
     "approverMemberIds": {
      "type": "array",
      "maxItems": 5,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "writeMode": {
      "type": "string",
      "enum": [
       "tenant_default",
       "review"
      ]
     },
     "rateOverride": {
      "$ref": "#/components/schemas/AgentRateOverride"
     },
     "allowedRanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 43
      }
     },
     "segments": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/MemorySegmentKey"
      }
     },
     "defaultSegment": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     }
    }
   },
   "AgentIdentityState": {
    "type": "string",
    "enum": [
     "active",
     "paused",
     "suspended",
     "revoked"
    ]
   },
   "AgentIdentityTransferRequest": {
    "type": "object",
    "required": [
     "ownerMemberId"
    ],
    "properties": {
     "ownerMemberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "narrowProjects": {
      "type": "boolean",
      "default": false,
      "description": "Remove the projects that the new owner cannot see, instead of a refusal."
     }
    }
   },
   "AgentIdentityView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "kind",
     "owner",
     "projects",
     "abilities",
     "writeMode",
     "effectiveWriteMode",
     "state",
     "version",
     "tokens",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 80
     },
     "kind": {
      "$ref": "#/components/schemas/AgentIdentityKind"
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "projects": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "key",
        "inOwnerScope"
       ],
       "properties": {
        "key": {
         "$ref": "#/components/schemas/ProjectKey"
        },
        "name": {
         "type": "string",
         "maxLength": 120
        },
        "inOwnerScope": {
         "type": "boolean",
         "description": "False when the owner lost the project; the identity cannot act there."
        }
       }
      }
     },
     "abilities": {
      "type": "array",
      "maxItems": 7,
      "items": {
       "$ref": "#/components/schemas/AgentAbility"
      }
     },
     "allowedActions": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string"
      }
     },
     "approvers": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "writeMode": {
      "type": "string",
      "enum": [
       "tenant_default",
       "review"
      ]
     },
     "effectiveWriteMode": {
      "type": "string",
      "enum": [
       "direct",
       "review"
      ]
     },
     "rateOverride": {
      "$ref": "#/components/schemas/AgentRateOverride"
     },
     "allowedRanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string"
      }
     },
     "segments": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/MemorySegmentRef"
      }
     },
     "defaultSegment": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     },
     "state": {
      "$ref": "#/components/schemas/AgentIdentityState"
     },
     "suspendedReason": {
      "type": "string",
      "enum": [
       "owner_removed"
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "tokens": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "$ref": "#/components/schemas/AgentTokenView"
      }
     },
     "usage30d": {
      "type": "object",
      "properties": {
       "reads": {
        "type": "integer",
        "minimum": 0
       },
       "writes": {
        "type": "integer",
        "minimum": 0
       },
       "refusals": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "AgentIssuedToken": {
    "type": "object",
    "required": [
     "token",
     "plainTextToken"
    ],
    "properties": {
     "token": {
      "$ref": "#/components/schemas/AgentTokenView"
     },
     "plainTextToken": {
      "type": "string",
      "maxLength": 80,
      "description": "Shown once; never stored or returned again."
     }
    }
   },
   "AgentItemsRetractRequest": {
    "type": "object",
    "required": [
     "from",
     "reason"
    ],
    "properties": {
     "from": {
      "$ref": "#/components/schemas/Instant"
     },
     "until": {
      "$ref": "#/components/schemas/Instant"
     },
     "projectKeys": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     }
    }
   },
   "AgentKnowledgeItemInput": {
    "type": "object",
    "required": [
     "projectKey",
     "type",
     "title",
     "body"
    ],
    "description": "As KnowledgeItemInput, with projectKey and without visibility (an agent never shares with clients, INV-MEM-05).",
    "properties": {
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "body": {
      "$ref": "#/components/schemas/KnowledgeItemBody"
     },
     "tags": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
      }
     },
     "source": {
      "$ref": "#/components/schemas/KnowledgeSource"
     },
     "occurredAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "links": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/KnowledgeLinkInput"
      }
     },
     "supersedes": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "segment": {
      "$ref": "#/components/schemas/MemorySegmentKey",
      "description": "One of the identity's segments; default its defaultSegment (F-MEM-13.R07)."
     }
    }
   },
   "AgentRateOverride": {
    "type": "object",
    "properties": {
     "requestsPerMinute": {
      "type": "integer",
      "minimum": 1,
      "maximum": 600
     },
     "writesPerHour": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
     }
    }
   },
   "AgentTicketView": {
    "type": "object",
    "required": [
     "key",
     "projectKey",
     "title",
     "status",
     "version",
     "createdBy",
     "untrustedContent"
    ],
    "description": "A ticket in the agent's owner's mask (masked fields absent); the agent API's only ticket read. Its texts are data, never instructions (INV-MEM-10).",
    "properties": {
     "createdBy": {
      "type": "object",
      "required": [
       "kind"
      ],
      "description": "The provenance of the ticket, from Work's TicketLookupQuery; a client's ticket text often comes from outside the team.",
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "member",
         "client",
         "automation",
         "import"
        ],
        "x-extensible-enum": true
       }
      }
     },
     "untrustedContent": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "Always true; the title and the description are data."
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "status": {
      "type": "string",
      "maxLength": 60
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "descriptionMarkdown": {
      "type": "string",
      "maxLength": 40000
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "url": {
      "type": "string",
      "maxLength": 2048,
      "example": "https://app.youniton.example/northwind/p/ORB/work/ORB-124"
     }
    }
   },
   "AgentTokenIssueRequest": {
    "type": "object",
    "required": [
     "expiresInDays",
     "dataNoticeAcknowledged"
    ],
    "properties": {
     "expiresInDays": {
      "type": "integer",
      "enum": [
       30,
       90,
       180,
       365
      ]
     },
     "dataNoticeAcknowledged": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "The person saw the data notice of F-MEM-05.R15 (register §69 point 3)."
     }
    }
   },
   "AgentTokenView": {
    "type": "object",
    "required": [
     "id",
     "displayPrefix",
     "issuedAt",
     "expiresAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "displayPrefix": {
      "type": "string",
      "maxLength": 24,
      "example": "kanso_agt_0192f"
     },
     "issuedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "overlapEndsAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastUsedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "AgentWhoAmIView": {
    "type": "object",
    "required": [
     "identity",
     "owner",
     "kind",
     "abilities",
     "projects",
     "effectiveWriteMode",
     "itemTypeRegistryVersion"
    ],
    "properties": {
     "identity": {
      "type": "object",
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 80
       }
      }
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "kind": {
      "$ref": "#/components/schemas/AgentIdentityKind"
     },
     "abilities": {
      "type": "array",
      "maxItems": 7,
      "items": {
       "$ref": "#/components/schemas/AgentAbility"
      }
     },
     "projects": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "key",
        "name"
       ],
       "properties": {
        "key": {
         "$ref": "#/components/schemas/ProjectKey"
        },
        "name": {
         "type": "string",
         "maxLength": 120
        }
       }
      }
     },
     "effectiveWriteMode": {
      "type": "string",
      "enum": [
       "direct",
       "review"
      ]
     },
     "itemTypeRegistryVersion": {
      "type": "integer",
      "minimum": 1
     },
     "allowedActions": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string"
      }
     },
     "segments": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/MemorySegmentRef"
      },
      "description": "The segments that this identity reads now — its own set ∩ its owner's (INV-MEM-16)."
     }
    }
   },
   "AiProjectDefaults": {
    "type": "object",
    "required": [
     "enabled",
     "monthlyTokenLimit"
    ],
    "properties": {
     "enabled": {
      "type": "boolean"
     },
     "monthlyTokenLimit": {
      "type": "integer",
      "minimum": 0,
      "example": 500000
     }
    }
   },
   "AiProjectSettingsPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "enabled": {
      "type": "boolean"
     },
     "monthlyLimit": {
      "type": "integer",
      "minimum": 1000
     }
    }
   },
   "AiProjectSettingsRow": {
    "type": "object",
    "required": [
     "project",
     "name",
     "enabled",
     "usedTokens",
     "sources",
     "version"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string",
      "maxLength": 120
     },
     "team": {
      "type": "string",
      "maxLength": 120
     },
     "client": {
      "type": "string",
      "maxLength": 160
     },
     "enabled": {
      "type": "boolean",
      "description": "The project's Project chat (AI) module (D-033)."
     },
     "monthlyLimit": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "effectiveLimit": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "limitedBy": {
      "type": "string",
      "enum": [
       "plan"
      ]
     },
     "usedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "sources": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "enum": [
        "tickets",
        "docs",
        "repos",
        "messages"
       ]
      }
     },
     "repositories": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AiRepositoryIndexState"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AiRepositoryIndexState": {
    "type": "object",
    "required": [
     "name",
     "state",
     "partial",
     "filesIndexed",
     "filesSkipped"
    ],
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 120
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "indexing",
       "indexed",
       "failed"
      ]
     },
     "indexedRevision": {
      "type": "string",
      "maxLength": 64
     },
     "filesIndexed": {
      "type": "integer",
      "minimum": 0
     },
     "filesSkipped": {
      "type": "integer",
      "minimum": 0,
      "description": "Files skipped for possible secrets — a count only."
     },
     "partial": {
      "type": "boolean"
     },
     "indexedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "AiTenantBudget": {
    "type": "object",
    "required": [
     "plan",
     "budgetTokens",
     "source",
     "usedTokens",
     "reservedTokens",
     "resetsAt",
     "remainingTokens",
     "daysLeft",
     "allocatedTokens"
    ],
    "properties": {
     "plan": {
      "type": "string",
      "maxLength": 60,
      "description": "A plain label — never a link into the console (D-129)."
     },
     "budgetTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "source": {
      "type": "string",
      "enum": [
       "plan",
       "operator_override"
      ]
     },
     "usedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "reservedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "resetsAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "remainingTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "daysLeft": {
      "type": "integer",
      "minimum": 0,
      "maximum": 31
     },
     "allocatedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "exhausted": {
      "type": "boolean"
     }
    }
   },
   "AiTenantPolicy": {
    "type": "object",
    "required": [
     "clientsCanUseChat",
     "includeInternalComments",
     "logPromptsToAudit",
     "promptTextRetentionDays",
     "docSource",
     "messageSources",
     "version"
    ],
    "properties": {
     "clientsCanUseChat": {
      "type": "boolean"
     },
     "includeInternalComments": {
      "type": "boolean"
     },
     "logPromptsToAudit": {
      "type": "boolean"
     },
     "promptTextRetentionDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 90
     },
     "docSource": {
      "type": "string",
      "enum": [
       "published",
       "latest_version"
      ]
     },
     "messageSources": {
      "type": "string",
      "enum": [
       "none",
       "project_conversations"
      ]
     },
     "helpDeskSource": {
      "type": "string",
      "enum": [
       "none",
       "requests"
      ],
      "description": "Spec BF-2 (F-AST-17)."
     },
     "memorySource": {
      "type": "string",
      "enum": [
       "none",
       "items",
       "items_and_transcripts"
      ],
      "description": "Spec BF-3 (F-AST-18); absent in an update keeps the current value."
     },
     "fileTextSources": {
      "type": "string",
      "enum": [
       "none",
       "repository_docs"
      ],
      "description": "SEC-AIP-01 (register §230 add. 103) — the file text that the assistant reads. none (the default) or the README and docs/ sections of connected repositories; file names and media types stay. Absent in an update keeps the current value."
     },
     "messagingAvailable": {
      "type": "boolean",
      "description": "false hides the message-sources control (the messaging capability is off)."
     },
     "searchUnavailable": {
      "$ref": "#/components/schemas/AssistSearchNotice"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AiTenantPolicyUpdate": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "clientsCanUseChat",
     "includeInternalComments",
     "logPromptsToAudit",
     "promptTextRetentionDays",
     "docSource",
     "messageSources"
    ],
    "properties": {
     "clientsCanUseChat": {
      "type": "boolean"
     },
     "includeInternalComments": {
      "type": "boolean"
     },
     "logPromptsToAudit": {
      "type": "boolean"
     },
     "promptTextRetentionDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 90
     },
     "docSource": {
      "type": "string",
      "enum": [
       "published",
       "latest_version"
      ]
     },
     "messageSources": {
      "type": "string",
      "enum": [
       "none",
       "project_conversations"
      ]
     },
     "helpDeskSource": {
      "type": "string",
      "enum": [
       "none",
       "requests"
      ],
      "description": "Spec BF-2 (F-AST-17); absent keeps the current value, so earlier clients stay valid."
     },
     "memorySource": {
      "type": "string",
      "enum": [
       "none",
       "items",
       "items_and_transcripts"
      ],
      "description": "Spec BF-3 (F-AST-18); absent in an update keeps the current value."
     },
     "fileTextSources": {
      "type": "string",
      "enum": [
       "none",
       "repository_docs"
      ],
      "description": "SEC-AIP-01 (register §230 add. 103); absent keeps the current value, so earlier clients stay valid. none removes the indexed file text."
     }
    }
   },
   "AiTokenCount": {
    "type": "integer",
    "minimum": 0,
    "description": "A token amount; formatted 1.26M or 2,000,000 by the UI (domain 03 §11).",
    "example": 1260000
   },
   "AllowedProviderKey": {
    "type": "string",
    "enum": [
     "github",
     "gitlab_com",
     "gitlab_self_managed"
    ]
   },
   "ApprovalDecisionRequest": {
    "type": "object",
    "required": [
     "outcome"
    ],
    "additionalProperties": false,
    "properties": {
     "outcome": {
      "type": "string",
      "enum": [
       "approved",
       "changes_requested"
      ]
     },
     "note": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     }
    }
   },
   "ApprovalDecisionResult": {
    "type": "object",
    "required": [
     "requestId",
     "outcome",
     "decidedBy",
     "decidedAt"
    ],
    "properties": {
     "requestId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "outcome": {
      "type": "string",
      "enum": [
       "approved",
       "changes_requested"
      ]
     },
     "decidedBy": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "note": {
      "type": "string",
      "maxLength": 2000
     }
    }
   },
   "ApprovalDefaults": {
    "type": "object",
    "required": [
     "defaultReviewers",
     "noteOnApprove",
     "autoReminderAfterDays"
    ],
    "properties": {
     "defaultReviewers": {
      "type": "string",
      "enum": [
       "any_project_guest",
       "named"
      ]
     },
     "noteOnApprove": {
      "type": "string",
      "enum": [
       "optional",
       "required"
      ]
     },
     "autoReminderAfterDays": {
      "type": "integer",
      "minimum": 0,
      "maximum": 14,
      "description": "0 means off."
     }
    }
   },
   "ApprovalDocumentRef": {
    "type": "object",
    "description": "A published document that a request binds (F-POR-13.R06; XM-1669, 21 November 2026): the page, the title that the request bound and the bound revision.",
    "required": [
     "id",
     "title",
     "revision"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "revision": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "ApprovalDraft": {
    "type": "object",
    "required": [
     "statement",
     "reviewers"
    ],
    "additionalProperties": false,
    "properties": {
     "statement": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Approving confirms the scope and milestones for the October release."
     },
     "reviewers": {
      "$ref": "#/components/schemas/ReviewerSelection"
     },
     "decideBy": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "docPageIds": {
      "type": "array",
      "maxItems": 10,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "ApprovalDraftValidation": {
    "type": "object",
    "required": [
     "clientVersion",
     "organisation",
     "eligibleGuests",
     "subject",
     "valid"
    ],
    "properties": {
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "defaultReviewers": {
      "type": "string",
      "enum": [
       "any_project_guest",
       "named"
      ]
     },
     "eligibleGuests": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "subject": {
      "type": "object",
      "required": [
       "description",
       "files",
       "documents"
      ],
      "properties": {
       "description": {
        "type": "boolean"
       },
       "files": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "type": "string",
         "maxLength": 255
        }
       },
       "documents": {
        "type": "array",
        "maxItems": 10,
        "items": {
         "type": "string",
         "maxLength": 200
        }
       }
      }
     },
     "valid": {
      "type": "boolean"
     },
     "errors": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     }
    }
   },
   "ApprovalPanelView": {
    "type": "object",
    "required": [
     "history",
     "can"
    ],
    "properties": {
     "open": {
      "$ref": "#/components/schemas/ApprovalRequestView"
     },
     "history": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ApprovalRequestView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "request",
       "withdraw",
       "remind"
      ],
      "properties": {
       "request": {
        "type": "boolean"
       },
       "withdraw": {
        "type": "boolean"
       },
       "remind": {
        "type": "boolean"
       }
      }
     },
     "unavailableReason": {
      "type": "string",
      "enum": [
       "not_client_visible",
       "no_client",
       "portal_off",
       "archived",
       "open_exists",
       "no_eligible_guest"
      ]
     }
    }
   },
   "ApprovalRequestView": {
    "type": "object",
    "description": "One disclosure rule for every workspace approval screen (REV-POR2-02, REV-POR1D-01): `organisation`, the named reviewers and `decision.decidedBy` appear only when the reader may see the client organisation (Relationships' visibility); otherwise they are absent.",
    "required": [
     "id",
     "ticketKey",
     "state",
     "statement",
     "requestedBy",
     "requestedAt",
     "reviewers",
     "clientVersion",
     "documents"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "ticketKey": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "state": {
      "type": "string",
      "enum": [
       "open",
       "decided",
       "withdrawn",
       "superseded"
      ]
     },
     "statement": {
      "type": "string",
      "maxLength": 200
     },
     "documents": {
      "type": "array",
      "maxItems": 10,
      "description": "The bound documents that the reader sees now (the docs scope of the page's project; not in the trash). A page that the reader cannot see is not in the list (hidden equals missing; XM-1669).",
      "items": {
       "$ref": "#/components/schemas/ApprovalDocumentRef"
      }
     },
     "requestedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "requestedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decideBy": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "overdue": {
      "type": "boolean"
     },
     "reviewers": {
      "$ref": "#/components/schemas/ReviewerSelectionView"
     },
     "reviewersLost": {
      "type": "boolean"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "currentClient": {
      "type": "boolean",
      "description": "false for a request of an earlier client version."
     },
     "decision": {
      "type": "object",
      "required": [
       "outcome",
       "decidedAt"
      ],
      "properties": {
       "outcome": {
        "type": "string",
        "enum": [
         "approved",
         "changes_requested"
        ]
       },
       "decidedBy": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "decidedAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "note": {
        "type": "string",
        "maxLength": 2000
       }
      }
     },
     "withdrawnAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "supersession": {
      "type": "object",
      "required": [
       "cause",
       "at"
      ],
      "properties": {
       "cause": {
        "type": "string",
        "enum": [
         "subject_changed",
         "client_changed"
        ]
       },
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "changedParts": {
        "type": "array",
        "maxItems": 3,
        "items": {
         "type": "string",
         "enum": [
          "description",
          "files",
          "documents"
         ]
        }
       }
      }
     },
     "reminders": {
      "type": "object",
      "required": [
       "count"
      ],
      "properties": {
       "count": {
        "type": "integer",
        "minimum": 0
       },
       "lastAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "nextAllowedAt": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "ticketHidden": {
      "type": "boolean",
      "description": "The ticket is no longer visible to clients; the request is hidden with it (D-124)."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AssigneeStripMember": {
    "description": "A member of the assignee strip (F-WRK-01). `assignable` (XM-1101): true when the member can take tickets in the project — an active internal member who sees the project (F-WRK-03.R08); false for a removed member, a client or a member who does not see the project.",
    "allOf": [
     {
      "$ref": "#/components/schemas/MemberRef"
     },
     {
      "type": "object",
      "required": [
       "assignable"
      ],
      "properties": {
       "assignable": {
        "type": "boolean"
       }
      }
     }
    ]
   },
   "AssistActionKey": {
    "type": "string",
    "enum": [
     "ticket.create",
     "ticket.set_fields",
     "ticket.assign",
     "client_update.publish",
     "ticket.trash",
     "help_desk.accept",
     "help_desk.merge",
     "help_desk.ask_information",
     "help_desk.reject",
     "ticket.comment",
     "assistant.write"
    ]
   },
   "AssistApprovalInboxRow": {
    "type": "object",
    "required": [
     "proposalId",
     "runId",
     "project",
     "action",
     "itemCount",
     "expiresAt",
     "initiatedBy",
     "projectName",
     "proposedBy",
     "reviewers",
     "state",
     "can"
    ],
    "properties": {
     "proposalId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "project": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "action": {
      "$ref": "#/components/schemas/AssistActionKey"
     },
     "itemCount": {
      "type": "integer",
      "minimum": 1
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "initiatedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "projectName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "proposedBy": {
      "$ref": "#/components/schemas/AssistProposer"
     },
     "reviewers": {
      "type": "array",
      "maxItems": 6,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "approved",
       "rejected",
       "expired",
       "stale",
       "superseded",
       "void",
       "withdrawn"
      ]
     },
     "stateChangedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decision": {
      "$ref": "#/components/schemas/AssistDecisionResult"
     },
     "can": {
      "type": "object",
      "required": [
       "approve",
       "reject"
      ],
      "properties": {
       "approve": {
        "type": "boolean",
        "description": "Whether the reader may decide it now (the row's \"Review\"); the projection re-checks the authority over each item (R10)."
       },
       "reject": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "AssistApprovalsMeta": {
    "type": "object",
    "required": [
     "size",
     "hasMore",
     "counts"
    ],
    "properties": {
     "size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
     },
     "hasMore": {
      "type": "boolean"
     },
     "counts": {
      "type": "object",
      "description": "F-AST-13.R16 (G-AI-13) — the rows of each view that the reader may see; each count stops at 1000.",
      "required": [
       "waiting",
       "decided"
      ],
      "properties": {
       "waiting": {
        "type": "integer",
        "minimum": 0,
        "maximum": 1000
       },
       "decided": {
        "type": "integer",
        "minimum": 0,
        "maximum": 1000
       }
      }
     }
    }
   },
   "AssistBlockedReason": {
    "type": "string",
    "enum": [
     "budget_exhausted",
     "unavailable",
     "provider_circuit_open"
    ]
   },
   "AssistBudgetLine": {
    "type": "object",
    "required": [
     "usedTokens",
     "reservedTokens",
     "limitTokens",
     "resetsAt",
     "cacheOnly"
    ],
    "properties": {
     "usedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "reservedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "limitTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "resetsAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "cacheOnly": {
      "type": "boolean"
     },
     "cacheOnlyScope": {
      "type": "string",
      "enum": [
       "project",
       "tenant"
      ]
     },
     "warning": {
      "type": "boolean",
      "description": "At or above the first warning percentage — the bar turns amber."
     }
    }
   },
   "AssistCompensationRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "receiptId"
    ],
    "properties": {
     "receiptId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "AssistConversation": {
    "type": "object",
    "required": [
     "id",
     "audience",
     "scope",
     "messages"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "scope": {
      "$ref": "#/components/schemas/AssistScope"
     },
     "memorySegments": {
      "type": "array",
      "maxItems": 100,
      "description": "The memory segments that the member narrowed this conversation to (F-AST-10.R13); absent when not narrowed.",
      "items": {
       "$ref": "#/components/schemas/MemorySegmentRef"
      }
     },
     "messages": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/AssistMessage"
      }
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "searchUnavailable": {
      "$ref": "#/components/schemas/AssistSearchNotice"
     }
    }
   },
   "AssistConversationStart": {
    "type": "object",
    "additionalProperties": false,
    "description": "Optional body of startAssistConversation (Spec BF-3). Earlier clients send no body.",
    "properties": {
     "memorySegments": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/MemorySegmentKey"
      }
     }
    }
   },
   "AssistDecisionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "decision",
     "proposalVersion",
     "digest"
    ],
    "properties": {
     "decision": {
      "type": "string",
      "enum": [
       "approve",
       "reject"
      ]
     },
     "proposalVersion": {
      "type": "integer",
      "minimum": 1
     },
     "digest": {
      "$ref": "#/components/schemas/Sha256Hex"
     },
     "note": {
      "type": "string",
      "maxLength": 1000
     }
    }
   },
   "AssistDecisionResult": {
    "type": "object",
    "required": [
     "decisionId",
     "proposalId",
     "proposalVersion",
     "decision",
     "decidedBy",
     "decidedAt"
    ],
    "properties": {
     "decisionId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "proposalId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "proposalVersion": {
      "type": "integer",
      "minimum": 1
     },
     "decision": {
      "type": "string",
      "enum": [
       "approve",
       "reject"
      ]
     },
     "decidedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "validUntil": {
      "$ref": "#/components/schemas/Instant"
     },
     "runStatus": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "outcome": {
      "type": "string",
      "enum": [
       "executed",
       "refused",
       "rejected"
      ],
      "description": "XM-1805 — for an `assistant.write` only, what the replay of the operation as the person did (F-AST-23)."
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "receipt": {
      "$ref": "#/components/schemas/AssistantReceipt"
     },
     "refusal": {
      "$ref": "#/components/schemas/AssistantRefusal"
     }
    }
   },
   "AssistMessage": {
    "type": "object",
    "required": [
     "role",
     "id",
     "createdAt"
    ],
    "properties": {
     "role": {
      "type": "string",
      "enum": [
       "question",
       "answer"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "text": {
      "type": "string",
      "maxLength": 100000,
      "description": "A question's prompt or a chip label; an answer's text only while released or not_required and its evidence still validates."
     },
     "suggestionId": {
      "type": "string",
      "enum": [
       "sprint_summary",
       "release_notes",
       "over_estimate"
      ]
     },
     "clientMessageId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{8,128}$",
      "description": "A question's own key as the SPA sent it (its `clientMessageId`, unique per conversation) — the SPA matches its pending question to the stored one before the run is known (CG-25). Questions only."
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "status": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "sources": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AssistSource"
      }
     },
     "end": {
      "$ref": "#/components/schemas/AssistRunEnd"
     },
     "unavailable": {
      "$ref": "#/components/schemas/AssistUnavailableReason"
     },
     "cached": {
      "type": "boolean"
     },
     "generatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "replyTo": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "AssistOperationRefusal": {
    "type": "object",
    "description": "G208: why the public operation refused a confirmed assistant write — the status, the problem code and each field error's pointer and code (RFC 9457 `errors[]`); never a value and never the module's words. A refused receipt keeps it.",
    "required": [
     "status",
     "fields"
    ],
    "properties": {
     "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
     },
     "code": {
      "type": "string",
      "maxLength": 100
     },
     "fields": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "pointer",
        "code"
       ],
       "properties": {
        "pointer": {
         "type": "string",
         "maxLength": 200
        },
        "code": {
         "type": "string",
         "maxLength": 100
        }
       }
      }
     }
    }
   },
   "AssistProposalItemView": {
    "type": "object",
    "required": [
     "itemNo",
     "target",
     "after"
    ],
    "properties": {
     "itemNo": {
      "type": "integer",
      "minimum": 1
     },
     "target": {
      "type": "string",
      "maxLength": 200
     },
     "targetVersion": {
      "type": "integer",
      "minimum": 1
     },
     "before": {
      "type": "object",
      "description": "The current values as this reviewer may see them; masked fields absent."
     },
     "after": {
      "type": "object"
     },
     "receipt": {
      "$ref": "#/components/schemas/AssistReceiptView"
     }
    }
   },
   "AssistProposalReview": {
    "type": "object",
    "required": [
     "proposalId",
     "runId",
     "version",
     "action",
     "digest",
     "state",
     "items",
     "recipients",
     "audience",
     "expiresAt",
     "project",
     "initiatedBy",
     "can"
    ],
    "properties": {
     "proposalId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "action": {
      "$ref": "#/components/schemas/AssistActionKey"
     },
     "digest": {
      "$ref": "#/components/schemas/Sha256Hex"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "approved",
       "rejected",
       "expired",
       "stale",
       "superseded",
       "void",
       "withdrawn"
      ]
     },
     "summary": {
      "type": "string",
      "maxLength": 500,
      "description": "The assistant's own words — untrusted, shown as plain text."
     },
     "items": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/AssistProposalItemView"
      }
     },
     "recipients": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "string",
       "maxLength": 120
      }
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "sideEffects": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "type": "string",
       "maxLength": 200
      }
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "project": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "initiatedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "decision": {
      "$ref": "#/components/schemas/AssistDecisionResult"
     },
     "projectName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "F-AST-13.R15 (XM-1274, G-AI-13) — \"… in Orbit web shop\"."
     },
     "proposedBy": {
      "$ref": "#/components/schemas/AssistProposer"
     },
     "reviewers": {
      "type": "array",
      "maxItems": 6,
      "description": "F-AST-13.R15 (G-AI-12) — the eligible reviewers fixed at creation (R05), after erasure removals (R14).",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "agentText": {
      "type": "string",
      "maxLength": 2000,
      "description": "F-AST-19.R11 — an agent's own words (a comment body); untrusted, shown as plain text. Only for proposedBy.kind agent (XM-1800)."
     },
     "supersededBy": {
      "$ref": "#/components/schemas/Uuid"
     },
     "can": {
      "type": "object",
      "required": [
       "approve",
       "reject"
      ],
      "properties": {
       "approve": {
        "type": "boolean"
       },
       "reject": {
        "type": "boolean"
       },
       "stepUp": {
        "type": "string",
        "enum": [
         "none",
         "standard_tenant",
         "strict_tenant"
        ]
       },
       "renew": {
        "type": "boolean",
        "description": "F-AST-15.R04 — \"Prepare again\" (expired, stale or withdrawn; the run's actor or a reviewer; the run awaits approval)."
       },
       "startAgain": {
        "type": "boolean",
        "description": "F-AST-13.R18 — \"Start again\" (rejected, the run's latest proposal, not started again; the run's actor or an Admin)."
       }
      }
     }
    }
   },
   "AssistProposer": {
    "type": "object",
    "description": "F-AST-13.R15 (G-AI-11) — who proposed the change. assistant = a workflow run (its initiator is the member, or an automation rule's owner); agent = an agent identity acting for its owner (F-AST-19; XM-1800).",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "assistant",
       "agent"
      ]
     },
     "initiator": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "agentName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "onBehalfOf": {
      "$ref": "#/components/schemas/MemberRef"
     }
    }
   },
   "AssistQuestionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "conversationId",
     "clientMessageId"
    ],
    "properties": {
     "conversationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "clientMessageId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9._:-]+$",
      "description": "Must equal the Idempotency-Key header (09 §9.1)."
     },
     "prompt": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
     },
     "suggestionId": {
      "type": "string",
      "enum": [
       "sprint_summary",
       "release_notes",
       "over_estimate"
      ]
     }
    },
    "example": {
     "conversationId": "0193f6c2-7a10-7c4e-9a51-700000000001",
     "clientMessageId": "0193f6c2-7a10-7c4e-9a51-760000000002",
     "prompt": "What is blocking the client approvals epic?"
    }
   },
   "AssistReceiptView": {
    "type": "object",
    "required": [
     "receiptId",
     "action",
     "state",
     "committedAt"
    ],
    "properties": {
     "receiptId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "action": {
      "$ref": "#/components/schemas/AssistActionKey"
     },
     "state": {
      "type": "string",
      "enum": [
       "committed",
       "refused"
      ]
     },
     "refusal": {
      "type": "string",
      "enum": [
       "target_changed",
       "forbidden",
       "approval_expired",
       "action_disabled",
       "owner_refused"
      ]
     },
     "refusalDetail": {
      "$ref": "#/components/schemas/AssistOperationRefusal"
     },
     "result": {
      "type": "string",
      "maxLength": 200,
      "description": "The result as the reader may see it, e.g. ORB-141 — absent when the reader cannot see the target."
     },
     "target": {
      "type": "object",
      "description": "XM-1830 (G-AUP-20; F-AST-12 §13 \"Produced item\"; owner, register §230 add. 103 Q2 C): the item the committed action produced or changed — its kind and the owner's reference (a ticket key, a message id) in the run's project. The client makes the address; the server sends no href. The same readers as result, and only while THIS reader may see the produced item now (G103 L3; result the same); absent for a refused receipt.",
      "required": [
       "kind",
       "ref"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "ticket",
         "message"
        ]
       },
       "ref": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       }
      }
     },
     "compensatedBy": {
      "$ref": "#/components/schemas/Uuid"
     },
     "compensable": {
      "type": "boolean"
     },
     "committedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "compensation": {
      "type": "object",
      "description": "XM-1256 (G-AUP-22; F-AST-15 §13 \"Undo proposed … waiting for approval\", \"Undone by Lena Ruiz · 14:10\"): the newest compensation run that names this receipt — open while it waits or runs, ended after; the member who asked for it. The same readers as result.",
      "required": [
       "runId",
       "status"
      ],
      "properties": {
       "runId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "status": {
        "$ref": "#/components/schemas/AssistRunStatusValue"
       },
       "requestedBy": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "endedAt": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     }
    }
   },
   "AssistRunCancelled": {
    "type": "object",
    "description": "The cancel intent is recorded (CG-26) — the run's status and status version after it; the run's events and snapshot report the end.",
    "required": [
     "runId",
     "status",
     "version"
    ],
    "properties": {
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "status": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AssistRunEnd": {
    "type": "object",
    "x-sse-event": "run.end",
    "required": [
     "status"
    ],
    "properties": {
     "status": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "stopReason": {
      "$ref": "#/components/schemas/AssistStopReason"
     },
     "code": {
      "type": "string",
      "maxLength": 80
     },
     "retryable": {
      "type": "boolean"
     }
    }
   },
   "AssistRunEventEnvelope": {
    "type": "object",
    "description": "One stored event in the paged JSON form of GET …/events; the SSE form carries the same id, event and data.",
    "required": [
     "id",
     "event",
     "data"
    ],
    "properties": {
     "id": {
      "type": "integer",
      "minimum": 1
     },
     "event": {
      "type": "string",
      "enum": [
       "run.status",
       "step",
       "plan",
       "text.delta",
       "citation",
       "proposal",
       "proposal.decided",
       "usage",
       "budget",
       "run.end",
       "unavailable",
       "resync",
       "choices",
       "links",
       "refusal",
       "receipt",
       "answer.redacted",
       "follow_ups"
      ]
     },
     "data": {
      "type": "object",
      "description": "One of the AssistRun* schemas, by event."
     }
    }
   },
   "AssistRunHistoryRow": {
    "type": "object",
    "required": [
     "runId",
     "workflow",
     "status",
     "createdAt",
     "startedBy"
    ],
    "properties": {
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "workflow": {
      "$ref": "#/components/schemas/AssistWorkflowKey"
     },
     "intendedOutcome": {
      "type": "string",
      "maxLength": 300
     },
     "status": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "outcome": {
      "$ref": "#/components/schemas/AssistRunOutcome"
     },
     "pendingDecision": {
      "type": "boolean"
     },
     "receiptCount": {
      "type": "integer",
      "minimum": 0
     },
     "startedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "completedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "AssistRunOutcome": {
    "type": "string",
    "enum": [
     "answered",
     "all_applied",
     "partially_applied",
     "nothing_applied"
    ]
   },
   "AssistRunProposal": {
    "type": "object",
    "x-sse-event": "proposal",
    "required": [
     "proposalId",
     "version",
     "action",
     "digest",
     "summary",
     "targets",
     "recipients",
     "expiresAt"
    ],
    "properties": {
     "proposalId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "action": {
      "$ref": "#/components/schemas/AssistActionKey"
     },
     "digest": {
      "$ref": "#/components/schemas/Sha256Hex"
     },
     "summary": {
      "type": "string",
      "maxLength": 500
     },
     "targets": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "string",
       "maxLength": 200,
       "description": "The target labels the reader may see (ticket keys, the project key)."
      }
     },
     "recipients": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "string",
       "maxLength": 120
      }
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "kind": {
      "type": "string",
      "enum": [
       "assistant_write"
      ],
      "description": "XM-1805 — present only on the assistant's confirmed write; the card's fields come from getAssistantProposalCard."
     },
     "state": {
      "type": "string",
      "maxLength": 20,
      "description": "XM-1805 — the proposal's state when the event was written (assistant_write only)."
     },
     "routing": {
      "type": "string",
      "enum": [
       "inline",
       "approvers"
      ],
      "description": "XM-1805 — inline is the person's own Confirm in the panel; approvers is the approval inbox."
     },
     "verb": {
      "type": "string",
      "maxLength": 80,
      "description": "XM-1805 — the action's own words (\"Create ticket\"), never the model's."
     }
    }
   },
   "AssistRunRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "workflow",
     "projectKey"
    ],
    "properties": {
     "workflow": {
      "$ref": "#/components/schemas/AssistWorkflowKey"
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "conversationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "prompt": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
     },
     "suggestionId": {
      "type": "string",
      "enum": [
       "sprint_summary",
       "release_notes",
       "over_estimate"
      ]
     },
     "params": {
      "type": "object",
      "description": "The workflow's typed input (context §3.14); unknown members refused."
     },
     "approvers": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "AssistRunSnapshot": {
    "type": "object",
    "description": "The observe projection of a run (05 §10.1); never conversation text for a reader other than the run's actor.",
    "required": [
     "runId",
     "workflow",
     "status",
     "version",
     "cached",
     "sequence",
     "sources",
     "steps",
     "receipts",
     "can"
    ],
    "properties": {
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "workflow": {
      "$ref": "#/components/schemas/AssistWorkflowKey"
     },
     "intendedOutcome": {
      "type": "string",
      "maxLength": 300
     },
     "status": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "outcome": {
      "$ref": "#/components/schemas/AssistRunOutcome"
     },
     "cached": {
      "type": "boolean"
     },
     "messageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "blockedReason": {
      "$ref": "#/components/schemas/AssistBlockedReason"
     },
     "waitingForSlot": {
      "type": "boolean",
      "description": "Queued behind other runs of the tenant or the asker — a wait, never an error."
     },
     "runsAhead": {
      "type": "integer",
      "minimum": 0,
      "description": "G-AUP-03 (XM-1256; F-AST-12 §13 \"Waiting for a free slot — N runs ahead\"): the tenant's waiting runs before this one in (queuedAt, id) order. Only while waitingForSlot; never for a client guest's run (G103 L4: other people's activity)."
     },
     "sequence": {
      "type": "integer",
      "minimum": 0,
      "description": "The last event sequence included; continue the stream with after=sequence."
     },
     "text": {
      "type": "string",
      "maxLength": 100000
     },
     "unavailable": {
      "$ref": "#/components/schemas/AssistUnavailableReason"
     },
     "sources": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AssistSource"
      }
     },
     "evidence": {
      "type": "array",
      "maxItems": 100,
      "description": "XM-1256 (G-AUP-05; F-AST-12.R10; G103 H1, M1, M2, L2; SR-AST-1): the run's sources from its evidence manifests, one per source, re-checked for this reader on every read. The run's actor gets a source that no longer validates as a row with kind and unavailable only (\"This part is no longer available\"); every other reader never gets a hidden source (no row, no count). The title is the reader's own projection now. cited goes to the actor only. A ticket row's revision (a hash of its title and description) goes to a reader other than the actor only when that reader's mask shows both (G103 R1). A chat run (a run with a conversation) gives evidence to its actor only (F-AST-12.R05).",
      "items": {
       "type": "object",
       "required": [
        "kind",
        "unavailable"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "ticket",
          "doc_page",
          "repository_file",
          "merge_request",
          "attachment",
          "message",
          "help_desk_request"
         ]
        },
        "id": {
         "type": "string",
         "maxLength": 200
        },
        "key": {
         "type": "string",
         "maxLength": 200
        },
        "title": {
         "type": "string",
         "maxLength": 200
        },
        "cited": {
         "type": "boolean"
        },
        "unavailable": {
         "type": "boolean"
        },
        "revision": {
         "type": "string",
         "maxLength": 200
        }
       }
      }
     },
     "plan": {
      "type": "array",
      "maxItems": 20,
      "description": "XM-1256 (G-AUP-04; F-AST-12 §13 \"Running\"): the step manifest of the run's pinned workflow version in graph order, each step with the event name it reports — the steps still to come show before they start.",
      "items": {
       "type": "object",
       "required": [
        "stepId",
        "name"
       ],
       "properties": {
        "stepId": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,39}$"
        },
        "name": {
         "type": "string",
         "enum": [
          "searching_sources",
          "reading_work",
          "writing",
          "preparing_changes",
          "waiting_for_approval",
          "applying_changes",
          "finishing"
         ]
        }
       }
      }
     },
     "steps": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AssistRunStep"
      }
     },
     "pendingProposal": {
      "$ref": "#/components/schemas/AssistRunProposal"
     },
     "receipts": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/AssistReceiptView"
      }
     },
     "artifacts": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "object",
       "required": [
        "kind",
        "text"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "summary",
          "rationale",
          "client_update_draft"
         ]
        },
        "text": {
         "type": "string",
         "maxLength": 20000
        }
       }
      }
     },
     "end": {
      "$ref": "#/components/schemas/AssistRunEnd"
     },
     "applying": {
      "type": "object",
      "description": "XM-1830 (G-AUP-21; F-AST-14 §13 \"Applying changes · 2 of 5 done\" and UX-18 \"Stop applying the remaining 3 changes?\"): while the run is running, its newest approved proposal's items (total) and those with a receipt (done). Absent when nothing is left to apply.",
      "required": [
       "done",
       "total"
      ],
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": "integer",
        "minimum": 1
       }
      }
     },
     "linkedRunId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "startedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "approvers": {
      "type": "array",
      "maxItems": 5,
      "description": "G-AUP-06 (XM-1256; F-AST-13 §13 \"approvers: Lena Ruiz, Maya Castillo\"): the run's named approvers who may decide its proposals now (eligible now, never the initiator), the same set that a new proposal names. Absent when the run names none.",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "can": {
      "type": "object",
      "required": [
       "cancel",
       "retry"
      ],
      "properties": {
       "cancel": {
        "type": "boolean"
       },
       "retry": {
        "type": "boolean"
       },
       "renew": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "AssistRunStatusValue": {
    "type": "string",
    "enum": [
     "queued",
     "running",
     "awaiting_approval",
     "cancelling",
     "completed",
     "cancelled",
     "failed",
     "expired",
     "withheld"
    ]
   },
   "AssistRunStep": {
    "type": "object",
    "x-sse-event": "step",
    "required": [
     "stepId",
     "name",
     "state"
    ],
    "properties": {
     "stepId": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,39}$"
     },
     "name": {
      "type": "string",
      "enum": [
       "searching_sources",
       "reading_work",
       "writing",
       "preparing_changes",
       "waiting_for_approval",
       "applying_changes",
       "finishing"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "started",
       "completed",
       "failed",
       "waiting"
      ]
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "XM-1256 (G-AUP-04) — in the snapshot only, the time of the step's first event."
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "XM-1256 (G-AUP-04) — in the snapshot only, the time of the step's completed or failed event."
     },
     "count": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1256 (G-AUP-04b; G103 L1) — in the snapshot only, the count of the step's line for THIS reader, which the client words per name: the sources of the step (the actor: every admitted source; another reader: the sources that validate for that reader; none on a chat run for a reader other than its actor), the items of the step's newest proposal (only for a reader whose mask shows every item), the run's receipts (applying_changes). Counts only, never a title."
     }
    }
   },
   "AssistScope": {
    "type": "object",
    "description": "The derived sources the scope line names (BR-ProjectChat-01; D-101).",
    "required": [
     "tickets",
     "docs",
     "repositories",
     "messages"
    ],
    "properties": {
     "tickets": {
      "type": "boolean"
     },
     "docs": {
      "type": "boolean"
     },
     "messages": {
      "type": "boolean"
     },
     "repositories": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "name",
        "host"
       ],
       "properties": {
        "name": {
         "type": "string",
         "maxLength": 120
        },
        "host": {
         "type": "string",
         "maxLength": 253
        }
       }
      }
     }
    }
   },
   "AssistSearchNotice": {
    "type": "object",
    "description": "Present only while this deployment cannot search project content (no configured embedder, F-AST-03.R15). The fixed sentence of the code in the reader's language; the same text as the refusal of the action (403 assist.project_search_unavailable).",
    "required": [
     "code",
     "title",
     "detail"
    ],
    "properties": {
     "code": {
      "type": "string",
      "enum": [
       "assist.project_search_unavailable"
      ]
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "detail": {
      "type": "string",
      "maxLength": 400
     }
    }
   },
   "AssistSource": {
    "type": "object",
    "description": "A source chip (09 §6.3); one per cited entity; never a URL into the SPA.",
    "required": [
     "kind",
     "title"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "ticket",
       "doc_page",
       "repository_file",
       "merge_request",
       "attachment",
       "message",
       "help_desk_request",
       "knowledge_item"
      ]
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "repository": {
      "type": "string",
      "maxLength": 120
     },
     "path": {
      "type": "string",
      "maxLength": 500
     },
     "ref": {
      "type": "string",
      "maxLength": 40,
      "example": "!212"
     },
     "lines": {
      "type": "object",
      "required": [
       "start",
       "end"
      ],
      "properties": {
       "start": {
        "type": "integer",
        "minimum": 1
       },
       "end": {
        "type": "integer",
        "minimum": 1
       }
      }
     },
     "url": {
      "type": "string",
      "format": "uri",
      "description": "Only for repository files and merge requests, on the connected provider's host."
     },
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "conversationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "messageId": {
      "$ref": "#/components/schemas/Uuid"
     }
    },
    "example": {
     "kind": "ticket",
     "key": "ORB-124",
     "title": "Design the approval experience"
    }
   },
   "AssistStartedRun": {
    "type": "object",
    "required": [
     "runId",
     "status",
     "eventsUrl"
    ],
    "properties": {
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "status": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "eventsUrl": {
      "type": "string",
      "pattern": "^/api/v1/assist/runs/[0-9a-f-]{36}/events$"
     },
     "conversationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "messageId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "AssistStopReason": {
    "type": "string",
    "enum": [
     "end_turn",
     "max_tokens",
     "refusal",
     "cancelled"
    ]
   },
   "AssistSuggestion": {
    "type": "object",
    "required": [
     "id",
     "label",
     "enabled"
    ],
    "properties": {
     "id": {
      "type": "string",
      "enum": [
       "sprint_summary",
       "release_notes",
       "over_estimate"
      ]
     },
     "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Summarise sprint 14"
     },
     "enabled": {
      "type": "boolean",
      "description": "false in cache-only mode (D-044)."
     }
    }
   },
   "AssistUnavailableReason": {
    "type": "string",
    "enum": [
     "source_unavailable",
     "not_released",
     "access_changed"
    ]
   },
   "AssistWorkflowKey": {
    "type": "string",
    "enum": [
     "project_question",
     "project_summary",
     "work_triage",
     "client_update",
     "compensation",
     "request_triage",
     "agent_action"
    ]
   },
   "AssistWorkflowOption": {
    "type": "object",
    "required": [
     "workflow",
     "version",
     "title",
     "description",
     "proposes",
     "params",
     "available"
    ],
    "properties": {
     "workflow": {
      "$ref": "#/components/schemas/AssistWorkflowKey"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "title": {
      "type": "string",
      "maxLength": 80
     },
     "description": {
      "type": "string",
      "maxLength": 300
     },
     "proposes": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "$ref": "#/components/schemas/AssistActionKey"
      }
     },
     "params": {
      "type": "object",
      "description": "The JSON Schema of the workflow's input, for the start form."
     },
     "available": {
      "type": "boolean"
     },
     "unavailableReason": {
      "type": "string",
      "enum": [
       "action_disabled",
       "capability_missing",
       "audience",
       "search_unavailable"
      ]
     },
     "searchUnavailable": {
      "$ref": "#/components/schemas/AssistSearchNotice"
     },
     "initiatorMayApprove": {
      "type": "boolean"
     }
    }
   },
   "AssistantBudget": {
    "type": "object",
    "required": [
     "usedTokens",
     "reservedTokens",
     "limitTokens",
     "resetsAt",
     "exhausted"
    ],
    "properties": {
     "usedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "reservedTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "limitTokens": {
      "$ref": "#/components/schemas/AiTokenCount"
     },
     "resetsAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "exhausted": {
      "type": "boolean",
      "description": "The person's line is used up: the next question is refused (429 budget.exhausted, scope member). It is true also when a turn could not reserve and nothing was booked, so usedTokens can be below limitTokens. A raised limit ends it at once (F-AST-21.R06; owner, 29 November 2026: \"Yes, \"Limit reached\" (Recommended)\")."
     }
    }
   },
   "AssistantCardField": {
    "type": "object",
    "description": "One leaf of the write's body. `value` is always the full text: a boolean \"Yes\"/\"No\", a list's items joined with \", \" (\"None\" when empty), rich text as its full plain text (a mention \"@<name>\", a ticket reference \"#KEY\"), a JSON Merge Patch null \"Clear <field>\".",
    "required": [
     "path",
     "label",
     "kind",
     "value",
     "isDefault"
    ],
    "properties": {
     "path": {
      "type": "string",
      "description": "The leaf in the body, e.g. `description`, `customFields.budget`, `items[1].title`."
     },
     "label": {
      "type": "string",
      "description": "The leaf in words, e.g. \"Custom fields › Budget\"."
     },
     "kind": {
      "type": "string",
      "enum": [
       "text",
       "number",
       "boolean",
       "list",
       "richText",
       "cleared"
      ]
     },
     "value": {
      "type": "string"
     },
     "isDefault": {
      "type": "boolean"
     },
     "previous": {
      "type": "string",
      "description": "G254 (owner's UI re-test of 30 November 2026, cases 85–87) — the value of a top-level field of the target ticket before the change, in the same words as `value` (\"high\" before \"urgent\"), from the person's own read of the ticket just before the card. Absent when the read showed no value. The panel shows \"high → urgent\"; the history's card line keeps it as `before`, so an undo knows it."
     },
     "items": {
      "type": "array",
      "description": "Kind `list` only — every item in full.",
      "items": {
       "type": "string"
      }
     },
     "links": {
      "type": "array",
      "description": "Kind `richText` only — every link mark, in order; each href is a Youniton path.",
      "items": {
       "type": "object",
       "required": [
        "text",
        "href"
       ],
       "properties": {
        "text": {
         "type": "string"
        },
        "href": {
         "type": "string",
         "pattern": "^/(?!/)"
        }
       }
      }
     },
     "refs": {
      "type": "array",
      "description": "G90 R2 — the ids of the field resolved to the names the person reads (an assignee, a reporter, labels, a sprint, a stage, files): `value` (and `items` of a list) are the names; each ref keeps its id, in the same order. An id that does not resolve refuses the proposal.",
      "items": {
       "type": "object",
       "required": [
        "id",
        "kind",
        "name"
       ],
       "properties": {
        "id": {
         "type": "string"
        },
        "kind": {
         "type": "string",
         "enum": [
          "member",
          "label",
          "sprint",
          "stage",
          "file"
         ]
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "mentions": {
      "type": "array",
      "description": "Kind `richText` only — every mention, with the name the person sees.",
      "items": {
       "type": "object",
       "required": [
        "memberId",
        "name"
       ],
       "properties": {
        "memberId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "name": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "AssistantChoices": {
    "type": "object",
    "required": [
     "question",
     "field",
     "options"
    ],
    "properties": {
     "question": {
      "type": "string",
      "maxLength": 300
     },
     "field": {
      "type": "string",
      "maxLength": 40
     },
     "options": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "label",
        "value"
       ],
       "properties": {
        "label": {
         "type": "string",
         "maxLength": 120
        },
        "value": {
         "type": "string",
         "maxLength": 100
        }
       }
      }
     }
    }
   },
   "AssistantConversation": {
    "type": "object",
    "required": [
     "id",
     "startedAt",
     "version",
     "turns"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "G256 (F-AST-21.R12) — the conversation version (also the ETag); every person turn increments it. \"Edit message\" sends it as If-Match."
     },
     "turns": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/AssistantTurn"
      }
     }
    }
   },
   "AssistantFieldForm": {
    "type": "object",
    "description": "G208 (owner, 29 Nov 2026, \"Small form in the chat (Recommended)\"; \"Form → Continue → Create card (Recommended)\"): the required fields of the project's Create form that the assistant's create left empty, read AS THE PERSON (getProjectFieldSchema: required, in the create form, editable, no default) — names and definitions only, never a value. The panel shows one input per field with its help text; \"Continue\" sends the values as the person's next chat message, and the usual card shows the whole create before \"Create ticket\". Only on the assistant turn that asked for them.",
    "required": [
     "projectKey",
     "fields"
    ],
    "properties": {
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$",
      "description": "The project of the create that needs the fields (a member field lists this project's people, not the page's)."
     },
     "fields": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AssistantFormField"
      }
     }
    }
   },
   "AssistantFormField": {
    "type": "object",
    "required": [
     "key",
     "label",
     "type"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/CustomFieldKey"
     },
     "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "type": {
      "$ref": "#/components/schemas/CustomFieldTypeKey"
     },
     "help": {
      "type": "string",
      "maxLength": 200,
      "description": "The field's description (its help text), as the Create dialog shows it."
     },
     "options": {
      "type": "array",
      "maxItems": 50,
      "description": "The active options of a single or multi select, in their order.",
      "items": {
       "type": "object",
       "required": [
        "id",
        "label"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "label": {
         "type": "string",
         "minLength": 1,
         "maxLength": 60
        }
       }
      }
     },
     "limits": {
      "type": "object",
      "description": "The type's limits from its configuration (CustomFieldConfigView); members not of the type are absent.",
      "properties": {
       "maxLength": {
        "type": "integer",
        "minimum": 1,
        "maximum": 10000
       },
       "scale": {
        "type": "integer",
        "minimum": 0,
        "maximum": 4
       },
       "min": {
        "type": "string",
        "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,4})?$"
       },
       "max": {
        "type": "string",
        "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,4})?$"
       },
       "maxSelections": {
        "type": "integer",
        "minimum": 1,
        "maximum": 20
       }
      }
     }
    }
   },
   "AssistantLink": {
    "type": "object",
    "required": [
     "label",
     "place",
     "href"
    ],
    "properties": {
     "label": {
      "type": "string",
      "maxLength": 120
     },
     "place": {
      "type": "string",
      "maxLength": 200
     },
     "href": {
      "type": "string",
      "maxLength": 300,
      "description": "A Youniton path (starts with one slash); never an external URL."
     }
    }
   },
   "AssistantMessageEditRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "text",
     "context"
    ],
    "description": "G256 (F-AST-21.R12) — the new words of an earlier person message and the page they were written on; no choice.",
    "properties": {
     "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
     },
     "context": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "routeId"
      ],
      "properties": {
       "routeId": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9-]{0,59}$"
       },
       "projectKey": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "ticketKey": {
        "type": "string",
        "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}-[1-9][0-9]{0,6}$"
       }
      }
     }
    }
   },
   "AssistantMessageRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "text",
     "context"
    ],
    "properties": {
     "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
     },
     "context": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "routeId"
      ],
      "properties": {
       "routeId": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9-]{0,59}$"
       },
       "projectKey": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "ticketKey": {
        "type": "string",
        "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}-[1-9][0-9]{0,6}$"
       }
      }
     },
     "choice": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "field",
       "value"
      ],
      "properties": {
       "field": {
        "type": "string",
        "maxLength": 40
       },
       "value": {
        "type": "string",
        "maxLength": 100
       }
      }
     }
    }
   },
   "AssistantMessageStarted": {
    "type": "object",
    "required": [
     "runId",
     "messageId",
     "replyId",
     "conversationId",
     "status",
     "eventsUrl"
    ],
    "properties": {
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "messageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "replyId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "conversationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "status": {
      "$ref": "#/components/schemas/AssistRunStatusValue"
     },
     "eventsUrl": {
      "type": "string"
     }
    }
   },
   "AssistantProposalCard": {
    "type": "object",
    "required": [
     "proposalId",
     "runId",
     "version",
     "action",
     "kind",
     "digest",
     "state",
     "expiresAt",
     "decidable",
     "assistant"
    ],
    "properties": {
     "proposalId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "action": {
      "type": "string",
      "enum": [
       "assistant.write"
      ]
     },
     "kind": {
      "type": "string",
      "enum": [
       "assistant_write"
      ]
     },
     "digest": {
      "$ref": "#/components/schemas/Sha256Hex"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "approved",
       "rejected",
       "expired",
       "stale",
       "superseded",
       "void",
       "withdrawn"
      ]
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decidable": {
      "type": "boolean"
     },
     "assistant": {
      "type": "object",
      "description": "The EXACT write (security review G90 H1; SR-AST-1): one field per leaf of the canonical body that the digest binds and the replay sends — no field cap and no cut. A write that the card cannot show in full is refused before it is proposed (`assist.write_not_displayable`); rich text that links outside Youniton too (`assist.write_external_link`).",
      "required": [
       "title",
       "verb",
       "scopeLabel",
       "actingAs",
       "clientVisible",
       "fields",
       "routing"
      ],
      "properties": {
       "title": {
        "type": "string",
        "maxLength": 400
       },
       "verb": {
        "type": "string",
        "maxLength": 40
       },
       "scopeLabel": {
        "type": "string",
        "maxLength": 300
       },
       "actingAs": {
        "type": "string",
        "maxLength": 200
       },
       "clientVisible": {
        "type": "boolean",
        "description": "True when the body has `thread` \"client\" or `clientVisible` true at any depth, or when the target (a ticket) is visible to the client now, read as the person (G90 R1) — show \"Visible to the client\" first."
       },
       "routing": {
        "type": "string",
        "enum": [
         "inline",
         "approvers"
        ]
       },
       "fields": {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/AssistantCardField"
        }
       }
      }
     },
     "form": {
      "type": "object",
      "description": "G208 (owner, 29 Nov 2026: \"click and view default view of the Ticket … but filled with the values\"): the stored call of a create that the application's standard form can open (\"Open in form\") — the operation, its project and the body exactly as the card shows it (the digest bound it). Only for its own person (the card's reader); only for `createTicket`; only for a create that was NOT done (its receipt refused; G218: never for a created, pending, expired or cancelled one). The form saves through the normal operation as the person, with its own new Idempotency-Key.",
      "required": [
       "operationId",
       "projectKey",
       "body"
      ],
      "properties": {
       "operationId": {
        "type": "string",
        "enum": [
         "createTicket"
        ]
       },
       "projectKey": {
        "type": "string",
        "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
       },
       "body": {
        "type": "object",
        "additionalProperties": true
       }
      }
     }
    }
   },
   "AssistantReceipt": {
    "type": "object",
    "required": [
     "label",
     "href",
     "detail"
    ],
    "properties": {
     "label": {
      "type": "string",
      "maxLength": 200
     },
     "href": {
      "type": "string",
      "maxLength": 300
     },
     "detail": {
      "type": "string",
      "maxLength": 300
     }
    }
   },
   "AssistantRefusal": {
    "type": "object",
    "required": [
     "title",
     "reason"
    ],
    "properties": {
     "title": {
      "type": "string",
      "maxLength": 120
     },
     "reason": {
      "type": "string",
      "maxLength": 300
     }
    }
   },
   "AssistantStep": {
    "type": "object",
    "required": [
     "stepId",
     "name",
     "state"
    ],
    "description": "Run event `step`, schema v3 (agreed with the run view, G-AUP-04) — server words and counts, never item text.",
    "properties": {
     "stepId": {
      "type": "string",
      "maxLength": 40
     },
     "name": {
      "type": "string",
      "maxLength": 40
     },
     "state": {
      "type": "string",
      "enum": [
       "started",
       "completed",
       "failed",
       "waiting"
      ]
     },
     "label": {
      "type": "string",
      "maxLength": 120
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "detail": {
      "type": "string",
      "maxLength": 120
     },
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "code": {
      "type": "string",
      "maxLength": 60
     }
    }
   },
   "AssistantTurn": {
    "type": "object",
    "required": [
     "messageId",
     "role",
     "createdAt",
     "text"
    ],
    "properties": {
     "messageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "role": {
      "type": "string",
      "enum": [
       "person",
       "assistant"
      ]
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "text": {
      "type": "string",
      "maxLength": 100000,
      "description": "The person's words, or the assistant's released words (so far, while the reply runs)."
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "ok",
       "cancelled",
       "error",
       "withheld"
      ]
     },
     "steps": {
      "type": "array",
      "maxItems": 30,
      "items": {
       "$ref": "#/components/schemas/AssistantStep"
      }
     },
     "choices": {
      "$ref": "#/components/schemas/AssistantChoices"
     },
     "links": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/AssistantLink"
      }
     },
     "refusal": {
      "$ref": "#/components/schemas/AssistantRefusal"
     },
     "receipt": {
      "$ref": "#/components/schemas/AssistantReceipt"
     },
     "followUps": {
      "type": "array",
      "description": "G188 (F-AST-21.R09) — the released suggested follow-ups of a plain answer; absent when there are none and beside a proposal.",
      "minItems": 1,
      "maxItems": 3,
      "items": {
       "type": "string",
       "minLength": 1,
       "maxLength": 80
      }
     },
     "replyTo": {
      "$ref": "#/components/schemas/Uuid",
      "description": "G188 (F-AST-21.R10) — an assistant turn's person message; a retried answer has the same replyTo as the answer it follows."
     },
     "editable": {
      "type": "boolean",
      "description": "G256 (F-AST-21.R12) — a person turn only; true for a typed message (not a suggestion chip) among the person's last 20, which \"Edit message\" may take."
     },
     "form": {
      "$ref": "#/components/schemas/AssistantFieldForm"
     },
     "proposal": {
      "type": "object",
      "required": [
       "id",
       "runId",
       "state",
       "routing",
       "decidedByMe",
       "verb"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "runId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "state": {
        "type": "string",
        "enum": [
         "pending",
         "approved",
         "rejected",
         "expired",
         "stale",
         "superseded",
         "void",
         "withdrawn"
        ]
       },
       "routing": {
        "type": "string",
        "enum": [
         "inline",
         "approvers"
        ]
       },
       "decidedAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "decidedByMe": {
        "type": "boolean"
       },
       "verb": {
        "type": "string",
        "maxLength": 40
       }
      }
     }
    }
   },
   "AttachmentCreateRequest": {
    "type": "object",
    "required": [
     "fileId"
    ],
    "additionalProperties": false,
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "sharing": {
      "type": "string",
      "enum": [
       "internal",
       "shared_with_client"
      ],
      "default": "internal"
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "AttachmentSharingRequest": {
    "type": "object",
    "required": [
     "sharing",
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "sharing": {
      "type": "string",
      "enum": [
       "internal",
       "shared_with_client"
      ]
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "AttachmentView": {
    "type": "object",
    "required": [
     "id",
     "fileId",
     "name",
     "sizeBytes",
     "mimeType",
     "sharing",
     "owner",
     "uploadedBy",
     "uploadedAt",
     "status",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "example": "approval-flow-v2.png"
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 262144000
     },
     "mimeType": {
      "type": "string",
      "maxLength": 127
     },
     "durationSeconds": {
      "type": "integer",
      "minimum": 0
     },
     "sharing": {
      "type": "string",
      "enum": [
       "internal",
       "shared_with_client"
      ]
     },
     "owner": {
      "type": "string",
      "enum": [
       "ticket",
       "comment"
      ]
     },
     "commentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "uploadedBy": {
      "$ref": "#/components/schemas/CommentAuthorView"
     },
     "uploadedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "scanning",
       "ready",
       "quarantined"
      ],
      "description": "Files' status, read live."
     },
     "previews": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "type": "string",
       "enum": [
        "thumb",
        "view"
       ]
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "setSharing",
       "remove"
      ],
      "properties": {
       "setSharing": {
        "type": "boolean"
       },
       "remove": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "AudienceEpoch": {
    "type": "integer",
    "minimum": 1,
    "example": 1
   },
   "AuditActorView": {
    "type": "object",
    "required": [
     "kind",
     "label"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "client",
       "operator",
       "system",
       "automation",
       "service"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid",
      "description": "absent for an operator — the tenant never reads the platform's OperatorId (D-038; F-PLT-13.R16; XM-997)"
     },
     "label": {
      "type": "string",
      "maxLength": 120,
      "example": "Maya Castillo",
      "description": "for an operator always \"Youniton support\", never the operator's own name (F-PLT-13.R16; register §230 add. 2, Q19 (a))"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "roleLabel": {
      "type": "string",
      "maxLength": 60,
      "example": "Admin",
      "description": "absent for an operator — no operator role reaches the tenant (F-PLT-13.R16; register §230 add. 2, Q19 (a))"
     },
     "initials": {
      "type": "string",
      "maxLength": 2
     },
     "onBehalfOf": {
      "$ref": "#/components/schemas/TypedRef"
     }
    }
   },
   "AuditCategoryView": {
    "type": "object",
    "required": [
     "code",
     "label",
     "types"
    ],
    "properties": {
     "code": {
      "type": "string",
      "maxLength": 40
     },
     "label": {
      "type": "string",
      "maxLength": 60,
      "example": "Members and roles"
     },
     "types": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "type": "object",
       "required": [
        "type",
        "displayName"
       ],
       "properties": {
        "type": {
         "type": "string",
         "maxLength": 80
        },
        "displayName": {
         "type": "string",
         "maxLength": 80
        }
       }
      }
     }
    }
   },
   "AuditEventDetail": {
    "type": "object",
    "required": [
     "row",
     "prose",
     "record",
     "actions"
    ],
    "properties": {
     "row": {
      "$ref": "#/components/schemas/AuditEventRow"
     },
     "prose": {
      "type": "string",
      "maxLength": 1000,
      "example": "The Client role may now see monthly totals under Time & reports. Daily entries and hourly rates stay hidden. Affects 12 client accounts in 1 project."
     },
     "record": {
      "$ref": "#/components/schemas/AuditRecordDocument"
     },
     "actions": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "type": "object",
       "required": [
        "kind",
        "label"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "open_target",
          "affected_members"
         ]
        },
        "label": {
         "type": "string",
         "maxLength": 60,
         "example": "Open role"
        },
        "target": {
         "$ref": "#/components/schemas/TypedRef"
        },
        "affected": {
         "type": "object",
         "properties": {
          "roleId": {
           "$ref": "#/components/schemas/Uuid"
          },
          "projectId": {
           "$ref": "#/components/schemas/Uuid"
          },
          "memberIds": {
           "type": "array",
           "maxItems": 100,
           "items": {
            "$ref": "#/components/schemas/Uuid"
           }
          }
         }
        }
       }
      }
     },
     "locationAttribution": {
      "$ref": "#/components/schemas/GeoAttributionView"
     },
     "prompt": {
      "type": "object",
      "description": "For a sensitive ai.prompt record only — whether \"Show prompt\" finds its text (F-AUD-02.R07; XM-155). Never the text.",
      "required": [
       "state"
      ],
      "properties": {
       "state": {
        "type": "string",
        "enum": [
         "available",
         "expired",
         "erased",
         "not_logged",
         "unavailable"
        ]
       }
      }
     }
    }
   },
   "AuditEventRow": {
    "type": "object",
    "required": [
     "id",
     "occurredAt",
     "type",
     "displayName",
     "category",
     "actor",
     "summary",
     "failure",
     "severity"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "occurredAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "type": {
      "type": "string",
      "maxLength": 80,
      "example": "role.permission_changed"
     },
     "displayName": {
      "type": "string",
      "maxLength": 80,
      "example": "Role changed"
     },
     "category": {
      "type": "string",
      "enum": [
       "members_and_roles",
       "client_sharing",
       "security",
       "integrations",
       "ai",
       "support_access",
       "projects_and_boards",
       "relationships",
       "messaging",
       "automation",
       "finance"
      ]
     },
     "actor": {
      "$ref": "#/components/schemas/AuditActorView"
     },
     "target": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "summary": {
      "type": "string",
      "maxLength": 500,
      "example": "Client: Time & reports → monthly totals"
     },
     "request": {
      "$ref": "#/components/schemas/AuditRequestView"
     },
     "failure": {
      "type": "boolean"
     },
     "sensitive": {
      "type": "boolean"
     },
     "severity": {
      "type": "string",
      "enum": [
       "info",
       "notice",
       "critical"
      ],
      "description": "From the event registry's severity rule (F-AUD-01.R12; XM-996), never from the record."
     }
    }
   },
   "AuditExportRequest": {
    "type": "object",
    "required": [
     "filters"
    ],
    "additionalProperties": false,
    "properties": {
     "filters": {
      "$ref": "#/components/schemas/AuditFilterEcho"
     },
     "includePrompts": {
      "type": "boolean",
      "default": false
     }
    }
   },
   "AuditFilterEcho": {
    "type": "object",
    "additionalProperties": false,
    "description": "The tenant log's filters (F-AUD-03.R02): the tenant export's body and the `audit.AuditExported` record's echo. No other key: the backend refuses an unknown filter name (for example `tenantId` or `operatorId`) with 422 validation.failed on `filters`. In the body, `from` and `to` are two dates (a custom range of whole days) or two instants (the window `[from, to)`); the record always echoes the resolved instants (XM-556 REV-XM556-02). No member is null. The record always echoes `actor`, `period`, `from` and `to`; it echoes `category`, `type` and `q` only when the export was sent them (XM-567).",
    "properties": {
     "actor": {
      "type": "string",
      "maxLength": 60,
      "description": "anyone, operators, system, or member:<id>"
     },
     "category": {
      "type": "string",
      "maxLength": 40
     },
     "type": {
      "type": "string",
      "maxLength": 80
     },
     "period": {
      "$ref": "#/components/schemas/AuditPeriodKind"
     },
     "from": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "$ref": "#/components/schemas/Instant"
       }
      ],
      "maxLength": 40
     },
     "to": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "$ref": "#/components/schemas/Instant"
       }
      ],
      "maxLength": 40
     },
     "q": {
      "type": "string",
      "maxLength": 120
     }
    }
   },
   "AuditListMeta": {
    "type": "object",
    "required": [
     "page",
     "matching",
     "retentionDays",
     "retainedFor"
    ],
    "properties": {
     "page": {
      "$ref": "#/components/schemas/CursorPageMeta"
     },
     "matching": {
      "type": "object",
      "required": [
       "count",
       "capped"
      ],
      "properties": {
       "count": {
        "type": "integer",
        "minimum": 0
       },
       "capped": {
        "type": "boolean",
        "description": "True when more than 100,000 events match; the count is then 100,000."
       }
      }
     },
     "retentionDays": {
      "type": "integer",
      "minimum": 30,
      "maximum": 3650
     },
     "retainedFor": {
      "type": "string",
      "maxLength": 40,
      "example": "5 years"
     },
     "exportNotice": {
      "type": "boolean",
      "description": "True when retention is under a year (\"Export before events expire\")."
     },
     "locationAttribution": {
      "$ref": "#/components/schemas/GeoAttributionView"
     },
     "pendingRetention": {
      "type": "object",
      "description": "Only during the 30-day grace after a shortening (F-AUD-01.R02, R13; F-AUD-05.R02, R07; XM-1127): the shorter retention, the instant it takes over, and the instant before which records are past it then (the first nightly purge after `from` removes them). Absent when no shorter value is pending.",
      "required": [
       "days",
       "retainedFor",
       "from",
       "removesBefore"
      ],
      "properties": {
       "days": {
        "type": "integer",
        "minimum": 30,
        "maximum": 3650
       },
       "retainedFor": {
        "type": "string",
        "maxLength": 40,
        "example": "1 year"
       },
       "from": {
        "$ref": "#/components/schemas/Instant"
       },
       "removesBefore": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "seenCursor": {
      "type": "string",
      "maxLength": 512,
      "description": "Only on the tenant log's first batch (no page cursor) with at least one row (F-AUD-01.R14; XM-1136, XM-1155): an opaque, sealed cursor of the reader's mark in the recording order, bound to the tenant, the reader and the filters. Send it as `seen` to `GET /audit-events/new-count`."
     }
    }
   },
   "AuditNewEventCount": {
    "type": "object",
    "required": [
     "count",
     "capped"
    ],
    "description": "The number of records of the tenant log, under the list's filters, that the log recorded after the reader read the list's first batch, whatever their time (F-AUD-01.R14; XM-1136, XM-1155). Exact up to 100; above 100 the count is 100 and `capped` is true.",
    "properties": {
     "count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "capped": {
      "type": "boolean",
      "description": "True when more than 100 records are new; the count is then 100."
     }
    }
   },
   "AuditPeriodKind": {
    "type": "string",
    "enum": [
     "last_7",
     "last_30",
     "last_90",
     "custom"
    ],
    "description": "The Period filter (F-AUD-01.R05, F-AUD-06.R05): the last 7, 30 (the default) or 90 days up to now, or a custom range. There is no \"all time\"."
   },
   "AuditPromptContent": {
    "type": "object",
    "description": "The prompt text behind an ai.prompt record while it exists in Assist's store, otherwise its state (F-AUD-02.R07; XM-155).",
    "required": [
     "state"
    ],
    "properties": {
     "state": {
      "type": "string",
      "enum": [
       "available",
       "expired",
       "erased",
       "not_logged",
       "unavailable"
      ]
     },
     "text": {
      "type": "string",
      "maxLength": 4000,
      "description": "Only when state is available."
     }
    }
   },
   "AuditRecordDocument": {
    "type": "object",
    "description": "The structured record — fixed envelope plus the type's payload keys (FN-AdminAudit-18).",
    "required": [
     "event",
     "eventId",
     "time",
     "actor",
     "source",
     "schemaVersion"
    ],
    "properties": {
     "event": {
      "type": "string",
      "maxLength": 80
     },
     "eventId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "time": {
      "type": "string",
      "format": "date-time",
      "example": "2026-10-17T14:32:08+03:00"
     },
     "actor": {
      "type": "string",
      "maxLength": 254,
      "example": "maya.castillo@northwind.com"
     },
     "actorRole": {
      "type": "string",
      "maxLength": 60
     },
     "target": {
      "type": "string",
      "maxLength": 120,
      "example": "role:client"
     },
     "ip": {
      "type": "string",
      "maxLength": 45
     },
     "location": {
      "type": "string",
      "maxLength": 80
     },
     "userAgent": {
      "type": "string",
      "maxLength": 120
     },
     "source": {
      "type": "string",
      "maxLength": 120
     },
     "supportGrantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "schemaVersion": {
      "type": "integer",
      "minimum": 1
     },
     "payload": {
      "type": "object",
      "maxProperties": 30,
      "additionalProperties": true,
      "description": "Event-specific keys per the registry's payload schema (permission, before, after, affected …); never a secret."
     }
    }
   },
   "AuditRequestView": {
    "type": "object",
    "required": [
     "source"
    ],
    "description": "The request context. For an operator actor, `ip`, `location` and `userAgent` are absent while owner question Q29 has answer (a) (F-PLT-13.R16 item 3; XM-997).",
    "properties": {
     "ip": {
      "type": "string",
      "maxLength": 45,
      "example": "81.7.12.44"
     },
     "location": {
      "type": "string",
      "maxLength": 80,
      "example": "Vilnius, LT"
     },
     "userAgent": {
      "type": "string",
      "maxLength": 120,
      "example": "Chrome 130 · macOS 15"
     },
     "source": {
      "type": "string",
      "maxLength": 120,
      "example": "web · Roles & access"
     }
    }
   },
   "AuthenticatorConfirmRequest": {
    "type": "object",
    "required": [
     "enrolmentId",
     "code"
    ],
    "additionalProperties": false,
    "properties": {
     "enrolmentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "code": {
      "type": "string",
      "pattern": "^[0-9]{6}$",
      "writeOnly": true
     }
    }
   },
   "AuthenticatorSetup": {
    "type": "object",
    "required": [
     "enrolmentId",
     "otpauthUri",
     "qrSvg",
     "setupKey",
     "expiresAt",
     "replaces"
    ],
    "properties": {
     "enrolmentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "otpauthUri": {
      "type": "string",
      "maxLength": 512
     },
     "qrSvg": {
      "type": "string",
      "maxLength": 65536
     },
     "setupKey": {
      "type": "string",
      "pattern": "^([A-Z2-7]{4} ){7}[A-Z2-7]{4}$"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "replaces": {
      "type": "boolean",
      "description": "True when an active authenticator exists and will be replaced."
     }
    }
   },
   "AutomationActionSpec": {
    "type": "object",
    "required": [
     "action",
     "params"
    ],
    "properties": {
     "action": {
      "type": "string",
      "maxLength": 60,
      "example": "ticket.move_to_stage_kind"
     },
     "params": {
      "type": "object",
      "additionalProperties": true,
      "description": "Typed by the action's parameter schema in GET /automation/schema."
     },
     "onFailure": {
      "type": "string",
      "enum": [
       "stop",
       "continue"
      ],
      "default": "stop"
     }
    }
   },
   "AutomationAiBlockStateView": {
    "type": "object",
    "required": [
     "stepId",
     "state",
     "decisions",
     "agreements"
    ],
    "properties": {
     "stepId": {
      "type": "string",
      "maxLength": 40
     },
     "state": {
      "type": "string",
      "enum": [
       "shadow",
       "live",
       "off"
      ]
     },
     "shadowEndsAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decisions": {
      "type": "integer",
      "minimum": 0
     },
     "agreements": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "AutomationApprovalDecisionInput": {
    "type": "object",
    "required": [
     "decision",
     "proposalSha256"
    ],
    "additionalProperties": false,
    "properties": {
     "decision": {
      "type": "string",
      "enum": [
       "approve",
       "reject"
      ]
     },
     "proposalSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     }
    }
   },
   "AutomationApprovalItemView": {
    "type": "object",
    "required": [
     "stepId",
     "action",
     "clientSees"
    ],
    "properties": {
     "stepId": {
      "type": "string",
      "maxLength": 40
     },
     "action": {
      "type": "string",
      "maxLength": 60
     },
     "target": {
      "type": "string",
      "maxLength": 200,
      "example": "ORB-R311"
     },
     "predictedEffect": {
      "type": "string",
      "maxLength": 300
     },
     "renderedText": {
      "type": "string",
      "maxLength": 10000
     },
     "clientSees": {
      "type": "boolean"
     },
     "aiMade": {
      "type": "boolean",
      "description": "True when an AI block wrote the text. The screen shows it as untrusted."
     },
     "hidden": {
      "type": "boolean",
      "description": "XM-1293 (F-AUT-20.R13, \"hidden equals missing\"): the reader may not see the target; target, predictedEffect and renderedText are absent, and can.approve is false (target_hidden)."
     }
    }
   },
   "AutomationApprovalView": {
    "type": "object",
    "required": [
     "id",
     "rule",
     "runId",
     "state",
     "revision",
     "summary",
     "items",
     "expiresAt",
     "proposalSha256",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "rule": {
      "type": "object",
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "approved",
       "rejected",
       "expired",
       "stale",
       "void"
      ]
     },
     "revision": {
      "type": "integer",
      "minimum": 1
     },
     "summary": {
      "type": "string",
      "maxLength": 2000
     },
     "items": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/AutomationApprovalItemView"
      }
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decidedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "proposalSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "properties": {
       "approve": {
        "type": "boolean"
       },
       "reject": {
        "type": "boolean"
       },
       "reason": {
        "type": "string",
        "enum": [
         "initiator",
         "not_eligible",
         "target_hidden",
         "owner_lost",
         "not_pending"
        ],
        "description": "XM-1293 (G-AUA-10): why the reader cannot approve now. initiator: the reader started the run and automation.approvals.initiatorMayApprove is off (F-AUT-20.R28)."
       }
      }
     },
     "subject": {
      "type": "string",
      "maxLength": 300,
      "description": "XM-1293 (G-AUA-10): the run's subject in words through the reader's own access (\"ORB-125 · Checkout: saved cards\"); absent when hidden."
     },
     "stepTitle": {
      "type": "string",
      "maxLength": 200,
      "description": "XM-1293 (G-AUA-10): the approval step's title."
     },
     "requestedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "approvers": {
      "type": "object",
      "description": "XM-1293 (G-AUA-10): the approvers as the block names them; count is the number of eligible people fixed at the freeze (F-AUT-20.R05).",
      "required": [
       "kind",
       "members",
       "count"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "members",
         "capability"
        ]
       },
       "members": {
        "type": "array",
        "maxItems": 5,
        "items": {
         "$ref": "#/components/schemas/MemberRef"
        }
       },
       "capability": {
        "type": "string",
        "maxLength": 40
       },
       "count": {
        "type": "integer",
        "minimum": 0,
        "maximum": 50
       }
      }
     },
     "ownerLost": {
      "type": "boolean",
      "description": "XM-1293 (G-AUA-10; F-AUT-20.R10): the flow's binding is revoked; an approve answers 409 automation_approval.binding_revoked."
     }
    }
   },
   "AutomationBlockView": {
    "type": "object",
    "required": [
     "key",
     "version",
     "label",
     "pickerGroup",
     "ports",
     "paramsSchema",
     "outputs",
     "sideEffectClass",
     "permitted",
     "executable"
    ],
    "properties": {
     "executable": {
      "type": "boolean",
      "description": "False when the block has no handler yet. A draft can name it, and it cannot activate (F-AUT-13.R24, R25)."
     },
     "key": {
      "type": "string",
      "maxLength": 40
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "label": {
      "type": "string",
      "maxLength": 120
     },
     "description": {
      "type": "string",
      "maxLength": 300
     },
     "pickerGroup": {
      "type": "string",
      "enum": [
       "do",
       "connect",
       "decide",
       "ai",
       "person",
       "handoff",
       "wait",
       "flow"
      ]
     },
     "ports": {
      "type": "array",
      "maxItems": 27,
      "items": {
       "type": "string",
       "maxLength": 60
      }
     },
     "paramsSchema": {
      "type": "object",
      "additionalProperties": true
     },
     "outputs": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/AutomationFlowField"
      }
     },
     "sideEffectClass": {
      "type": "string",
      "enum": [
       "none",
       "internal",
       "client_exposure",
       "external",
       "ai"
      ]
     },
     "permitted": {
      "type": "boolean"
     },
     "unavailableReason": {
      "type": "string",
      "enum": [
       "module",
       "plan",
       "flag",
       "scope",
       "setting"
      ]
     },
     "systemPrompt": {
      "type": "string",
      "maxLength": 4000,
      "description": "The read-only system part of an AI block's prompt. The editor shows it and never sends it back."
     }
    }
   },
   "AutomationConditionNode": {
    "type": "object",
    "description": "A group (all or any) of nodes, or a leaf; depth ≤ 3 and ≤ 20 leaves in a definition.",
    "properties": {
     "all": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AutomationConditionNode"
      }
     },
     "any": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AutomationConditionNode"
      }
     },
     "attribute": {
      "type": "string",
      "maxLength": 60,
      "example": "ticket.stage_kind"
     },
     "fieldKey": {
      "type": "string",
      "maxLength": 60
     },
     "operator": {
      "type": "string",
      "enum": [
       "is",
       "is_not",
       "in",
       "not_in",
       "contains",
       "is_empty",
       "gt",
       "gte",
       "lt",
       "lte",
       "within_days",
       "changed",
       "changed_to",
       "changed_from"
      ]
     },
     "operand": {
      "description": "A literal, a list of ≤ 100 literals, or the tokens owner and actor."
     },
     "withheld": {
      "type": "string",
      "enum": [
       "field_not_visible"
      ],
      "description": "Present instead of the leaf when the reader cannot see it."
     }
    }
   },
   "AutomationDryRunRequest": {
    "type": "object",
    "required": [
     "target",
     "sample"
    ],
    "additionalProperties": false,
    "properties": {
     "target": {
      "type": "string",
      "enum": [
       "draft",
       "active"
      ]
     },
     "sample": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "eventId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "subject": {
        "$ref": "#/components/schemas/TypedRef"
       }
      }
     }
    }
   },
   "AutomationDryRunResult": {
    "type": "object",
    "required": [
     "id",
     "target",
     "triggerMatches",
     "conditions",
     "actions",
     "simulatedAs"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "target": {
      "type": "string",
      "enum": [
       "draft",
       "active"
      ]
     },
     "simulatedAs": {
      "type": "string",
      "enum": [
       "requester",
       "owner"
      ]
     },
     "triggerMatches": {
      "type": "boolean"
     },
     "conditions": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "pointer",
        "result"
       ],
       "properties": {
        "pointer": {
         "type": "string",
         "maxLength": 200
        },
        "attribute": {
         "type": "string",
         "maxLength": 60
        },
        "operator": {
         "type": "string",
         "maxLength": 20
        },
        "value": {
         "description": "The subject value, or {\"withheld\": \"not_visible\"}."
        },
        "result": {
         "type": "boolean"
        }
       }
      }
     },
     "actions": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "object",
       "required": [
        "index",
        "action",
        "decision"
       ],
       "properties": {
        "index": {
         "type": "integer",
         "minimum": 0,
         "maximum": 9
        },
        "action": {
         "type": "string",
         "maxLength": 60
        },
        "decision": {
         "type": "string",
         "enum": [
          "allowed",
          "refused"
         ]
        },
        "reason": {
         "type": "string",
         "maxLength": 60
        },
        "target": {
         "type": "string",
         "maxLength": 200,
         "example": "ORB-125"
        },
        "predictedEffect": {
         "type": "string",
         "maxLength": 300,
         "example": "ORB-125: In progress → In review"
        },
        "renderedText": {
         "type": "string",
         "maxLength": 4000
        },
        "payload": {
         "type": "object",
         "additionalProperties": true,
         "description": "The webhook payload with placeholder signature headers; withheld fields shown as {\"withheld\": \"not_visible\"}."
        },
        "withheldPlaceholders": {
         "type": "array",
         "maxItems": 50,
         "items": {
          "type": "string",
          "maxLength": 80
         }
        }
       }
      }
     }
    }
   },
   "AutomationFlowDefinition": {
    "type": "object",
    "required": [
     "schema",
     "trigger",
     "steps",
     "options"
    ],
    "additionalProperties": false,
    "properties": {
     "schema": {
      "type": "integer",
      "enum": [
       2
      ]
     },
     "trigger": {
      "$ref": "#/components/schemas/AutomationFlowTrigger"
     },
     "admission": {
      "$ref": "#/components/schemas/AutomationConditionNode"
     },
     "steps": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/AutomationFlowStep"
      }
     },
     "options": {
      "type": "object",
      "required": [
       "maxRunDays"
      ],
      "properties": {
       "allowSelfTrigger": {
        "type": "boolean",
        "default": false
       },
       "notifyOwnerOnFailure": {
        "type": "boolean",
        "default": true
       },
       "onRetry": {
        "type": "string",
        "enum": [
         "continue",
         "recheck_conditions"
        ],
        "default": "continue"
       },
       "maxRunDays": {
        "type": "integer",
        "minimum": 1,
        "maximum": 30,
        "default": 30
       }
      }
     },
     "layout": {
      "type": "object",
      "description": "A3 (XM-962; owner §223 add. 59): the saved box positions in grid units, one per box (`start` = the start box). A position of a step that is not in the tree is dropped at save; absent when no box was moved (and after Tidy up). Layout data only: the executor never reads it.",
      "additionalProperties": false,
      "properties": {
       "positions": {
        "type": "array",
        "maxItems": 201,
        "items": {
         "type": "object",
         "required": [
          "stepId",
          "x",
          "y"
         ],
         "additionalProperties": false,
         "properties": {
          "stepId": {
           "type": "string",
           "pattern": "^(start|[a-z][a-z0-9-]{0,39})$"
          },
          "x": {
           "type": "integer",
           "minimum": -10000,
           "maximum": 10000
          },
          "y": {
           "type": "integer",
           "minimum": -10000,
           "maximum": 10000
          }
         }
        }
       }
      }
     }
    }
   },
   "AutomationFlowField": {
    "type": "object",
    "required": [
     "name",
     "type"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,39}$"
     },
     "label": {
      "type": "string",
      "maxLength": 80
     },
     "type": {
      "type": "string",
      "enum": [
       "text",
       "number",
       "boolean",
       "date",
       "list",
       "person",
       "choice",
       "ticket",
       "knowledge_item"
      ]
     },
     "itemType": {
      "type": "string",
      "enum": [
       "text",
       "number",
       "boolean",
       "date",
       "person",
       "choice",
       "ticket",
       "knowledge_item"
      ],
      "description": "The element type of a list (F-AUT-16.R01). A field of type list must name it."
     },
     "required": {
      "type": "boolean",
      "default": false
     },
     "teamOnly": {
      "type": "boolean",
      "default": true,
      "description": "RV-RUN-02. True is the default for a value from outside. A false value lets the value reach a client after its checks."
     }
    }
   },
   "AutomationFlowPath": {
    "type": "object",
    "required": [
     "port",
     "steps"
    ],
    "additionalProperties": false,
    "properties": {
     "port": {
      "type": "string",
      "maxLength": 60,
      "example": "unsure"
     },
     "label": {
      "type": "string",
      "maxLength": 80
     },
     "steps": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/AutomationFlowStep"
      }
     }
    }
   },
   "AutomationFlowRunStatusKey": {
    "type": "string",
    "description": "The status of a run for the flow screens. It adds waiting to AutomationRunStatusKey. A built status field reads running for a waiting run.",
    "enum": [
     "pending",
     "running",
     "waiting",
     "succeeded",
     "partially_failed",
     "failed",
     "stopped",
     "skipped",
     "refused",
     "expired"
    ]
   },
   "AutomationFlowRunStep": {
    "type": "object",
    "required": [
     "sequence",
     "stepId",
     "block",
     "status"
    ],
    "properties": {
     "sequence": {
      "type": "integer",
      "minimum": 0
     },
     "stepId": {
      "type": "string",
      "maxLength": 40
     },
     "iterationPath": {
      "type": "string",
      "maxLength": 200
     },
     "block": {
      "type": "string",
      "maxLength": 40
     },
     "status": {
      "$ref": "#/components/schemas/AutomationFlowStepStatusKey"
     },
     "reason": {
      "type": "string",
      "maxLength": 60
     },
     "attempts": {
      "type": "integer",
      "minimum": 0
     },
     "port": {
      "type": "string",
      "maxLength": 60
     },
     "result": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decision": {
      "type": "object",
      "required": [
       "kind",
       "result"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "rule",
         "ai",
         "shadow",
         "person"
        ]
       },
       "result": {
        "type": "string",
        "maxLength": 120
       },
       "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
       },
       "threshold": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
       },
       "modelRef": {
        "type": "string",
        "maxLength": 120
       },
       "inputDigest": {
        "type": "string",
        "pattern": "^[0-9a-f]{64}$"
       },
       "optionOrderDigest": {
        "type": "string",
        "pattern": "^[0-9a-f]{64}$"
       },
       "personChose": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "wait": {
      "type": "object",
      "required": [
       "kind",
       "wakeAt"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "delay",
         "until",
         "event",
         "approval",
         "task",
         "ai_run",
         "sub_flow"
        ]
       },
       "wakeAt": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "variables": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "name",
        "type",
        "audience",
        "untrusted"
       ],
       "properties": {
        "name": {
         "type": "string",
         "maxLength": 81
        },
        "type": {
         "type": "string",
         "maxLength": 20
        },
        "audience": {
         "type": "string",
         "enum": [
          "team",
          "client_safe"
         ]
        },
        "untrusted": {
         "type": "boolean"
        },
        "value": {
         "description": "The value as the reader may read it; {\"withheld\": \"not_visible\"} otherwise; absent after the data retention."
        }
       }
      }
     }
    }
   },
   "AutomationFlowSchemaView": {
    "type": "object",
    "required": [
     "grammarVersion",
     "blocks",
     "triggers",
     "actions",
     "limits"
    ],
    "properties": {
     "grammarVersion": {
      "type": "integer",
      "minimum": 2
     },
     "blocks": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "$ref": "#/components/schemas/AutomationBlockView"
      }
     },
     "triggers": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "type": "object",
       "required": [
        "key",
        "label",
        "source",
        "outputs",
        "available"
       ],
       "properties": {
        "key": {
         "type": "string",
         "maxLength": 60
        },
        "label": {
         "type": "string",
         "maxLength": 120
        },
        "source": {
         "type": "string",
         "enum": [
          "event",
          "schedule",
          "inbound",
          "mail",
          "manual"
         ]
        },
        "outputs": {
         "type": "array",
         "maxItems": 50,
         "items": {
          "$ref": "#/components/schemas/AutomationFlowField"
         }
        },
        "available": {
         "type": "boolean"
        },
        "unavailableReason": {
         "type": "string",
         "enum": [
          "module",
          "plan",
          "flag",
          "scope",
          "setting",
          "not_built"
         ]
        }
       }
      }
     },
     "actions": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "key",
        "label",
        "pickerGroup",
        "sideEffectClass",
        "approvalOnly",
        "paramsSchema",
        "permitted",
        "executable"
       ],
       "properties": {
        "key": {
         "type": "string",
         "maxLength": 60
        },
        "label": {
         "type": "string",
         "maxLength": 120
        },
        "pickerGroup": {
         "type": "string",
         "enum": [
          "do",
          "connect"
         ]
        },
        "sideEffectClass": {
         "type": "string",
         "enum": [
          "internal",
          "client_exposure",
          "external",
          "ai"
         ]
        },
        "approvalOnly": {
         "type": "boolean"
        },
        "paramsSchema": {
         "type": "object",
         "additionalProperties": true
        },
        "permitted": {
         "type": "boolean"
        },
        "executable": {
         "type": "boolean",
         "description": "False when the entry has no handler yet (F-AUT-13.R25)."
        }
       }
      }
     },
     "limits": {
      "type": "object",
      "required": [
       "maxSteps",
       "maxNesting",
       "maxRunDays"
      ],
      "properties": {
       "maxSteps": {
        "type": "integer",
        "minimum": 1
       },
       "maxNesting": {
        "type": "integer",
        "minimum": 1
       },
       "maxRunDays": {
        "type": "integer",
        "minimum": 1,
        "maximum": 30
       },
       "detailsMaxChars": {
        "type": "integer",
        "minimum": 1
       },
       "questionMaxChars": {
        "type": "integer",
        "minimum": 1
       }
      }
     }
    }
   },
   "AutomationFlowStartInput": {
    "type": "object",
    "required": [
     "inputs"
    ],
    "additionalProperties": false,
    "properties": {
     "inputs": {
      "type": "object",
      "maxProperties": 20,
      "additionalProperties": true
     }
    }
   },
   "AutomationFlowStep": {
    "type": "object",
    "required": [
     "id",
     "block",
     "v",
     "title",
     "short",
     "params"
    ],
    "additionalProperties": false,
    "properties": {
     "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{0,39}$",
      "example": "approve-reply"
     },
     "block": {
      "type": "string",
      "maxLength": 40,
      "example": "ai_decision"
     },
     "v": {
      "type": "integer",
      "minimum": 1
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "short": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "params": {
      "type": "object",
      "additionalProperties": true,
      "description": "Typed by the block's parameter schema in GET /automation/flow-schema."
     },
     "paths": {
      "type": "array",
      "maxItems": 26,
      "items": {
       "$ref": "#/components/schemas/AutomationFlowPath"
      }
     },
     "onFailure": {
      "type": "string",
      "enum": [
       "stop",
       "continue",
       "path"
      ],
      "default": "stop"
     }
    }
   },
   "AutomationFlowStepStatusKey": {
    "type": "string",
    "enum": [
     "pending",
     "waiting",
     "succeeded",
     "skipped",
     "refused",
     "failed"
    ]
   },
   "AutomationFlowTemplateView": {
    "type": "object",
    "required": [
     "key",
     "group",
     "name",
     "description",
     "goal",
     "scopes",
     "definition",
     "needs"
    ],
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 60,
      "example": "request_triage"
     },
     "group": {
      "type": "string",
      "enum": [
       "tickets",
       "helpdesk",
       "memory"
      ]
     },
     "name": {
      "type": "string",
      "maxLength": 120
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "goal": {
      "type": "string",
      "maxLength": 120
     },
     "scopes": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "$ref": "#/components/schemas/AutomationRuleScopeKey"
      }
     },
     "definition": {
      "$ref": "#/components/schemas/AutomationFlowDefinition"
     },
     "needs": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "string",
       "maxLength": 40
      },
      "description": "The keys of what the template needs (F-AUT-25.R01) — ai, ai_agent, approval, wait, for_each, ticket_query, human_task, ticket_types, help_desk, memory, memory_links (add-only)."
     },
     "unmetNeeds": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "string",
       "maxLength": 40
      },
      "description": "The needs that the scope does not meet now (F-AUT-25.R05): a module that is off, or a part that no package has built yet. The gallery shows them as the reason; creation does not fail."
     },
     "available": {
      "type": "boolean",
      "description": "True when no need is unmet and each part of the flow has its handler, so the draft can turn on as it is."
     }
    }
   },
   "AutomationFlowTestRequest": {
    "type": "object",
    "required": [
     "target",
     "mode",
     "sample"
    ],
    "additionalProperties": false,
    "properties": {
     "target": {
      "type": "string",
      "enum": [
       "draft",
       "active"
      ]
     },
     "mode": {
      "type": "string",
      "enum": [
       "dry_run",
       "test_run"
      ],
      "description": "dry_run: AI blocks use a pretend answer. test_run: AI blocks call the model; the budget is used. Neither writes an effect."
     },
     "sample": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "eventId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "subject": {
        "$ref": "#/components/schemas/TypedRef"
       },
       "payload": {
        "type": "object",
        "additionalProperties": true,
        "description": "A sample body for an inbound trigger, or the inputs for a manual trigger."
       }
      }
     },
     "pretend": {
      "type": "object",
      "maxProperties": 200,
      "additionalProperties": {
       "type": "string",
       "maxLength": 120
      },
      "description": "A chosen answer per step id. An AI block takes this choice or the value unsure; an approval takes approved, rejected or expired."
     }
    }
   },
   "AutomationFlowTestResult": {
    "type": "object",
    "required": [
     "id",
     "target",
     "mode",
     "simulatedAs",
     "triggerMatches",
     "steps",
     "sent"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "target": {
      "type": "string",
      "enum": [
       "draft",
       "active"
      ]
     },
     "mode": {
      "type": "string",
      "enum": [
       "dry_run",
       "test_run"
      ]
     },
     "simulatedAs": {
      "type": "string",
      "enum": [
       "requester",
       "owner"
      ]
     },
     "triggerMatches": {
      "type": "boolean"
     },
     "steps": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/AutomationFlowTestStep"
      }
     },
     "sent": {
      "type": "integer",
      "enum": [
       0
      ],
      "description": "Always zero. A test sends nothing."
     },
     "aiTokensUsed": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "AutomationFlowTestStep": {
    "type": "object",
    "required": [
     "stepId",
     "block",
     "state"
    ],
    "properties": {
     "stepId": {
      "type": "string",
      "maxLength": 40
     },
     "iterationPath": {
      "type": "string",
      "maxLength": 200
     },
     "block": {
      "type": "string",
      "maxLength": 40
     },
     "state": {
      "type": "string",
      "enum": [
       "taken",
       "skipped",
       "refused",
       "would_wait"
      ]
     },
     "port": {
      "type": "string",
      "maxLength": 60
     },
     "reason": {
      "type": "string",
      "maxLength": 60
     },
     "predictedEffect": {
      "type": "string",
      "maxLength": 300
     },
     "renderedText": {
      "type": "string",
      "maxLength": 4000
     },
     "ai": {
      "type": "object",
      "properties": {
       "source": {
        "type": "string",
        "enum": [
         "pretend",
         "model"
        ]
       },
       "answer": {
        "type": "string",
        "maxLength": 120
       },
       "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
       },
       "modelRef": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "withheld": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "string",
       "maxLength": 80
      }
     }
    }
   },
   "AutomationFlowTrigger": {
    "type": "object",
    "required": [
     "type"
    ],
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "event",
       "schedule",
       "webhook_inbound",
       "email_inbound",
       "manual"
      ]
     },
     "event": {
      "type": "string",
      "maxLength": 60
     },
     "where": {
      "type": "object",
      "maxProperties": 5,
      "additionalProperties": true
     },
     "schedule": {
      "$ref": "#/components/schemas/AutomationScheduleSpec"
     },
     "endpointId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "mailboxId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "payloadMode": {
      "type": "string",
      "enum": [
       "schema",
       "ai"
      ]
     },
     "fields": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/AutomationFlowField"
      }
     }
    }
   },
   "AutomationFlowView": {
    "type": "object",
    "required": [
     "rule",
     "definition",
     "shape",
     "validation",
     "aiBlocks",
     "can"
    ],
    "properties": {
     "rule": {
      "description": "The rule's summary and its description (F-AUT-13.R29): the canvas reads no GET /automation-rules/{ruleId} to show the flow's details.",
      "allOf": [
       {
        "$ref": "#/components/schemas/AutomationRuleSummary"
       },
       {
        "type": "object",
        "properties": {
         "description": {
          "type": "string",
          "maxLength": 500,
          "description": "The rule's description, as AutomationRuleView.description: present when the rule has one."
         }
        }
       }
      ]
     },
     "shape": {
      "type": "string",
      "enum": [
       "rule",
       "flow"
      ],
      "description": "rule: a stored schema 1 definition, shown through the upcaster. flow: a stored schema 2 definition."
     },
     "definition": {
      "$ref": "#/components/schemas/AutomationFlowDefinition"
     },
     "draft": {
      "$ref": "#/components/schemas/AutomationFlowDefinition"
     },
     "draftSavedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "draftSavedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "versionNote": {
      "type": "string",
      "maxLength": 300,
      "example": "Details of AI step \"category\" changed by Maya Castillo"
     },
     "validation": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/AutomationValidationSentence"
      }
     },
     "aiBlocks": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/AutomationAiBlockStateView"
      }
     },
     "waitingRuns": {
      "type": "integer",
      "minimum": 0
     },
     "can": {
      "type": "object",
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "activate": {
        "type": "boolean"
       },
       "enable": {
        "type": "boolean",
        "description": "True when the reader can turn a paused flow on again with its active version (EnableRule, F-AUT-05). The same decision as AutomationRuleView.can.enable."
       },
       "turnOffShadow": {
        "type": "boolean"
       },
       "test": {
        "type": "boolean"
       },
       "start": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "AutomationHumanTaskInput": {
    "type": "object",
    "required": [
     "values"
    ],
    "additionalProperties": false,
    "properties": {
     "values": {
      "type": "object",
      "maxProperties": 7,
      "additionalProperties": true
     }
    }
   },
   "AutomationHumanTaskView": {
    "type": "object",
    "required": [
     "id",
     "rule",
     "runId",
     "state",
     "form",
     "dueAt",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "rule": {
      "type": "object",
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "state": {
      "type": "string",
      "enum": [
       "open",
       "done",
       "expired",
       "void"
      ]
     },
     "form": {
      "type": "array",
      "maxItems": 7,
      "items": {
       "$ref": "#/components/schemas/AutomationFlowField"
      }
     },
     "dueAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "AutomationPauseReasonKey": {
    "type": "string",
    "enum": [
     "manual",
     "owner_lost_authority",
     "owner_unbound",
     "failure_threshold",
     "rate_limited",
     "dependency_missing",
     "support_restriction",
     "client_changed",
     "module_off"
    ],
    "description": "module_off (owner §223 add. 63 addition 2; A7, 22 Nov 2026): a module the rule needs was switched off for its project. A trigger or a step on a help-desk request (request.*, email.inbound, the helpdesk.* entries) needs Help desk (G-HD-13b, owner §230 add. 102)."
   },
   "AutomationRuleCreateInput": {
    "type": "object",
    "required": [
     "scope",
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "scope": {
      "$ref": "#/components/schemas/AutomationRuleScopeKey"
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "templateKey": {
      "$ref": "#/components/schemas/AutomationTemplateKey"
     },
     "templateVariant": {
      "type": "string",
      "enum": [
       "changes_requested"
      ]
     },
     "flowTemplateKey": {
      "type": "string",
      "maxLength": 60,
      "description": "A flow template of F-AUT-25 (package FLOW-12): the new rule's first draft is the template's schema 2 definition. Never together with templateKey or templateVariant (422 validation.failed). An unknown key answers 422 automation.grammar_invalid; a template of another scope answers 422 automation.scope_mismatch."
     }
    }
   },
   "AutomationRuleDefinition": {
    "type": "object",
    "required": [
     "schema",
     "trigger",
     "actions"
    ],
    "properties": {
     "schema": {
      "type": "integer",
      "enum": [
       1
      ]
     },
     "trigger": {
      "$ref": "#/components/schemas/AutomationTriggerSpec"
     },
     "conditions": {
      "$ref": "#/components/schemas/AutomationConditionNode"
     },
     "actions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/AutomationActionSpec"
      }
     },
     "options": {
      "type": "object",
      "properties": {
       "allowSelfTrigger": {
        "type": "boolean",
        "default": false
       },
       "notifyOwnerOnFailure": {
        "type": "boolean",
        "default": true
       },
       "onRetry": {
        "type": "string",
        "enum": [
         "continue",
         "recheck_conditions"
        ],
        "default": "continue"
       }
      }
     }
    }
   },
   "AutomationRuleScopeKey": {
    "type": "string",
    "enum": [
     "tenant",
     "project"
    ]
   },
   "AutomationRuleStatusKey": {
    "type": "string",
    "enum": [
     "draft",
     "enabled",
     "paused",
     "archived"
    ]
   },
   "AutomationRuleSummary": {
    "type": "object",
    "required": [
     "id",
     "scope",
     "name",
     "trigger",
     "status",
     "owner",
     "version",
     "createdBy"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "scope": {
      "$ref": "#/components/schemas/AutomationRuleScopeKey"
     },
     "project": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Move ticket to In review when a merge request is opened"
     },
     "trigger": {
      "type": "string",
      "maxLength": 120,
      "example": "A merge request opens"
     },
     "triggerType": {
      "type": "string",
      "enum": [
       "event",
       "schedule",
       "manual"
      ],
      "description": "The trigger's type for the row icon (owner, 22 Nov 2026, A1): manual = no trigger set up yet or a person starts it."
     },
     "status": {
      "$ref": "#/components/schemas/AutomationRuleStatusKey"
     },
     "pauseReason": {
      "$ref": "#/components/schemas/AutomationPauseReasonKey"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "activeVersion": {
      "type": "integer",
      "minimum": 1
     },
     "hasDraft": {
      "type": "boolean"
     },
     "templateKey": {
      "$ref": "#/components/schemas/AutomationTemplateKey"
     },
     "flowTemplateKey": {
      "type": "string",
      "maxLength": 60,
      "description": "The flow template of F-AUT-25 that the rule was created from (package FLOW-12). A rule from a flow template holds this key and omits templateKey."
     },
     "lastRun": {
      "type": "object",
      "properties": {
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "status": {
        "$ref": "#/components/schemas/AutomationRunStatusKey"
       }
      }
     },
     "failures7d": {
      "type": "integer",
      "minimum": 0
     },
     "definitionSchema": {
      "type": "integer",
      "enum": [
       1,
       2
      ],
      "description": "The schema of the rule's draft or active version: 2 when one of them is a flow (package FLOW-1 returns it on each summary). A value of 2 means that the rule opens on the canvas through GET /automation-rules/{ruleId}/flow, and GET /automation-rules/{ruleId} then omits activeDefinition and draft (F-AUT-13.R20)."
     },
     "can": {
      "type": "object",
      "description": "What the reader can do with the rule from its list row (G98, 27 November 2026). The API sends it on every summary.",
      "properties": {
       "runNow": {
        "type": "boolean",
        "description": "True when the reader manages the rule's scope, automation is available, the rule is enabled, and its active version runs on a schedule (a schema 1 rule or a flow on the schedule trigger). Then POST /automation-rules/{ruleId}/run makes a manual run (F-AUT-07.R08). False otherwise: the row shows \"Run now\" disabled."
       }
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "createdBy": {
      "$ref": "#/components/schemas/CreatorMemberId",
      "description": "The member who created the rule or flow (F-AUT-01.R10; XM-924). A transfer changes the owner, not this value."
     }
    }
   },
   "AutomationRuleView": {
    "allOf": [
     {
      "$ref": "#/components/schemas/AutomationRuleSummary"
     },
     {
      "type": "object",
      "properties": {
       "description": {
        "type": "string",
        "maxLength": 500
       },
       "activeDefinition": {
        "$ref": "#/components/schemas/AutomationRuleDefinition"
       },
       "draft": {
        "type": "object",
        "properties": {
         "definition": {
          "$ref": "#/components/schemas/AutomationRuleDefinition"
         },
         "savedBy": {
          "$ref": "#/components/schemas/MemberRef"
         },
         "savedAt": {
          "$ref": "#/components/schemas/Instant"
         },
         "validation": {
          "type": "array",
          "maxItems": 100,
          "items": {
           "$ref": "#/components/schemas/AutomationValidationSentence"
          }
         }
        }
       },
       "fullyVisible": {
        "type": "boolean",
        "description": "False when withheld leaves exist; then only pause is offered."
       },
       "binding": {
        "type": "object",
        "properties": {
         "version": {
          "type": "integer"
         },
         "boundAt": {
          "$ref": "#/components/schemas/Instant"
         },
         "boundVia": {
          "type": "string",
          "enum": [
           "activation",
           "enabling",
           "provisioning"
          ]
         }
        }
       },
       "can": {
        "type": "object",
        "properties": {
         "edit": {
          "type": "boolean"
         },
         "activate": {
          "type": "boolean"
         },
         "enable": {
          "type": "boolean"
         },
         "pause": {
          "type": "boolean"
         },
         "transfer": {
          "type": "boolean"
         },
         "archive": {
          "type": "boolean"
         },
         "dryRun": {
          "type": "boolean"
         },
         "runNow": {
          "type": "boolean",
          "description": "The same decision as AutomationRuleSummary.can.runNow (F-AUT-07.R08; G98)."
         }
        }
       }
      }
     }
    ]
   },
   "AutomationRunStatusKey": {
    "type": "string",
    "enum": [
     "pending",
     "running",
     "succeeded",
     "partially_failed",
     "failed",
     "stopped",
     "skipped",
     "refused",
     "expired"
    ]
   },
   "AutomationRunStep": {
    "type": "object",
    "required": [
     "index",
     "action",
     "status"
    ],
    "properties": {
     "index": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9
     },
     "action": {
      "type": "string",
      "maxLength": 60
     },
     "status": {
      "$ref": "#/components/schemas/AutomationStepStatusKey"
     },
     "reason": {
      "type": "string",
      "maxLength": 60
     },
     "attempts": {
      "type": "integer",
      "minimum": 0
     },
     "result": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "recipientsWithheld": {
      "type": "integer",
      "minimum": 0
     },
     "deliveryStatus": {
      "type": "string",
      "enum": [
       "pending",
       "delivered",
       "retrying",
       "failed",
       "abandoned",
       "suppressed"
      ]
     },
     "aiStatus": {
      "type": "string",
      "enum": [
       "queued",
       "running",
       "awaiting_approval",
       "cancelling",
       "completed",
       "cancelled",
       "failed",
       "expired",
       "withheld"
      ],
      "description": "The current status of the AI run an ai.start_workflow step started (F-AUT-11.R09; automation.ai-run-outcome); absent until Assist reports one."
     }
    }
   },
   "AutomationRunSummary": {
    "type": "object",
    "required": [
     "id",
     "ruleVersion",
     "triggerKind",
     "status",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "ruleVersion": {
      "type": "integer",
      "minimum": 1
     },
     "triggerKind": {
      "type": "string",
      "enum": [
       "event",
       "schedule",
       "manual"
      ]
     },
     "triggerSummary": {
      "type": "string",
      "maxLength": 200,
      "example": "!212 opened"
     },
     "subject": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "status": {
      "$ref": "#/components/schemas/AutomationRunStatusKey"
     },
     "reason": {
      "type": "string",
      "maxLength": 60
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "flowStatus": {
      "$ref": "#/components/schemas/AutomationFlowRunStatusKey"
     }
    }
   },
   "AutomationRunView": {
    "allOf": [
     {
      "$ref": "#/components/schemas/AutomationRunSummary"
     },
     {
      "type": "object",
      "required": [
       "steps",
       "attempts",
       "replayUntil",
       "canRetry"
      ],
      "properties": {
       "depth": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5
       },
       "occurrenceAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "admittedAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "replayUntil": {
        "$ref": "#/components/schemas/Instant"
       },
       "steps": {
        "type": "array",
        "maxItems": 10,
        "items": {
         "$ref": "#/components/schemas/AutomationRunStep"
        }
       },
       "attempts": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "type": "object",
         "required": [
          "number",
          "cause",
          "startedAt"
         ],
         "properties": {
          "number": {
           "type": "integer",
           "minimum": 1
          },
          "cause": {
           "type": "string",
           "enum": [
            "first",
            "transient",
            "recovery",
            "retry"
           ]
          },
          "requestedBy": {
           "$ref": "#/components/schemas/MemberRef"
          },
          "startedAt": {
           "$ref": "#/components/schemas/Instant"
          },
          "outcome": {
           "type": "string",
           "maxLength": 60
          }
         }
        }
       },
       "canRetry": {
        "type": "boolean"
       },
       "retryBlockedBy": {
        "type": "string",
        "enum": [
         "replay_expired",
         "binding_revoked",
         "not_admitted",
         "running",
         "succeeded"
        ]
       },
       "definitionSchema": {
        "type": "integer",
        "enum": [
         1,
         2
        ],
        "description": "Optional until package FLOW-2b returns it."
       },
       "runDeadline": {
        "$ref": "#/components/schemas/Instant"
       },
       "waitingFor": {
        "type": "string",
        "enum": [
         "delay",
         "until",
         "event",
         "approval",
         "task",
         "ai_run",
         "sub_flow"
        ]
       },
       "wakeAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "cancelledBy": {
        "$ref": "#/components/schemas/MemberRef",
        "description": "The person who cancelled the run (\"Cancelled by <person>\", F-AUT-24.R05; XM-1295, G-AUA-16)."
       },
       "canCancel": {
        "type": "boolean",
        "description": "A flow run: the reader may cancel it now (an open run and a manager of the flow or an Admin, F-AUT-24.R07)."
       },
       "ruleId": {
        "$ref": "#/components/schemas/Uuid",
        "description": "The run's rule: the run view reads its flow (XM-1295)."
       }
      }
     }
    ]
   },
   "AutomationSampleEvent": {
    "type": "object",
    "required": [
     "eventId",
     "trigger",
     "occurredAt",
     "subject"
    ],
    "properties": {
     "eventId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "trigger": {
      "type": "string",
      "maxLength": 60
     },
     "occurredAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "subject": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "summary": {
      "type": "string",
      "maxLength": 200,
      "example": "ORB-125 · !212 opened"
     }
    }
   },
   "AutomationScheduleSpec": {
    "type": "object",
    "required": [
     "recurrence",
     "timeZone",
     "catchUp"
    ],
    "properties": {
     "recurrence": {
      "type": "object",
      "required": [
       "kind"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "daily",
         "weekly",
         "monthly",
         "every_hours"
        ]
       },
       "at": {
        "type": "string",
        "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
        "example": "09:00"
       },
       "days": {
        "type": "array",
        "maxItems": 7,
        "items": {
         "type": "string",
         "enum": [
          "mon",
          "tue",
          "wed",
          "thu",
          "fri",
          "sat",
          "sun"
         ]
        }
       },
       "day": {
        "oneOf": [
         {
          "type": "integer",
          "minimum": 1,
          "maximum": 28
         },
         {
          "type": "string",
          "enum": [
           "last"
          ]
         }
        ]
       },
       "hours": {
        "type": "integer",
        "minimum": 1,
        "maximum": 24
       }
      }
     },
     "timeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "catchUp": {
      "type": "object",
      "required": [
       "policy"
      ],
      "properties": {
       "policy": {
        "type": "string",
        "enum": [
         "skip",
         "latest_only",
         "bounded"
        ]
       },
       "n": {
        "type": "integer",
        "minimum": 1,
        "maximum": 10
       }
      }
     },
     "startsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "endsOn": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "AutomationScheduleView": {
    "type": "object",
    "required": [
     "timeZone",
     "next",
     "missed"
    ],
    "properties": {
     "timeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "lastEvaluatedUntil": {
      "$ref": "#/components/schemas/Instant"
     },
     "next": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/Instant"
      }
     },
     "missed": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "occurrenceAt",
        "runId"
       ],
       "properties": {
        "occurrenceAt": {
         "$ref": "#/components/schemas/Instant"
        },
        "runId": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      }
     }
    }
   },
   "AutomationSchemaView": {
    "type": "object",
    "required": [
     "grammarVersion",
     "triggers",
     "attributes",
     "operators",
     "actions",
     "placeholders"
    ],
    "properties": {
     "grammarVersion": {
      "type": "integer",
      "minimum": 1
     },
     "triggers": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "key",
        "label",
        "subject",
        "attributes"
       ],
       "properties": {
        "key": {
         "type": "string",
         "maxLength": 60
        },
        "label": {
         "type": "string",
         "maxLength": 120
        },
        "subject": {
         "type": "string",
         "enum": [
          "ticket",
          "sprint",
          "doc_page",
          "conversation",
          "request",
          "project",
          "tenant"
         ]
        },
        "attributes": {
         "type": "array",
         "maxItems": 20,
         "items": {
          "type": "string",
          "maxLength": 60
         }
        },
        "available": {
         "type": "boolean"
        },
        "unavailableReason": {
         "type": "string",
         "enum": [
          "module",
          "plan",
          "flag",
          "scope"
         ]
        }
       }
      }
     },
     "attributes": {
      "type": "array",
      "maxItems": 300,
      "items": {
       "type": "object",
       "required": [
        "key",
        "label",
        "type",
        "operators"
       ],
       "properties": {
        "key": {
         "type": "string",
         "maxLength": 60
        },
        "fieldKey": {
         "type": "string",
         "maxLength": 60
        },
        "label": {
         "type": "string",
         "maxLength": 120
        },
        "type": {
         "type": "string",
         "enum": [
          "enum",
          "member",
          "label_set",
          "boolean",
          "date",
          "number",
          "text",
          "stage",
          "stage_kind",
          "project",
          "epic",
          "sprint",
          "select",
          "multi_select"
         ]
        },
        "operators": {
         "type": "array",
         "maxItems": 14,
         "items": {
          "type": "string",
          "maxLength": 20
         }
        },
        "options": {
         "type": "array",
         "maxItems": 200,
         "items": {
          "type": "object",
          "required": [
           "value",
           "label"
          ],
          "description": "An operand choice — value is what a condition stores (an enum key, a stage, label or option id), label what the picker shows (P2 round 2, CG-03).",
          "properties": {
           "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
           },
           "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
           }
          }
         }
        }
       }
      }
     },
     "operators": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 20
      }
     },
     "actions": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "key",
        "label",
        "sideEffectClass",
        "needsTicketSubject",
        "paramsSchema",
        "permitted"
       ],
       "properties": {
        "key": {
         "type": "string",
         "maxLength": 60
        },
        "label": {
         "type": "string",
         "maxLength": 120
        },
        "sideEffectClass": {
         "type": "string",
         "enum": [
          "internal",
          "client_exposure",
          "external",
          "ai"
         ]
        },
        "needsTicketSubject": {
         "type": "boolean"
        },
        "paramsSchema": {
         "type": "object",
         "additionalProperties": true
        },
        "permitted": {
         "type": "boolean",
         "description": "Whether the caller could use it now (their own access)."
        },
        "requires": {
         "type": "string",
         "maxLength": 60
        }
       }
      }
     },
     "placeholders": {
      "type": "array",
      "maxItems": 300,
      "items": {
       "type": "object",
       "required": [
        "token",
        "label",
        "clientSafe"
       ],
       "properties": {
        "token": {
         "type": "string",
         "maxLength": 80,
         "example": "{{ticket.key}}"
        },
        "label": {
         "type": "string",
         "maxLength": 120
        },
        "clientSafe": {
         "type": "boolean"
        }
       }
      }
     }
    }
   },
   "AutomationStepStatusKey": {
    "type": "string",
    "enum": [
     "pending",
     "succeeded",
     "skipped",
     "refused",
     "failed"
    ]
   },
   "AutomationTemplateKey": {
    "type": "string",
    "enum": [
     "mr_opened_to_in_review",
     "mr_merged_to_done",
     "client_decision_moves_ticket"
    ],
    "x-extensible-enum": true
   },
   "AutomationTemplateView": {
    "type": "object",
    "required": [
     "key",
     "name",
     "description",
     "scopes",
     "definition",
     "instantiatedByDefault"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/AutomationTemplateKey"
     },
     "name": {
      "type": "string",
      "maxLength": 120
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "scopes": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "$ref": "#/components/schemas/AutomationRuleScopeKey"
      }
     },
     "variants": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "maxLength": 40
      }
     },
     "definition": {
      "$ref": "#/components/schemas/AutomationRuleDefinition"
     },
     "instantiatedByDefault": {
      "type": "string",
      "enum": [
       "enabled",
       "disabled",
       "never"
      ]
     },
     "instances": {
      "type": "integer",
      "minimum": 0,
      "description": "Rules in this tenant created from the template."
     }
    }
   },
   "AutomationTriggerSpec": {
    "type": "object",
    "required": [
     "type"
    ],
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "event",
       "schedule"
      ]
     },
     "event": {
      "type": "string",
      "maxLength": 60,
      "example": "merge_request.state_changed"
     },
     "where": {
      "type": "object",
      "maxProperties": 5,
      "additionalProperties": true
     },
     "includeImported": {
      "type": "boolean"
     },
     "includeReshares": {
      "type": "boolean",
      "default": false,
      "description": "\"Also run on re-shares\" (XM-215, owner register §49): only for `ticket.client_visibility_changed` — the rule also runs once per ticket the client sharing review re-shares into the current client version; off (absent) by default, so a re-share runs the rule never."
     },
     "schedule": {
      "$ref": "#/components/schemas/AutomationScheduleSpec"
     }
    }
   },
   "AutomationUsageLine": {
    "type": "object",
    "required": [
     "used"
    ],
    "properties": {
     "used": {
      "type": "integer",
      "minimum": 0
     },
     "limit": {
      "type": "integer",
      "minimum": 0,
      "description": "Absent when the plan's limit is unlimited."
     },
     "percent": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
     },
     "level": {
      "type": "string",
      "enum": [
       "ok",
       "warning",
       "reached"
      ]
     }
    }
   },
   "AutomationUsageView": {
    "type": "object",
    "required": [
     "enabledRules",
     "runsToday",
     "endpoints"
    ],
    "properties": {
     "enabledRules": {
      "$ref": "#/components/schemas/AutomationUsageLine"
     },
     "runsToday": {
      "$ref": "#/components/schemas/AutomationUsageLine"
     },
     "endpoints": {
      "$ref": "#/components/schemas/AutomationUsageLine"
     },
     "waitingRuns": {
      "$ref": "#/components/schemas/AutomationUsageLine"
     },
     "aiCallsToday": {
      "$ref": "#/components/schemas/AutomationUsageLine"
     },
     "inboundEndpoints": {
      "$ref": "#/components/schemas/AutomationUsageLine"
     }
    }
   },
   "AutomationValidationSentence": {
    "type": "object",
    "required": [
     "pointer",
     "code",
     "sentence",
     "severity"
    ],
    "properties": {
     "pointer": {
      "type": "string",
      "maxLength": 200,
      "example": "/actions/0/params/kind"
     },
     "code": {
      "type": "string",
      "maxLength": 80,
      "example": "automation.field_not_visible"
     },
     "sentence": {
      "type": "string",
      "maxLength": 300,
      "example": "You cannot see the field \"Budget code\", so a rule you activate cannot use it."
     },
     "severity": {
      "type": "string",
      "enum": [
       "error",
       "warning"
      ]
     }
    }
   },
   "AutomationVersionSummary": {
    "type": "object",
    "required": [
     "number",
     "status",
     "createdBy",
     "createdAt",
     "checksum"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "superseded"
      ]
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "activatedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "activatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "checksum": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     },
     "triggerSummary": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "AutomationWaitingRunRow": {
    "type": "object",
    "required": [
     "id",
     "rule",
     "status",
     "stepId",
     "waitKind",
     "wakeAt",
     "runDeadline",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "rule": {
      "type": "object",
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "subject": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "status": {
      "$ref": "#/components/schemas/AutomationFlowRunStatusKey"
     },
     "stepId": {
      "type": "string",
      "maxLength": 40
     },
     "stepTitle": {
      "type": "string",
      "maxLength": 200,
      "description": "The waiting step's title in the run's own version (XM-1294; G-AUA-14)."
     },
     "waitKind": {
      "type": "string",
      "enum": [
       "delay",
       "until",
       "event",
       "approval",
       "task",
       "ai_run",
       "sub_flow"
      ]
     },
     "wakeAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "runDeadline": {
      "$ref": "#/components/schemas/Instant"
     },
     "bindingState": {
      "type": "string",
      "enum": [
       "current",
       "adoptable",
       "revoked"
      ]
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "AvatarFramingView": {
    "type": "object",
    "description": "F-IDN-11.R13 — the kept original's size and the current framing (the whole stored image for an avatar stored before).",
    "required": [
     "version",
     "original",
     "crop"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "original": {
      "type": "object",
      "required": [
       "width",
       "height"
      ],
      "properties": {
       "width": {
        "type": "integer",
        "minimum": 1,
        "maximum": 2048
       },
       "height": {
        "type": "integer",
        "minimum": 1,
        "maximum": 2048
       }
      }
     },
     "crop": {
      "type": "object",
      "required": [
       "x",
       "y",
       "size"
      ],
      "properties": {
       "x": {
        "type": "integer",
        "minimum": 0
       },
       "y": {
        "type": "integer",
        "minimum": 0
       },
       "size": {
        "type": "integer",
        "minimum": 1
       }
      }
     }
    }
   },
   "BacklogPlannedSprint": {
    "type": "object",
    "required": [
     "summary",
     "count",
     "rows",
     "truncated"
    ],
    "description": "One planned sprint of the Backlog (F-WRK-06.R12) — its head is exact, its rows are the first `work.sprints.plannedSectionRows` (100 † by default, at most 100) in rank order.",
    "properties": {
     "summary": {
      "$ref": "#/components/schemas/WorkSprintSummary"
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "example": 960,
      "description": "Absent when the reader's mask hides Estimate (an estimate total is an estimate figure)."
     },
     "estimatePoints": {
      "$ref": "#/components/schemas/PointsTotal"
     },
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "rows": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/BacklogRow"
      }
     },
     "truncated": {
      "type": "boolean"
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512,
      "description": "XM-1167 (G-BL-04; F-WRK-06.R12): present only when truncated. A sealed cursor that continues the section with listProjectTickets filter[sprint]=<this sprint id> and sort=rank, with no other filter and no q."
     }
    }
   },
   "BacklogRow": {
    "type": "object",
    "required": [
     "id",
     "key",
     "title",
     "priority",
     "stage",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "epic": {
      "$ref": "#/components/schemas/EpicRef"
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
     },
     "estimatePoints": {
      "$ref": "#/components/schemas/StoryPoints"
     },
     "priority": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly",
      "description": "XM-708 (F-WRK-06.R11): absent when the reader's mask hides Due date."
     },
     "stage": {
      "$ref": "#/components/schemas/TicketStage"
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "customFields": {
      "$ref": "#/components/schemas/CustomFieldValueMap"
     },
     "type": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "parent": {
      "$ref": "#/components/schemas/ParentRef"
     },
     "blocked": {
      "type": "boolean"
     },
     "labelIds": {
      "$ref": "#/components/schemas/RowLabelIds"
     },
     "reporter": {
      "$ref": "#/components/schemas/MemberRef",
      "description": "XM-1110 (F-WRK-06.R14): only with columns=reporter — the creator, unless the creator named another member (F-WRK-23.R16)."
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "XM-1110: only with columns=created."
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "XM-1110: only with columns=updated."
     },
     "sprint": {
      "$ref": "#/components/schemas/RowSprintRef",
      "description": "XM-1110: only with columns=sprint; absent for a ticket in no sprint."
     },
     "startDate": {
      "$ref": "#/components/schemas/DateOnly",
      "description": "XM-1110: only with columns=start_date; absent when the reader's mask hides Due date."
     },
     "clientVisible": {
      "type": "boolean",
      "description": "XM-1110: only with columns=client_visible."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "plan",
       "rerank",
       "select",
       "edit"
      ],
      "properties": {
       "plan": {
        "type": "boolean"
       },
       "rerank": {
        "type": "boolean"
       },
       "select": {
        "type": "boolean"
       },
       "edit": {
        "type": "boolean",
        "description": "The reader may edit this ticket (`edit` on the project; F-WRK-10.R01, R03): the bulk bar turns Assign, Set priority and Set epic off for a selection with a row whose edit is false. A protected operand is decided per value when the change is sent (`422 bulk.invalid_targets`, reason `operand_protected`)."
       }
      }
     }
    }
   },
   "BacklogTotals": {
    "type": "object",
    "required": [
     "tickets",
     "all",
     "byStage"
    ],
    "description": "XM-1369 (F-WRK-06.R15; the web app P-BL-08 / G-BL-07): the head totals of the Backlog, on the first page only (meta.totals). The Backlog's set is the live, not epic-level tickets that the reader can see (Visible::for) in the active sprint (done included), in a planned sprint (done included) or in no sprint and not done. The visible set is that set with the filters and q on its backlog part only (R04). One statement reads every total.",
    "properties": {
     "tickets": {
      "type": "integer",
      "minimum": 0,
      "description": "The tickets of the visible set (the \"tickets\" metric; \"N visible\"). Never more than all."
     },
     "all": {
      "type": "integer",
      "minimum": 0,
      "description": "The tickets of the Backlog's set without the filters and q (\"of M tickets\"); the reader's Visible::for still applies."
     },
     "blocked": {
      "type": "integer",
      "minimum": 0,
      "description": "The tickets of the visible set that a visible, live, open finish_to_start prerequisite blocks (F-WRK-34.R01; the rule of filter[blocked]). Absent when the mask hides Relations or Status."
     },
     "unassigned": {
      "type": "integer",
      "minimum": 0,
      "description": "The tickets of the visible set without an assignee (\"without assignee\"). Absent when the mask hides Assignee."
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "description": "The sum of the estimates (minutes) of the visible set; unestimated counts as zero. Absent when the mask hides Estimate."
     },
     "estimatePoints": {
      "$ref": "#/components/schemas/PointsTotal"
     },
     "byStage": {
      "type": "array",
      "maxItems": 50,
      "description": "The \"Stage mix\": one item for each stage of the board in the board's order, with the tickets of the visible set in that stage (0 included). The counts add up to tickets.",
      "items": {
       "type": "object",
       "required": [
        "stageId",
        "count"
       ],
       "properties": {
        "stageId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "count": {
         "type": "integer",
         "minimum": 0
        }
       }
      }
     }
    }
   },
   "BacklogView": {
    "type": "object",
    "required": [
     "backlog"
    ],
    "properties": {
     "can": {
      "type": "object",
      "required": [
       "planSprint",
       "planAndStart"
      ],
      "description": "The reader's own rights on the Backlog page (F-WRK-06.R13), on the first page only; absent on a later page. \"Plan sprint\" is on when planSprint or planAndStart is true.",
      "properties": {
       "planSprint": {
        "type": "boolean",
        "description": "True when the reader holds plan on the active project and plannedCount is less than plannedLimit — the rule of SprintPlanningPolicy (admitsPlanned) that POST /projects/{projectKey}/sprints without start refuses with 409 sprint.planned_limit (F-WRK-08.R01). An affordance only: the plan decides again."
       },
       "planAndStart": {
        "type": "boolean",
        "description": "True when the reader holds plan on the active project and the project has no active sprint — the rule of SprintPlanningPolicy (admitsStarted) that POST /projects/{projectKey}/sprints with start true refuses with 409 sprint.open_exists (F-WRK-08.R01, R02). The planned limit does not apply to it. When only planAndStart is true, the dialog's \"Start sprint\" is on and locked (F-WRK-08 §13). An affordance only: the plan decides again."
       }
      }
     },
     "plannedLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20,
      "example": 5,
      "description": "The workspace setting work.sprints.plannedLimit (1–20, 5 by default; register §200), on the first page only (F-WRK-06.R13). The max of 409 sprint.planned_limit."
     },
     "plannedCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 20,
      "example": 2,
      "description": "The number of planned sprints of the project — every planned sprint, as the plan counts them, and the length of plannedSprints — on the first page only (F-WRK-06.R13). It can be more than plannedLimit after an Admin lowered the limit (F-WRK-08.R01)."
     },
     "estimateUnit": {
      "$ref": "#/components/schemas/EstimateUnit"
     },
     "sprint": {
      "type": "object",
      "required": [
       "summary",
       "count",
       "rows",
       "truncated"
      ],
      "properties": {
       "summary": {
        "$ref": "#/components/schemas/WorkSprintSummary"
       },
       "estimateMinutes": {
        "type": "integer",
        "minimum": 0,
        "example": 1860,
        "description": "Absent when the reader's mask hides Estimate (an estimate total is an estimate figure)."
       },
       "estimatePoints": {
        "$ref": "#/components/schemas/PointsTotal"
       },
       "count": {
        "type": "integer",
        "minimum": 0
       },
       "rows": {
        "type": "array",
        "maxItems": 500,
        "items": {
         "$ref": "#/components/schemas/BacklogRow"
        }
       },
       "truncated": {
        "type": "boolean"
       },
       "nextCursor": {
        "type": "string",
        "maxLength": 512,
        "description": "XM-1167 (G-BL-04; F-WRK-06.R01): present only when truncated. A sealed cursor that continues the section with listProjectTickets filter[sprint]=<this sprint id> and sort=rank, with no other filter and no q (the EpicPanel.ticketsNextCursor pattern, F-WRK-11.R19). The continuation holds the same rows as the section (live, not epic-level, visible to the reader) in rank order."
       }
      }
     },
     "plannedSprints": {
      "type": "array",
      "maxItems": 20,
      "description": "The planned sprints (the next sprints of the design) in starts_on, id order, at most the workspace setting work.sprints.plannedLimit (1–20, register §200), on the first page only — an empty list when the project has none; absent on a later page (F-WRK-06.R12; register §178). The backlog filters do not narrow them.",
      "items": {
       "$ref": "#/components/schemas/BacklogPlannedSprint"
      }
     },
     "backlog": {
      "type": "object",
      "required": [
       "count",
       "rows",
       "from",
       "to"
      ],
      "properties": {
       "count": {
        "type": "integer",
        "minimum": 0,
        "description": "Open tickets in no sprint matching the backlog filters."
       },
       "rows": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/BacklogRow"
        }
       },
       "from": {
        "type": "integer",
        "minimum": 0
       },
       "to": {
        "type": "integer",
        "minimum": 0
       }
      }
     }
    }
   },
   "BoardColumn": {
    "type": "object",
    "required": [
     "stage",
     "count",
     "overWipLimit",
     "addable",
     "cards"
    ],
    "properties": {
     "stage": {
      "$ref": "#/components/schemas/TicketStage"
     },
     "count": {
      "type": "integer",
      "minimum": 0,
      "description": "Exact, under the request's filters."
     },
     "wipLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 999
     },
     "overWipLimit": {
      "type": "boolean"
     },
     "addable": {
      "type": "boolean",
      "description": "False on the final stage and on done stages (D-024)."
     },
     "cards": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/TicketCard"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "BoardColumnPage": {
    "type": "object",
    "required": [
     "stageId",
     "cards"
    ],
    "properties": {
     "stageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "cards": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/TicketCard"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "BoardLane": {
    "type": "object",
    "required": [
     "unassigned",
     "count",
     "cells"
    ],
    "properties": {
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "unassigned": {
      "type": "boolean"
     },
     "priority": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "epic": {
      "$ref": "#/components/schemas/EpicRef"
     },
     "noEpic": {
      "type": "boolean"
     },
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "cells": {
      "type": "array",
      "maxItems": 30,
      "items": {
       "$ref": "#/components/schemas/BoardLaneCell"
      }
     }
    }
   },
   "BoardLaneCell": {
    "type": "object",
    "required": [
     "stageId",
     "count",
     "cards"
    ],
    "properties": {
     "stageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "cards": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/TicketCard"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "BoardLanePage": {
    "type": "object",
    "required": [
     "lanes"
    ],
    "properties": {
     "lanes": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/BoardLane"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "BoardPresenceSignal": {
    "type": "object",
    "description": "The body of `POST /projects/{projectKey}/presence` (F-WRK-37.R07, R08, R11). `ticketKey` with `card_open` and `card_moving` (a ticket of the path's project that the caller reads); `stageId` optionally with `card_moving` (a stage of the project's board).",
    "required": [
     "activity"
    ],
    "additionalProperties": false,
    "properties": {
     "activity": {
      "type": "string",
      "enum": [
       "card_open",
       "card_moving",
       "idle"
      ]
     },
     "ticketKey": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "stageId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "BoardStageView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "kind",
     "colour",
     "position",
     "presentation",
     "isFinal",
     "addable"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "In review"
     },
     "kind": {
      "$ref": "#/components/schemas/StageKindKey"
     },
     "colour": {
      "$ref": "#/components/schemas/StageColourKey"
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 19
     },
     "wipLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 999
     },
     "presentation": {
      "type": "string",
      "enum": [
       "shown",
       "merged",
       "hidden"
      ]
     },
     "mergedInto": {
      "$ref": "#/components/schemas/Uuid"
     },
     "removingInto": {
      "$ref": "#/components/schemas/Uuid"
     },
     "isFinal": {
      "type": "boolean"
     },
     "addable": {
      "type": "boolean",
      "description": "false on the final stage and on a stage being removed (D-024, D-068)."
     }
    }
   },
   "BoardView": {
    "type": "object",
    "required": [
     "grouping",
     "columns"
    ],
    "properties": {
     "grouping": {
      "type": "string",
      "enum": [
       "columns",
       "assignee",
       "priority",
       "epic"
      ]
     },
     "sprintId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "columns": {
      "type": "array",
      "maxItems": 30,
      "items": {
       "$ref": "#/components/schemas/BoardColumn"
      }
     },
     "lanes": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/BoardLane"
      }
     },
     "lanesNextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "BoundedCount": {
    "type": "object",
    "required": [
     "count",
     "atLeast"
    ],
    "description": "XM-1109 (F-WRK-14.R14): a count up to the cap; past the cap (10,000) the count is the cap and atLeast is true — a lower bound, never a silent undercount.",
    "properties": {
     "count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
     },
     "atLeast": {
      "type": "boolean"
     }
    }
   },
   "BudgetAlertRule": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "measure",
     "thresholds"
    ],
    "properties": {
     "measure": {
      "type": "string",
      "enum": [
       "cost",
       "minutes",
       "bill",
       "forecast_cost",
       "expense_cost",
       "total_cost"
      ]
     },
     "thresholds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 5,
      "uniqueItems": true,
      "items": {
       "type": "integer",
       "minimum": 1,
       "maximum": 200
      }
     }
    }
   },
   "BudgetAlertState": {
    "type": "object",
    "required": [
     "measure",
     "threshold",
     "state"
    ],
    "properties": {
     "measure": {
      "type": "string",
      "enum": [
       "cost",
       "minutes",
       "bill",
       "forecast_cost",
       "expense_cost",
       "total_cost"
      ]
     },
     "threshold": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200
     },
     "state": {
      "type": "string",
      "enum": [
       "armed",
       "fired"
      ]
     },
     "firedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "BudgetAlertsRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "useTenantDefault"
    ],
    "properties": {
     "useTenantDefault": {
      "type": "boolean"
     },
     "rules": {
      "type": "array",
      "minItems": 1,
      "maxItems": 6,
      "items": {
       "$ref": "#/components/schemas/BudgetAlertRule"
      }
     },
     "recipients": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "managers",
       "viewers",
       null
      ],
      "description": "Who gets the alerts (F-FIN-08.R07; XM-869); absent or null returns to the tenant's finance.alerts.recipients."
     }
    }
   },
   "BudgetAlertsView": {
    "type": "object",
    "required": [
     "project",
     "source",
     "rules",
     "states",
     "version"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "source": {
      "type": "string",
      "enum": [
       "tenant_default",
       "project"
      ]
     },
     "rules": {
      "type": "array",
      "maxItems": 6,
      "items": {
       "$ref": "#/components/schemas/BudgetAlertRule"
      }
     },
     "states": {
      "type": "array",
      "maxItems": 30,
      "items": {
       "$ref": "#/components/schemas/BudgetAlertState"
      }
     },
     "baselineNumber": {
      "type": "integer",
      "minimum": 1
     },
     "recipients": {
      "type": "string",
      "enum": [
       "managers",
       "viewers"
      ],
      "description": "Who gets the alerts (F-FIN-08.R07; XM-869) — the holders of manage_finance or of view_finance on the project; always holders of finance access."
     },
     "recipientsSource": {
      "type": "string",
      "enum": [
       "tenant_default",
       "project"
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "BudgetComparisonKey": {
    "type": "object",
    "properties": {
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "team": {
      "$ref": "#/components/schemas/PlanTeamRef"
     },
     "toMonth": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "costType": {
      "$ref": "#/components/schemas/CostTypeRef"
     },
     "formerMembers": {
      "type": "boolean",
      "description": "The row of erased members' anonymised amounts (INV-FIN-18)."
     },
     "other": {
      "type": "boolean",
      "description": "The row of everything outside the plan's members, roles or teams."
     }
    }
   },
   "BudgetComparisonRow": {
    "type": "object",
    "required": [
     "key",
     "planned",
     "actual",
     "provisional"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/BudgetComparisonKey"
     },
     "planned": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "actual": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "provisional": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "estimate": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "remaining": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "forecast": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "variance": {
      "$ref": "#/components/schemas/FinanceSignedFigures"
     },
     "burnPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 100000,
      "description": "Actual labour cost ÷ planned labour cost × 100, one decimal; absent without a planned cost."
     },
     "expense": {
      "$ref": "#/components/schemas/ExpenseComparisonFigures"
     },
     "totalCost": {
      "type": "object",
      "required": [
       "actual"
      ],
      "properties": {
       "planned": {
        "$ref": "#/components/schemas/Money"
       },
       "actual": {
        "$ref": "#/components/schemas/Money"
       },
       "forecast": {
        "$ref": "#/components/schemas/Money"
       },
       "variance": {
        "$ref": "#/components/schemas/Money"
       }
      }
     }
    }
   },
   "BudgetComparisonView": {
    "type": "object",
    "required": [
     "project",
     "currency",
     "from",
     "to",
     "grain",
     "by",
     "rows",
     "total",
     "notices"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "from": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "to": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "grain": {
      "type": "string",
      "enum": [
       "month",
       "total"
      ]
     },
     "by": {
      "type": "string",
      "enum": [
       "none",
       "member",
       "delivery_role",
       "team",
       "cost_type"
      ]
     },
     "baseline": {
      "type": "object",
      "required": [
       "id",
       "number",
       "approvedAt"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "number": {
        "type": "integer",
        "minimum": 1
       },
       "approvedAt": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "rows": {
      "type": "array",
      "maxItems": 2000,
      "items": {
       "$ref": "#/components/schemas/BudgetComparisonRow"
      }
     },
     "total": {
      "$ref": "#/components/schemas/BudgetComparisonRow"
     },
     "notices": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/FinanceNotice"
      }
     }
    }
   },
   "BulkProjectRequest": {
    "type": "object",
    "description": "The bulk body of 05 §11 — action and 1–100 targets (project keys); no params for these actions.",
    "required": [
     "action",
     "targets"
    ],
    "additionalProperties": false,
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "archive",
       "pin",
       "unpin"
      ]
     },
     "targets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     }
    }
   },
   "BulkProjectResult": {
    "type": "object",
    "description": "The bulk answer of 05 §11; targets already in the requested state are reported with unchanged true.",
    "required": [
     "action",
     "affected",
     "items"
    ],
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "archive",
       "pin",
       "unpin"
      ]
     },
     "affected": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "target",
        "unchanged"
       ],
       "properties": {
        "target": {
         "$ref": "#/components/schemas/ProjectKey"
        },
        "version": {
         "type": "integer",
         "minimum": 1
        },
        "unchanged": {
         "type": "boolean"
        }
       }
      }
     }
    }
   },
   "BulkTicketRequest": {
    "type": "object",
    "required": [
     "action",
     "targets"
    ],
    "additionalProperties": false,
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "plan_into_sprint",
       "remove_from_sprint",
       "assign",
       "set_priority",
       "set_custom_field",
       "set_type",
       "set_parent",
       "restore_placement"
      ],
      "description": "set_type and set_parent — Spec BF-1 (F-WRK-32.R11). restore_placement — the Undo of a bulk move (F-WRK-10.R11; register §213; XM-857)."
     },
     "targets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/TicketKey"
      }
     },
     "params": {
      "type": "object",
      "description": "plan_into_sprint: {sprintId?} — absent plans into the active sprint, an open sprint's id into that sprint (F-WRK-10.R09; register §178); assign: {assigneeId|null}; set_priority: {priority}; set_custom_field: {key, value}; set_type: {typeKey}; set_parent: {parentKey|null}; restore_placement: {placements: [{sprintId: <uuid>|null, after?, before?}]}, one former place for each target in the order of targets (F-WRK-10.R11).",
      "additionalProperties": true
     },
     "expectedVersions": {
      "type": "array",
      "description": "F-WRK-10.R10 (BE-MOVE-PRECONDITION; register §212, §213; XM-857): one version for each target, in the order of targets. A target whose version differs is listed as stale-version with currentVersion in 422 bulk.invalid_targets, and nothing changes. Another length answers 422 validation.failed with bulk.versions_count at /expectedVersions; each member is a JSON integer of 1 or more (bulk.version_invalid at /expectedVersions/<i>); set_type and set_parent take none (bulk.versions_unsupported); restore_placement requires them (bulk.versions_required). Absent compares nothing.",
      "minItems": 1,
      "maxItems": 100,
      "items": {
       "type": "integer",
       "minimum": 1
      }
     }
    }
   },
   "BulkTicketResult": {
    "type": "object",
    "required": [
     "action",
     "affected",
     "items"
    ],
    "properties": {
     "action": {
      "type": "string"
     },
     "affected": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "target",
        "version"
       ],
       "properties": {
        "target": {
         "$ref": "#/components/schemas/TicketKey"
        },
        "version": {
         "type": "integer",
         "minimum": 1
        },
        "previous": {
         "type": "object",
         "description": "F-WRK-10.R11 (BE-MOVE-UNDO-BULK; register §213; XM-857): in the first answer of plan_into_sprint and remove_from_sprint only — the target's sprint before the move (null: the backlog) and its nearest neighbours there that the caller may see. A replay answers without it. A bulk move changes the sprint and the rank only, so no stage or resolution is here.",
         "required": [
          "sprintId"
         ],
         "properties": {
          "sprintId": {
           "type": [
            "string",
            "null"
           ],
           "format": "uuid"
          },
          "after": {
           "$ref": "#/components/schemas/TicketKey"
          },
          "before": {
           "$ref": "#/components/schemas/TicketKey"
          }
         }
        }
       }
      }
     }
    }
   },
   "ByteCount": {
    "type": "integer",
    "format": "int64",
    "minimum": 0,
    "example": 2576980378
   },
   "CalendarFeedView": {
    "type": "object",
    "required": [
     "url",
     "createdAt"
    ],
    "description": "The feed URL, returned only by the create-or-rotate answer.",
    "properties": {
     "url": {
      "type": "string",
      "maxLength": 2048,
      "example": "https://app.youniton.com/calendar/Xk2pQ9-vT7aB1cD4eF6gH8iJ0kL2mN4oP6qR8sT0uV2.ics"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "CapabilityKey": {
    "type": "string",
    "description": "A capability of the grammar's catalogue (07 §2.5); grammar 3 adds the finance and report capabilities (CFL-652 item 4); grammar 4 adds the help-desk capabilities (CFL-532); grammar 5 adds the tenant time rights (XM-946, XM-947, XM-959); grammar 6 adds the tenant cashflow rights (XM-1576, finance FA-8); grammar 7 adds the project memory rights (F-MEM-14; register §230 add. 97); grammar 8 adds the tenant right view_reports (the owner, 28 November 2026, Q1 and Q2).",
    "enum": [
     "comment",
     "create",
     "edit",
     "change_status",
     "rerank",
     "plan",
     "comment_client",
     "manage_client_sharing",
     "log_time",
     "approve_timesheets",
     "edit_docs",
     "publish_docs",
     "message",
     "message_client",
     "manage_automation",
     "export_contacts",
     "discovery_manage",
     "discovery_contribute",
     "connect_repository",
     "attach_shared",
     "approve",
     "create_project",
     "invite_members",
     "administer",
     "view_finance",
     "manage_finance",
     "set_project_rates",
     "view_rates",
     "manage_rates",
     "share_reports",
     "submit_requests",
     "triage_requests",
     "view_team_timesheets",
     "log_time_on_behalf",
     "close_logging_periods",
     "view_cashflow",
     "manage_cashflow",
     "memory_read",
     "memory_write",
     "view_reports"
    ]
   },
   "CashflowInView": {
    "type": "object",
    "required": [
     "invoiceId",
     "number",
     "client",
     "total",
     "status"
    ],
    "description": "One invoice behind the money in of a month (R18). The one amount is the total (EUR).",
    "properties": {
     "invoiceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "number": {
      "type": "string"
     },
     "client": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/InvoiceClientRef"
       },
       {
        "type": "null"
       }
      ],
      "description": "Null when the caller cannot see the client."
     },
     "total": {
      "$ref": "#/components/schemas/Money"
     },
     "status": {
      "$ref": "#/components/schemas/InvoiceStatus"
     }
    }
   },
   "CashflowMonthView": {
    "type": "object",
    "required": [
     "month",
     "current",
     "moneyIn",
     "moneyOut",
     "balance",
     "ins",
     "outs",
     "people"
    ],
    "description": "One month (R11). The three figures are EUR. balance is the money at the end of the month; it is null before the starting month.",
    "properties": {
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "current": {
      "type": "boolean"
     },
     "moneyIn": {
      "$ref": "#/components/schemas/Money"
     },
     "moneyOut": {
      "$ref": "#/components/schemas/Money"
     },
     "balance": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ]
     },
     "ins": {
      "type": "array",
      "maxItems": 20000,
      "description": "The invoices behind the money in of the month (R18).",
      "items": {
       "$ref": "#/components/schemas/CashflowInView"
      }
     },
     "outs": {
      "type": "array",
      "maxItems": 20000,
      "items": {
       "$ref": "#/components/schemas/CashflowOutView"
      }
     },
     "outsByCategory": {
      "type": "array",
      "maxItems": 20000,
      "description": "G252 (owner's assistant re-test, 30 Nov 2026, case 46): the money out of the month by category, from the counted lines of outs only. Each line is in one category, so these totals plus people.total are moneyOut. Sorted by the category; null (No category) last.",
      "items": {
       "type": "object",
       "additionalProperties": false,
       "required": [
        "category",
        "total",
        "lines"
       ],
       "properties": {
        "category": {
         "type": [
          "string",
          "null"
         ]
        },
        "total": {
         "$ref": "#/components/schemas/Money"
        },
        "lines": {
         "type": "integer",
         "minimum": 1
        }
       }
      }
     },
     "people": {
      "$ref": "#/components/schemas/CashflowPeopleView"
     }
    }
   },
   "CashflowOutView": {
    "type": "object",
    "required": [
     "itemId",
     "what",
     "kind",
     "amount",
     "counted",
     "person",
     "project"
    ],
    "description": "One line of money out behind a month (R10). counted is false for a line in another currency than EUR (shown, not added; R12).",
    "properties": {
     "itemId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "what": {
      "type": "string"
     },
     "category": {
      "type": [
       "string",
       "null"
      ],
      "description": "G252 (30 Nov 2026): the line's category in that month; null is No category."
     },
     "kind": {
      "$ref": "#/components/schemas/SpendingKind"
     },
     "amount": {
      "$ref": "#/components/schemas/Money"
     },
     "counted": {
      "type": "boolean"
     },
     "person": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/MemberRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "project": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/SpendingProjectRef"
       },
       {
        "type": "null"
       }
      ],
      "description": "Null is a global line."
     }
    }
   },
   "CashflowPeopleView": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "total",
     "provisional",
     "members"
    ],
    "description": "Owner #50 (22 Nov 2026): the group \"People (from time)\" of a month — the logged time × the cost rate (EUR) of the members that the setting finance.peopleCost.source counts: time_unless_salary_line (default) leaves out a member with a salary line (category Salaries or People) in force that month; time_only counts every member; lines_only counts none. total is part of moneyOut; provisional = the part not approved yet.",
    "properties": {
     "total": {
      "$ref": "#/components/schemas/Money"
     },
     "provisional": {
      "$ref": "#/components/schemas/Money"
     },
     "members": {
      "type": "array",
      "maxItems": 10000,
      "items": {
       "type": "object",
       "additionalProperties": false,
       "required": [
        "person",
        "amount",
        "provisional"
       ],
       "properties": {
        "person": {
         "$ref": "#/components/schemas/MemberRef"
        },
        "amount": {
         "$ref": "#/components/schemas/Money"
        },
        "provisional": {
         "$ref": "#/components/schemas/Money"
        }
       }
      }
     }
    }
   },
   "CashflowSettingsChange": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "description": "The starting money with its month, the VAT rates, or both (F-FIN-16 §6). A member that is not given does not change.",
    "properties": {
     "start": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "amount"
      ],
      "properties": {
       "amount": {
        "type": "string",
        "pattern": "^-?(0|[1-9][0-9]{0,9})(\\.[0-9]{1,2})?$",
        "description": "EUR from -1000000000 to 1000000000."
       },
       "month": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/YearMonth"
         },
         {
          "type": "null"
         }
        ]
       }
      }
     },
     "vatRates": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/VatPercentText"
      }
     }
    }
   },
   "CashflowSettingsView": {
    "type": "object",
    "required": [
     "start",
     "vatRates",
     "can"
    ],
    "properties": {
     "start": {
      "$ref": "#/components/schemas/CashflowStartView"
     },
     "vatRates": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/VatPercentText"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "change"
      ],
      "properties": {
       "change": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "CashflowStartView": {
    "type": "object",
    "required": [
     "amount",
     "month"
    ],
    "description": "The starting money (F-FIN-16 §6). A null month is the first month of the read.",
    "properties": {
     "amount": {
      "$ref": "#/components/schemas/Money"
     },
     "month": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/YearMonth"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "CashflowView": {
    "type": "object",
    "required": [
     "from",
     "to",
     "start",
     "months",
     "can"
    ],
    "properties": {
     "from": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "to": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "start": {
      "$ref": "#/components/schemas/CashflowStartView"
     },
     "months": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "$ref": "#/components/schemas/CashflowMonthView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "change"
      ],
      "properties": {
       "change": {
        "type": "boolean",
        "description": "The caller may change the starting money and the spendings on the Cashflow page."
       }
      }
     }
    }
   },
   "ClientActivityKindKey": {
    "type": "string",
    "enum": [
     "commented",
     "due_date_moved",
     "sent_for_approval",
     "approved",
     "changes_requested",
     "approval_withdrawn",
     "file_shared",
     "marked_done",
     "shared_with_you"
    ],
    "x-extensible-enum": true
   },
   "ClientCardProject": {
    "type": "object",
    "required": [
     "key",
     "name",
     "status",
     "clientVersion"
    ],
    "description": "The owner's Q8 (22 November 2026): the client card and its \"Show more\" page always carry lead and openTickets; the contact panel does not.",
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string",
      "maxLength": 120,
      "example": "Atlas client portal"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "lead": {
      "description": "The owner's Q8: the project lead (Projects' client lead). Null when none is set, or when the member is not active or is erased.",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "$ref": "#/components/schemas/ClientOrganisationPersonRef"
       }
      ]
     },
     "openTickets": {
      "type": "integer",
      "minimum": 0,
      "description": "The owner's Q8: the live tickets of the project in a stage that is not a done stage (Projects' ProjectOpenTicketsQuery)."
     }
    }
   },
   "ClientCardView": {
    "type": "object",
    "required": [
     "organisation",
     "counts",
     "projects",
     "projectsTotal",
     "version",
     "can"
    ],
    "properties": {
     "organisation": {
      "$ref": "#/components/schemas/ClientDirectoryRow"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "counts": {
      "type": "object",
      "required": [
       "activeContacts",
       "archivedContacts",
       "portalActiveContacts"
      ],
      "properties": {
       "activeContacts": {
        "type": "integer",
        "minimum": 0
       },
       "archivedContacts": {
        "type": "integer",
        "minimum": 0
       },
       "portalActiveContacts": {
        "type": "integer",
        "minimum": 0,
        "description": "F-REL-01.R19 (one rule, 22 November 2026): the same value as organisation.portalContactCount — the active contacts that the reader can see whose portal state is active."
       }
      }
     },
     "projects": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/ClientCardProject"
      }
     },
     "projectsTotal": {
      "type": "integer",
      "minimum": 0
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "archive",
       "restore",
       "delete",
       "addContact",
       "exportContacts"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "archive": {
        "type": "boolean"
       },
       "restore": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       },
       "addContact": {
        "type": "boolean"
       },
       "exportContacts": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ClientChangeConsequence": {
    "type": "object",
    "required": [
     "clientVersion",
     "after",
     "guests",
     "pendingInvitations",
     "openApprovalRequests",
     "clientVisibleTickets",
     "sharedFiles",
     "taggedPages",
     "clientThreadComments",
     "conversationPeriod"
    ],
    "properties": {
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "before": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "after": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "guests": {
      "type": "integer",
      "minimum": 0
     },
     "pendingInvitations": {
      "type": "integer",
      "minimum": 0
     },
     "openApprovalRequests": {
      "type": "integer",
      "minimum": 0
     },
     "clientVisibleTickets": {
      "type": "integer",
      "minimum": 0
     },
     "sharedFiles": {
      "type": "integer",
      "minimum": 0
     },
     "taggedPages": {
      "type": "integer",
      "minimum": 0
     },
     "clientThreadComments": {
      "type": "integer",
      "minimum": 0
     },
     "conversationPeriod": {
      "type": "boolean",
      "description": "true when the project conversation will start a new, empty client period."
     }
    }
   },
   "ClientChangeRequest": {
    "type": "object",
    "required": [
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "clientOrganisationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "ClientDirectoryMeta": {
    "type": "object",
    "required": [
     "page",
     "counts",
     "can"
    ],
    "properties": {
     "page": {
      "$ref": "#/components/schemas/OffsetPageMeta"
     },
     "can": {
      "type": "object",
      "required": [
       "create"
      ],
      "description": "The directory's own affordance — \"+ New client\" shows only when create is true (the caller's `manage` on relationships, F-REL-01); an affordance, never authorisation (P2 round 2, CG-03).",
      "properties": {
       "create": {
        "type": "boolean"
       }
      }
     },
     "counts": {
      "type": "object",
      "required": [
       "active",
       "archived",
       "pinned"
      ],
      "properties": {
       "active": {
        "type": "integer",
        "minimum": 0
       },
       "archived": {
        "type": "integer",
        "minimum": 0
       },
       "pinned": {
        "type": "integer",
        "minimum": 0,
        "description": "F-REL-01.R20: the reader's pins among the active organisations that the reader can see, under the same q."
       }
      }
     }
    }
   },
   "ClientDirectoryRow": {
    "type": "object",
    "required": [
     "id",
     "name",
     "status",
     "contactCount",
     "portalContactCount",
     "projectCount",
     "isNew",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Orbit Retail"
     },
     "website": {
      "type": "string",
      "maxLength": 2048,
      "example": "https://orbitretail.com",
      "description": "An absolute http or https URL; absent when a stored website fails the shared link rule today (XM-1043; 05-api §8.7)."
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "contactCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Active contacts."
     },
     "portalContactCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The owner's #23 (22 November 2026; F-REL-01.R19): the active contacts that the reader can see and whose portal state is active now — the linked guest holds an active client membership on at least one project that the reader can see. An invitation is not access. 0 means no access."
     },
     "projectCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Projects in the reader's scope whose client it is."
     },
     "isNew": {
      "type": "boolean",
      "description": "XM-1317 (G-CP-05; F-PRJ-01.R03): true when the organisation is a new client for the reader. The rule is the rule of the catalogue's client groups: the earliest project in the reader's scope started with this client less than projects.newClientDays days ago. An organisation without a project in the reader's scope is new when it was created less than projects.newClientDays days ago. The create-project dialog shows the new clients in the group \"New clients\"."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "archive",
       "delete"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "archive": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean",
        "description": "The capability only; the card and the delete itself decide whether anything still refers to the organisation."
       }
      }
     },
     "legalName": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 200,
      "description": "G-CRM-01: the registered legal name. Null when it is not set."
     },
     "sector": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 80,
      "description": "G-CRM-01: the sector, free text. Null when it is not set."
     },
     "primaryContact": {
      "description": "G-CRM-02: the primary contact. Null when it is not set, or when the contact is not active or the reader cannot see it.",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "type": "object",
        "required": [
         "id",
         "name",
         "email"
        ],
        "properties": {
         "id": {
          "$ref": "#/components/schemas/Uuid"
         },
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         },
         "email": {
          "type": [
           "string",
           "null"
          ],
          "maxLength": 254
         }
        }
       }
      ]
     },
     "projectKeys": {
      "type": "array",
      "maxItems": 2,
      "description": "G-CRM-03: the first keys, by key, of the projects in the reader's scope whose client it is. projectCount is the total.",
      "items": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     "accountOwner": {
      "description": "The owner's Q8 (22 November 2026): the account owner, one internal member of the tenant. Null when it is not set, or when the member is not active or is erased.",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "$ref": "#/components/schemas/ClientOrganisationPersonRef"
       }
      ]
     }
    }
   },
   "ClientGuestRow": {
    "type": "object",
    "required": [
     "kind",
     "id",
     "email",
     "status",
     "can"
    ],
    "description": "Readers without manage_client_sharing on the project (project People, F-TEN-12) receive the row without twoFactor and lastActiveAt, and with every can flag false; can.message is decided for every reader (F-TEN-12.R10).",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "invitation"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "initials": {
      "type": "string",
      "maxLength": 2
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "pending",
       "revoked"
      ]
     },
     "expired": {
      "type": "boolean"
     },
     "twoFactor": {
      "type": "string",
      "enum": [
       "on",
       "off",
       "none"
      ]
     },
     "lastActiveAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "invitedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "revokedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "can": {
      "type": "object",
      "properties": {
       "manage": {
        "type": "boolean"
       },
       "removeFromProject": {
        "type": "boolean"
       },
       "resend": {
        "type": "boolean"
       },
       "revoke": {
        "type": "boolean"
       },
       "preview": {
        "type": "boolean"
       },
       "message": {
        "type": "string",
        "enum": [
         "none",
         "project_conversation"
        ],
        "description": "F-TEN-12.R10 — project_conversation opens the project's client conversation (a client guest is never in a direct conversation, INV-MSG-03); none for invitation rows."
       }
      }
     }
    }
   },
   "ClientGuestTotals": {
    "type": "object",
    "required": [
     "tenantGuests",
     "projectsWithGuests",
     "inThisProject"
    ],
    "properties": {
     "tenantGuests": {
      "type": "integer",
      "minimum": 0
     },
     "projectsWithGuests": {
      "type": "integer",
      "minimum": 0
     },
     "inThisProject": {
      "type": "integer",
      "minimum": 0,
      "description": "Active guests and pending invitations of this project."
     }
    }
   },
   "ClientKnowledgeBody": {
    "type": "object",
    "description": "The client projection of an item's body (memory §3.11, KnowledgeClientProjectionPolicy; INV-MEM-15). Exactly the member that the item's type names is present; nothing else of the internal body reaches a client.",
    "properties": {
     "note": {
      "type": "object",
      "required": [
       "content"
      ],
      "properties": {
       "content": {
        "$ref": "#/components/schemas/KnowledgeMarkdown"
       }
      }
     },
     "fact": {
      "type": "object",
      "required": [
       "statement"
      ],
      "properties": {
       "statement": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "validFrom": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "validUntil": {
        "$ref": "#/components/schemas/DateOnly"
       }
      }
     },
     "decision": {
      "type": "object",
      "required": [
       "statement",
       "rationale",
       "decidedBy",
       "decidedAt",
       "status"
      ],
      "properties": {
       "statement": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       },
       "rationale": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
       },
       "decidedBy": {
        "type": "array",
        "minItems": 1,
        "maxItems": 10,
        "items": {
         "$ref": "#/components/schemas/ClientPersonLabel"
        }
       },
       "decidedAt": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "alternatives": {
        "type": "array",
        "maxItems": 10,
        "items": {
         "$ref": "#/components/schemas/DecisionAlternative"
        }
       },
       "consequences": {
        "type": "string",
        "maxLength": 2000
       },
       "status": {
        "$ref": "#/components/schemas/DecisionStatus"
       },
       "statusReason": {
        "type": "string",
        "minLength": 1,
        "maxLength": 500
       },
       "supersededBy": {
        "$ref": "#/components/schemas/KnowledgeItemKey",
        "description": "Present only when the superseding decision is client-visible to the reader now."
       }
      }
     },
     "meetingSummary": {
      "type": "object",
      "required": [
       "meeting",
       "summary"
      ],
      "properties": {
       "meeting": {
        "type": "object",
        "required": [
         "title",
         "startedAt",
         "endedAt",
         "participants"
        ],
        "properties": {
         "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         },
         "startedAt": {
          "$ref": "#/components/schemas/Instant"
         },
         "endedAt": {
          "$ref": "#/components/schemas/Instant"
         },
         "language": {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$"
         },
         "participants": {
          "type": "array",
          "maxItems": 200,
          "items": {
           "type": "object",
           "required": [
            "displayName",
            "role"
           ],
           "properties": {
            "displayName": {
             "type": "string",
             "minLength": 1,
             "maxLength": 120
            },
            "role": {
             "type": "string",
             "enum": [
              "organiser",
              "participant",
              "bot"
             ]
            }
           }
          }
         }
        }
       },
       "summary": {
        "$ref": "#/components/schemas/KnowledgeMarkdown"
       }
      }
     },
     "actionItem": {
      "type": "object",
      "required": [
       "statement",
       "status"
      ],
      "properties": {
       "statement": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "assignee": {
        "$ref": "#/components/schemas/ClientPersonLabel"
       },
       "dueDate": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "status": {
        "type": "string",
        "enum": [
         "open",
         "ticketed",
         "done",
         "dropped"
        ]
       },
       "ticketKey": {
        "$ref": "#/components/schemas/TicketKey",
        "description": "Present only when Work's client projection shows the ticket to the reader now."
       }
      }
     },
     "question": {
      "type": "object",
      "required": [
       "question",
       "status"
      ],
      "properties": {
       "question": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "status": {
        "type": "string",
        "enum": [
         "open",
         "answered"
        ]
       }
      }
     },
     "risk": {
      "type": "object",
      "required": [
       "statement",
       "likelihood",
       "impact",
       "status"
      ],
      "properties": {
       "statement": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "likelihood": {
        "type": "string",
        "enum": [
         "low",
         "medium",
         "high"
        ]
       },
       "impact": {
        "type": "string",
        "enum": [
         "low",
         "medium",
         "high"
        ]
       },
       "mitigation": {
        "type": "string",
        "maxLength": 2000
       },
       "status": {
        "type": "string",
        "enum": [
         "open",
         "mitigated",
         "accepted",
         "closed"
        ]
       }
      }
     },
     "feedback": {
      "type": "object",
      "required": [
       "content"
      ],
      "properties": {
       "content": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
       }
      }
     },
     "changeRecord": {
      "type": "object",
      "required": [
       "changeKind"
      ],
      "properties": {
       "changeKind": {
        "type": "string",
        "enum": [
         "merge",
         "deploy",
         "release",
         "incident",
         "other"
        ]
       },
       "environment": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40
       },
       "details": {
        "type": "string",
        "maxLength": 5000
       }
      }
     }
    }
   },
   "ClientKnowledgeRow": {
    "type": "object",
    "required": [
     "key",
     "type",
     "title",
     "excerpt",
     "updatedAt"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "excerpt": {
      "type": "string",
      "maxLength": 300
     },
     "decisionStatus": {
      "$ref": "#/components/schemas/DecisionStatus"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ClientKnowledgeView": {
    "type": "object",
    "required": [
     "key",
     "type",
     "title",
     "body",
     "updatedAt"
    ],
    "description": "The client projection (memory §3.11; INV-MEM-15); the author is the client team label (D-005), links only to client-visible targets.",
    "properties": {
     "key": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "body": {
      "$ref": "#/components/schemas/ClientKnowledgeBody"
     },
     "authorLabel": {
      "$ref": "#/components/schemas/ClientTeamLabel"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "links": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/KnowledgeLinkView"
      }
     }
    }
   },
   "ClientLeadCandidateList": {
    "type": "object",
    "description": "F-PRJ-10.R02 (fix round, 24 Nov 2026): the people whom the Client lead picker offers — exactly those whom setProjectClientLead accepts (ClientLeadPolicy): the active internal members of the project's People list without an Admin-role holder, in name order.",
    "required": [
     "items",
     "truncated"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "truncated": {
      "type": "boolean",
      "description": "The project has more than 500 people; the list holds the first 500 by name."
     }
    }
   },
   "ClientLeadRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ClientMemoryEntryRow": {
    "type": "object",
    "description": "Q46 — a client-visible memory entry on the portal's Knowledge page. No member, source, version or id of a hidden record.",
    "required": [
     "id",
     "path",
     "directory",
     "name",
     "title",
     "sizeBytes",
     "updatedAt",
     "excerpt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "path": {
      "$ref": "#/components/schemas/MemoryEntryPathValue"
     },
     "directory": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 512
     },
     "name": {
      "type": "string",
      "maxLength": 80
     },
     "title": {
      "type": "string",
      "maxLength": 77
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 0
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "excerpt": {
      "type": "string",
      "maxLength": 240,
      "description": "Plain text from the start of the entry; link destinations and images are dropped."
     }
    }
   },
   "ClientMemoryEntryView": {
    "type": "object",
    "required": [
     "id",
     "path",
     "directory",
     "name",
     "title",
     "sizeBytes",
     "updatedAt",
     "authorLabel",
     "body",
     "links"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "path": {
      "$ref": "#/components/schemas/MemoryEntryPathValue"
     },
     "directory": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 512
     },
     "name": {
      "type": "string",
      "maxLength": 80
     },
     "title": {
      "type": "string",
      "maxLength": 77
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 0
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "authorLabel": {
      "type": "string",
      "description": "The client team label (D-005), never a member's name."
     },
     "body": {
      "type": "string",
      "description": "CommonMark text; raw HTML is text and is never rendered as HTML."
     },
     "links": {
      "type": "array",
      "maxItems": 200,
      "description": "The entries the body's links name that the client may read (F-MEM-14.R13), by lower-case path. Any other link shows as text.",
      "items": {
       "type": "object",
       "required": [
        "pathKey",
        "entryId"
       ],
       "properties": {
        "pathKey": {
         "type": "string",
         "maxLength": 1024
        },
        "entryId": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      }
     }
    }
   },
   "ClientOrganisationCreateRequest": {
    "type": "object",
    "required": [
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "website": {
      "type": "string",
      "maxLength": 2048
     },
     "legalName": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 200,
      "description": "G-CRM-01. An empty text is none."
     },
     "sector": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 80,
      "description": "G-CRM-01. An empty text is none."
     }
    }
   },
   "ClientOrganisationPatch": {
    "type": "object",
    "minProperties": 1,
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "website": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 2048,
      "description": "A null value removes the website."
     },
     "legalName": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 200,
      "description": "G-CRM-01. A null value or an empty text removes it."
     },
     "sector": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 80,
      "description": "G-CRM-01. A null value or an empty text removes it."
     },
     "primaryContactId": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid",
      "description": "G-CRM-02. An active contact of this organisation that the caller can see, else 422 client_organisation.primary_contact_invalid. A null value removes it."
     },
     "accountOwnerId": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid",
      "description": "The owner's Q8 (22 November 2026). An active internal member of the tenant, else 422 client_organisation.account_owner_invalid. A null value or an empty text removes it."
     }
    }
   },
   "ClientOrganisationPersonRef": {
    "type": "object",
    "description": "The owner's Q8: an active member as the client page shows the account owner and a project lead.",
    "required": [
     "id",
     "name",
     "initials"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "initials": {
      "type": "string",
      "maxLength": 4
     }
    }
   },
   "ClientOrganisationRef": {
    "type": "object",
    "required": [
     "id",
     "name",
     "status"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Orbit Retail"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     }
    }
   },
   "ClientPeriodView": {
    "type": "object",
    "required": [
     "number",
     "clientVersion",
     "openedAt",
     "messageCount",
     "current"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "openedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "closedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "messageCount": {
      "type": "integer",
      "minimum": 0
     },
     "sharedIntoCurrentCount": {
      "type": "integer",
      "minimum": 0
     },
     "current": {
      "type": "boolean"
     }
    }
   },
   "ClientPersonLabel": {
    "type": "object",
    "required": [
     "kind",
     "label"
    ],
    "description": "A person as a client sees the person; members show as the client team label (D-005), named people by their name.",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "team",
       "named"
      ]
     },
     "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Northwind team"
     }
    }
   },
   "ClientProjectPage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ClientCardProject"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "page"
      ],
      "properties": {
       "page": {
        "$ref": "#/components/schemas/CursorPageMeta"
       }
      }
     },
     "links": {
      "$ref": "#/components/schemas/CursorLinks"
     }
    }
   },
   "ClientSharingConsequence": {
    "type": "object",
    "required": [
     "widened",
     "narrowed",
     "clientVersion",
     "lines"
    ],
    "properties": {
     "widened": {
      "type": "boolean"
     },
     "narrowed": {
      "type": "boolean"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "lines": {
      "type": "array",
      "maxItems": 64,
      "items": {
       "type": "object",
       "required": [
        "field",
        "change",
        "sentence",
        "ticketCount"
       ],
       "properties": {
        "field": {
         "type": "string",
         "maxLength": 40
        },
        "change": {
         "type": "string",
         "enum": [
          "shown",
          "hidden",
          "level_raised",
          "level_lowered"
         ]
        },
        "sentence": {
         "type": "string",
         "maxLength": 200,
         "example": "Clients of ATLAS will see Estimate on 34 client-visible tickets."
        },
        "ticketCount": {
         "type": "integer",
         "minimum": 0
        }
       }
      }
     }
    }
   },
   "ClientSharingPolicyInput": {
    "type": "object",
    "required": [
     "visibleFields",
     "timeVisibility",
     "visibleCustomFields"
    ],
    "additionalProperties": false,
    "properties": {
     "visibleFields": {
      "type": "array",
      "maxItems": 16,
      "uniqueItems": true,
      "description": "The client-eligible built-in fields — 16 of the 18; internal_comments and history are never shown to clients (INV-ACC-03, CFL-414). priority and reporter (XM-1092) are guarded: off until an Admin turns them on.",
      "items": {
       "$ref": "#/components/schemas/TicketFieldKey"
      }
     },
     "timeVisibility": {
      "type": "string",
      "enum": [
       "hidden",
       "monthly_totals",
       "weekly_totals",
       "entries"
      ]
     },
     "visibleCustomFields": {
      "type": "array",
      "maxItems": 50,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "ClientSharingPolicySaveRequest": {
    "type": "object",
    "required": [
     "policy",
     "expectedClientVersion",
     "confirmWidening"
    ],
    "additionalProperties": false,
    "properties": {
     "policy": {
      "$ref": "#/components/schemas/ClientSharingPolicyInput"
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "confirmWidening": {
      "type": "boolean",
      "description": "Must be true when the proposed policy widens anything."
     }
    }
   },
   "ClientSharingPreviewRequest": {
    "type": "object",
    "required": [
     "policy"
    ],
    "additionalProperties": false,
    "properties": {
     "policy": {
      "$ref": "#/components/schemas/ClientSharingPolicyInput"
     },
     "roleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "ticketKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}-[0-9]{1,7}$"
     }
    }
   },
   "ClientSharingReviewCounts": {
    "type": "object",
    "description": "The number of items per kind shared with an earlier client that the reader may see (XM-1035). A kind that the reader's role hides is not in `kinds`.",
    "required": [
     "clientVersion",
     "kinds"
    ],
    "properties": {
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "kinds": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "type": "object",
       "required": [
        "kind",
        "count"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "tickets",
          "attachments",
          "doc_pages",
          "comments",
          "conversation_periods"
         ]
        },
        "count": {
         "type": "integer",
         "minimum": 0
        }
       }
      }
     }
    }
   },
   "ClientSharingReviewPage": {
    "type": "object",
    "required": [
     "clientVersion",
     "kind",
     "items"
    ],
    "properties": {
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "kind": {
      "type": "string",
      "enum": [
       "tickets",
       "attachments",
       "doc_pages",
       "comments",
       "conversation_periods"
      ]
     },
     "items": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "kind",
        "id",
        "label",
        "sharedUnder"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "tickets",
          "attachments",
          "doc_pages",
          "comments",
          "conversation_periods"
         ]
        },
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "key": {
         "type": "string"
        },
        "label": {
         "type": "string",
         "maxLength": 200
        },
        "sharedUnder": {
         "type": "object",
         "required": [
          "clientVersion"
         ],
         "properties": {
          "organisation": {
           "$ref": "#/components/schemas/NamedRef"
          },
          "clientVersion": {
           "$ref": "#/components/schemas/ClientVersion"
          }
         }
        },
        "sharedAt": {
         "description": "The instant at which the item became visible to the client of `sharedUnder` (XM-1039). Absent when no instant was recorded (a file shared before this field existed); the UI shows \"—\".",
         "$ref": "#/components/schemas/Instant"
        },
        "parent": {
         "type": "object",
         "description": "The item that holds an attachment or a client-thread comment (XM-1040). Only a parent the reader sees; its title only while the reader's role shows the title field.",
         "required": [
          "kind",
          "key"
         ],
         "properties": {
          "kind": {
           "type": "string",
           "enum": [
            "ticket"
           ]
          },
          "key": {
           "type": "string"
          },
          "title": {
           "type": "string",
           "maxLength": 200
          }
         }
        }
       }
      }
     }
    }
   },
   "ClientSharingSummaryRow": {
    "type": "object",
    "description": "XM-1469. One project of the tenant's Client sharing list. `fieldsShown` of `fieldsTotal` are the built-in client fields of the project's sharing policy (F-ACC-09; `fieldsTotal` is the size of the current field registry, 16). `columnsShown` of `columnsTotal` are the board stages with the presentation `shown` of all the project's stages (D-003). `guestCount` uses the rule of the project's own guest total (F-TEN-13). `clientLead` is null when no lead is chosen or the lead is not an active member (F-PRJ-10).",
    "required": [
     "projectId",
     "key",
     "name",
     "clientOrganisation",
     "portalOn",
     "fieldsShown",
     "fieldsTotal",
     "columnsShown",
     "columnsTotal",
     "guestCount",
     "clientLead",
     "can"
    ],
    "properties": {
     "projectId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "clientOrganisation": {
      "description": "The project's client organisation as the reader may see it; null for an internal project or an organisation the reader does not see.",
      "oneOf": [
       {
        "$ref": "#/components/schemas/NamedRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "portalOn": {
      "type": "boolean",
      "description": "The Client portal module is available on the project (F-PRJ-05)."
     },
     "fieldsShown": {
      "type": "integer",
      "minimum": 0,
      "maximum": 64
     },
     "fieldsTotal": {
      "type": "integer",
      "minimum": 1,
      "maximum": 64
     },
     "columnsShown": {
      "type": "integer",
      "minimum": 0,
      "maximum": 20
     },
     "columnsTotal": {
      "type": "integer",
      "minimum": 0,
      "maximum": 20
     },
     "guestCount": {
      "type": "integer",
      "minimum": 0
     },
     "clientLead": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/NamedRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "can": {
      "type": "object",
      "required": [
       "open"
      ],
      "properties": {
       "open": {
        "type": "boolean",
        "description": "The reader may open the project's Client sharing page."
       }
      }
     }
    }
   },
   "ClientSharingView": {
    "type": "object",
    "required": [
     "project",
     "portalOn",
     "clientVersion",
     "policy",
     "version",
     "columns",
     "can"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "portalOn": {
      "type": "boolean"
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "policy": {
      "$ref": "#/components/schemas/ClientSharingPolicyInput"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "customFieldOptions": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "id",
        "key",
        "name",
        "clientClass"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "key": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "clientClass": {
         "type": "string",
         "enum": [
          "guarded",
          "never_client"
         ]
        }
       }
      }
     },
     "columns": {
      "type": "array",
      "maxItems": 30,
      "items": {
       "type": "object",
       "required": [
        "stageId",
        "name",
        "colour",
        "presentation"
       ],
       "properties": {
        "stageId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "name": {
         "type": "string"
        },
        "colour": {
         "$ref": "#/components/schemas/StageColourKey"
        },
        "presentation": {
         "type": "string",
         "enum": [
          "shown",
          "merged",
          "hidden"
         ]
        },
        "mergedInto": {
         "description": "The shown stage this stage is merged into, by id (like BoardStageView.mergedInto; CG-13).",
         "allOf": [
          {
           "$ref": "#/components/schemas/Uuid"
          }
         ]
        }
       }
      }
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "editGuarded",
       "invite"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "editGuarded": {
        "type": "boolean"
       },
       "invite": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ClientShortcut": {
    "type": "object",
    "required": [
     "id",
     "name",
     "archived"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Orbit Retail"
     },
     "archived": {
      "type": "boolean"
     },
     "pinnedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "openedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ClientShortcuts": {
    "type": "object",
    "required": [
     "pinned",
     "recent",
     "pinLimit"
    ],
    "properties": {
     "pinned": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ClientShortcut"
      }
     },
     "recent": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/ClientShortcut"
      }
     },
     "pinLimit": {
      "type": "integer",
      "minimum": 1,
      "example": 20
     }
    }
   },
   "ClientStageView": {
    "type": "object",
    "description": "The presented stage a client reads — the stage itself or its merge target (D-003); never the internal stage behind it.",
    "required": [
     "id",
     "name",
     "kind",
     "colour"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "In progress"
     },
     "kind": {
      "$ref": "#/components/schemas/StageKindKey"
     },
     "colour": {
      "$ref": "#/components/schemas/StageColourKey"
     }
    }
   },
   "ClientTeamLabel": {
    "type": "string",
    "minLength": 1,
    "maxLength": 80,
    "description": "The tenant's client-facing team name (ClientTeamLabelPolicy; D-002) — shown to clients instead of a masked person.",
    "example": "Northwind team"
   },
   "ClientTourRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "skip": {
      "type": "string",
      "enum": [
       "approve",
       "comment",
       "documents"
      ]
     },
     "dismiss": {
      "type": "boolean"
     }
    }
   },
   "ClientTourView": {
    "type": "object",
    "required": [
     "steps",
     "visible"
    ],
    "properties": {
     "visible": {
      "type": "boolean"
     },
     "steps": {
      "type": "object",
      "required": [
       "approve",
       "comment",
       "documents"
      ],
      "properties": {
       "approve": {
        "type": "string",
        "enum": [
         "pending",
         "completed",
         "skipped"
        ]
       },
       "comment": {
        "type": "string",
        "enum": [
         "pending",
         "completed",
         "skipped"
        ]
       },
       "documents": {
        "type": "string",
        "enum": [
         "pending",
         "completed",
         "skipped"
        ]
       }
      }
     }
    }
   },
   "ClientVersion": {
    "type": "integer",
    "minimum": 1,
    "example": 3
   },
   "ClientVisibilityRequest": {
    "type": "object",
    "required": [
     "visible",
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "visible": {
      "type": "boolean"
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "ClientVisitRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "organisationId"
    ],
    "properties": {
     "organisationId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "CombinedFigures": {
    "type": "object",
    "required": [
     "cost"
    ],
    "properties": {
     "cost": {
      "$ref": "#/components/schemas/Money"
     },
     "bill": {
      "$ref": "#/components/schemas/Money"
     }
    }
   },
   "CommentAuthorView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "client",
       "automation"
      ]
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "organisationName": {
      "type": "string",
      "maxLength": 200,
      "example": "Orbit Retail"
     },
     "rule": {
      "$ref": "#/components/schemas/NamedRef"
     }
    }
   },
   "CommentCreateRequest": {
    "type": "object",
    "required": [
     "thread",
     "body"
    ],
    "additionalProperties": false,
    "properties": {
     "thread": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "fileIds": {
      "type": "array",
      "maxItems": 10,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "The comment that this one replies to (F-WRK-21.R15; XM-931). A reply to a reply takes the same top-level parent."
     },
     "quotedMessageId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "The client-thread message that this client-thread comment quotes (F-WRK-21.R17; XM-931)."
     }
    }
   },
   "CommentPatch": {
    "type": "object",
    "required": [
     "body"
    ],
    "additionalProperties": false,
    "properties": {
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     }
    }
   },
   "CommentQuoteView": {
    "type": "object",
    "description": "The client-thread message that a client-thread comment quotes, as the reader sees it now (F-WRK-21.R17; XM-931). A message that the reader cannot see now (deleted, erased or hidden) has `available: false` and no `author` and no `excerpt`.",
    "required": [
     "commentId",
     "available"
    ],
    "properties": {
     "commentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "available": {
      "type": "boolean"
     },
     "author": {
      "$ref": "#/components/schemas/CommentAuthorView"
     },
     "excerpt": {
      "type": "string",
      "maxLength": 280
     }
    }
   },
   "CommentReplyView": {
    "type": "object",
    "description": "A reply: a comment one level under its top-level parent (F-WRK-21.R15; XM-931). It has no replies of its own.",
    "required": [
     "id",
     "thread",
     "author",
     "body",
     "postedAt",
     "attachments",
     "version",
     "reactions",
     "can",
     "parentId"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "thread": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "author": {
      "$ref": "#/components/schemas/CommentAuthorView"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "mentions": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "attachments": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/AttachmentView"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "reactions": {
      "type": "array",
      "maxItems": 50,
      "description": "As `CommentView.reactions` (F-WRK-38.R06, R08, R10); a reply carries its reactions like any comment (batch work, XM-931 with XM-932).",
      "items": {
       "$ref": "#/components/schemas/ReactionSummaryView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "delete",
       "react",
       "resolve"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       },
       "react": {
        "type": "boolean",
        "description": "As `CommentView.can.react` (F-WRK-38.R05, R06)."
       },
       "resolve": {
        "type": "boolean",
        "enum": [
         false
        ],
        "description": "A reply is never resolved on its own (F-WRK-21.R19, XM-933)."
       }
      }
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "quote": {
      "$ref": "#/components/schemas/CommentQuoteView"
     },
     "clientReadAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "As `CommentView.clientReadAt` (F-WRK-16.R30, XM-1106): a reply of the team in the client thread that a client guest read."
     }
    }
   },
   "CommentView": {
    "type": "object",
    "required": [
     "id",
     "thread",
     "author",
     "body",
     "postedAt",
     "attachments",
     "version",
     "reactions",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "thread": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "author": {
      "$ref": "#/components/schemas/CommentAuthorView"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "mentions": {
      "type": "array",
      "maxItems": 20,
      "description": "The members the body's mention nodes name, in order of first mention, resolved at read (`former` once removed; F-WRK-21.R14, CG-14).",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "attachments": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/AttachmentView"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "reactions": {
      "type": "array",
      "maxItems": 50,
      "description": "One summary per emoji with at least one reaction, in the order of the emoji's first reaction (F-WRK-38.R06, R08); at most 50 distinct emoji on a comment (R10).",
      "items": {
       "$ref": "#/components/schemas/ReactionSummaryView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "delete",
       "react",
       "resolve"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       },
       "react": {
        "type": "boolean",
        "description": "The reader is a person and the project is active (F-WRK-38.R05, R06)."
       },
       "resolve": {
        "type": "boolean",
        "description": "The reader may resolve or reopen this comment: a top-level comment, an active project, and `CommentResolvePolicy` (the author, the ticket's assignee or a moderator of the thread; F-WRK-21.R19, XM-933). Always false on a reply."
       }
      }
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "A reply names its top-level parent (F-WRK-21.R15; XM-931): the answer to a post or an edit of a reply. A reply has no `replyCount` and no `replies`."
     },
     "replyCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The number of replies of this top-level comment that the reader may see (F-WRK-21.R16; XM-931)."
     },
     "replies": {
      "type": "array",
      "maxItems": 10,
      "description": "The first replies, oldest first (at most 10 †). When `replyCount` is larger, `listCommentReplies` gives all of them (F-WRK-21.R16).",
      "items": {
       "$ref": "#/components/schemas/CommentReplyView"
      }
     },
     "quote": {
      "$ref": "#/components/schemas/CommentQuoteView"
     },
     "resolvedBy": {
      "$ref": "#/components/schemas/MemberRef",
      "description": "A resolved top-level comment: the member who resolved it, resolved at read (`former` once removed; F-WRK-21.R19, XM-933). Absent while the comment is open."
     },
     "resolvedAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "When the comment was resolved (F-WRK-21.R19, XM-933). Absent while the comment is open."
     },
     "clientReadAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "A message of the client thread that the team wrote (a member, a rule or the system): when a client guest read it — the earliest read time of the guests whose read marker reaches the message (\"Read 09:41\"; F-WRK-16.R30, XM-1106). Absent on a client's own message, in the internal thread and while no guest has read it."
     }
    }
   },
   "ConfidenceLevel": {
    "type": "string",
    "enum": [
     "low",
     "medium",
     "high"
    ],
    "description": "Always rendered with its word (BR-Discovery-05)."
   },
   "ConnectedAppView": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "name",
     "purpose",
     "connectedAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "calendar_feed"
      ]
     },
     "name": {
      "type": "string",
      "maxLength": 80,
      "example": "Google Calendar"
     },
     "purpose": {
      "type": "string",
      "maxLength": 200,
      "example": "Your due dates in your calendar"
     },
     "tenantName": {
      "type": "string",
      "maxLength": 120
     },
     "connectedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastUsedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ConnectionStatusKey": {
    "type": "string",
    "enum": [
     "connected",
     "rotation_due",
     "expiring",
     "expired",
     "webhook_failing",
     "paused",
     "disconnected"
    ]
   },
   "ContactCreateRequest": {
    "type": "object",
    "required": [
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "phone": {
      "type": "string",
      "pattern": "^\\+[1-9][0-9]{6,14}$"
     },
     "jobTitle": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     }
    }
   },
   "ContactErasureResult": {
    "type": "object",
    "required": [
     "contactId",
     "name",
     "erasedAt",
     "certified"
    ],
    "properties": {
     "contactId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "example": "Former contact · 3fa91c"
     },
     "erasedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "certified": {
      "type": "boolean",
      "description": "False until the ledger accepted the certificate; the erasure itself is complete."
     }
    }
   },
   "ContactExportRequest": {
    "type": "object",
    "minProperties": 1,
    "maxProperties": 1,
    "additionalProperties": false,
    "properties": {
     "ids": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10000,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "filter": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "q": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       },
       "organisationId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "projectKey": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "status": {
        "type": "string",
        "enum": [
         "active",
         "archived",
         "all"
        ]
       }
      }
     }
    }
   },
   "ContactInviteOptions": {
    "type": "object",
    "required": [
     "contactId",
     "canInvite",
     "projects"
    ],
    "properties": {
     "contactId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "canInvite": {
      "type": "boolean"
     },
     "reason": {
      "type": "string",
      "enum": [
       "no_email",
       "linked_and_active",
       "erased",
       "archived",
       "portal_unavailable",
       "no_eligible_project"
      ]
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "projects": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "key",
        "name",
        "clientVersion",
        "state"
       ],
       "properties": {
        "key": {
         "$ref": "#/components/schemas/ProjectKey"
        },
        "name": {
         "type": "string",
         "maxLength": 120
        },
        "clientVersion": {
         "$ref": "#/components/schemas/ClientVersion"
        },
        "state": {
         "$ref": "#/components/schemas/ContactPortalState"
        },
        "invitable": {
         "type": "boolean"
        }
       }
      }
     }
    }
   },
   "ContactInviteRequest": {
    "type": "object",
    "required": [
     "projectKey",
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "ContactInviteResult": {
    "type": "object",
    "required": [
     "contactId",
     "invitationId",
     "projectKey",
     "expiresAt"
    ],
    "properties": {
     "contactId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "invitationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "resent": {
      "type": "boolean",
      "description": "True when an expired invitation for this contact was resent instead of a new one created."
     }
    }
   },
   "ContactPage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/ContactRow"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "page"
      ],
      "properties": {
       "page": {
        "$ref": "#/components/schemas/OffsetPageMeta"
       }
      }
     }
    }
   },
   "ContactPatch": {
    "type": "object",
    "minProperties": 1,
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "email": {
      "type": [
       "string",
       "null"
      ],
      "format": "email",
      "maxLength": 254
     },
     "phone": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\+[1-9][0-9]{6,14}$"
     },
     "jobTitle": {
      "type": [
       "string",
       "null"
      ],
      "minLength": 1,
      "maxLength": 120
     }
    }
   },
   "ContactPickerPage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/ContactPickerRow"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "page"
      ],
      "properties": {
       "page": {
        "$ref": "#/components/schemas/OffsetPageMeta"
       }
      }
     }
    }
   },
   "ContactPickerRow": {
    "type": "object",
    "required": [
     "id",
     "name",
     "organisation"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 120
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "organisation": {
      "$ref": "#/components/schemas/ClientOrganisationRef"
     }
    }
   },
   "ContactPortalEntry": {
    "type": "object",
    "required": [
     "projectKey",
     "state"
    ],
    "properties": {
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "state": {
      "$ref": "#/components/schemas/ContactPortalState"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ContactPortalState": {
    "type": "string",
    "enum": [
     "no_access",
     "invited",
     "invited_expired",
     "active",
     "revoked",
     "client_replaced"
    ]
   },
   "ContactPortalSummary": {
    "type": "object",
    "required": [
     "state",
     "activeProjects",
     "entries"
    ],
    "properties": {
     "state": {
      "$ref": "#/components/schemas/ContactPortalState"
     },
     "activeProjects": {
      "type": "integer",
      "minimum": 0
     },
     "entries": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/ContactPortalEntry"
      }
     }
    }
   },
   "ContactRow": {
    "type": "object",
    "required": [
     "id",
     "organisationId",
     "name",
     "status",
     "linked",
     "portal",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "organisationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Daniel Hughes"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "phone": {
      "type": "string",
      "pattern": "^\\+[1-9][0-9]{6,14}$",
      "example": "+442071234567"
     },
     "jobTitle": {
      "type": "string",
      "maxLength": 120,
      "example": "Head of Digital"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived",
       "erased"
      ]
     },
     "linked": {
      "type": "boolean",
      "description": "True when the contact mirrors a client guest's name and e-mail."
     },
     "portal": {
      "$ref": "#/components/schemas/ContactPortalSummary"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "archive",
       "restore",
       "invite",
       "erase"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "archive": {
        "type": "boolean"
       },
       "restore": {
        "type": "boolean"
       },
       "invite": {
        "type": "boolean"
       },
       "erase": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ContactView": {
    "allOf": [
     {
      "$ref": "#/components/schemas/ContactRow"
     },
     {
      "type": "object",
      "required": [
       "organisation",
       "projects"
      ],
      "properties": {
       "organisation": {
        "$ref": "#/components/schemas/ClientOrganisationRef"
       },
       "linkedMember": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "projects": {
        "type": "array",
        "maxItems": 25,
        "items": {
         "$ref": "#/components/schemas/ClientCardProject"
        }
       },
       "createdAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "archivedAt": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     }
    ]
   },
   "ConversationKind": {
    "type": "string",
    "enum": [
     "direct",
     "group",
     "project_client"
    ],
    "x-extensible-enum": true
   },
   "ConversationLastMessage": {
    "type": "object",
    "required": [
     "sequence",
     "postedAt",
     "authorLabel",
     "deleted"
    ],
    "properties": {
     "sequence": {
      "type": "integer",
      "minimum": 1
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "authorLabel": {
      "type": "string",
      "maxLength": 120,
      "example": "Lena Ruiz"
     },
     "excerpt": {
      "type": "string",
      "maxLength": 160,
      "example": "The approval screens are ready for review."
     },
     "deleted": {
      "type": "boolean"
     }
    }
   },
   "ConversationPage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/ConversationRow"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "page",
       "conversationsWithUnread"
      ],
      "properties": {
       "page": {
        "$ref": "#/components/schemas/CursorPageMeta"
       },
       "conversationsWithUnread": {
        "type": "integer",
        "minimum": 0,
        "maximum": 99
       }
      }
     },
     "links": {
      "$ref": "#/components/schemas/CursorLinks"
     }
    }
   },
   "ConversationPatch": {
    "type": "object",
    "required": [
     "title"
    ],
    "additionalProperties": false,
    "properties": {
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     }
    }
   },
   "ConversationRow": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "title",
     "status",
     "unreadCount",
     "muted",
     "clientVisible",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "$ref": "#/components/schemas/ConversationKind"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160,
      "example": "Lena Ruiz"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "peer": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "participantCount": {
      "type": "integer",
      "minimum": 2
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "clientVisible": {
      "type": "boolean",
      "description": "True for the project conversation."
     },
     "lastMessage": {
      "$ref": "#/components/schemas/ConversationLastMessage"
     },
     "lastMessageAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "unreadCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99
     },
     "muted": {
      "type": "boolean"
     },
     "readOnly": {
      "type": "boolean",
      "description": "True when archived or the project is archived or the peer was removed."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "ConversationStartRequest": {
    "oneOf": [
     {
      "$ref": "#/components/schemas/DirectConversationStart"
     },
     {
      "$ref": "#/components/schemas/GroupConversationStart"
     }
    ],
    "discriminator": {
     "propertyName": "kind"
    }
   },
   "ConversationView": {
    "allOf": [
     {
      "$ref": "#/components/schemas/ConversationRow"
     },
     {
      "type": "object",
      "required": [
       "realtimeChannel",
       "audienceVersion",
       "lastSequence",
       "lastReadSequence",
       "can"
      ],
      "properties": {
       "realtimeChannel": {
        "type": "string",
        "maxLength": 200,
        "example": "private-tenant.0192f1a8-7c3e-7b10-9a2e-5d1f0c4b8e21.conversation.0192f1b4-1e0a-7c55-8f21-3b9d6a7c1100.v1"
       },
       "audienceVersion": {
        "$ref": "#/components/schemas/AudienceEpoch"
       },
       "lastSequence": {
        "type": "integer",
        "minimum": 0
       },
       "lastReadSequence": {
        "type": "integer",
        "minimum": 0
       },
       "participants": {
        "type": "array",
        "maxItems": 200,
        "items": {
         "$ref": "#/components/schemas/ParticipantView"
        }
       },
       "createdBy": {
        "$ref": "#/components/schemas/MemberRef",
        "description": "The member who started a group conversation (XM-1054, GAP-MSG-03; \"created by <name>\"). Groups only."
       },
       "periods": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/ClientPeriodView"
        }
       },
       "visibleTo": {
        "$ref": "#/components/schemas/NamedRef"
       },
       "project": {
        "type": "object",
        "required": [
         "key",
         "name"
        ],
        "properties": {
         "key": {
          "$ref": "#/components/schemas/ProjectKey"
         },
         "name": {
          "type": "string",
          "maxLength": 120
         }
        }
       },
       "can": {
        "type": "object",
        "required": [
         "post",
         "rename",
         "addParticipants",
         "removeParticipants",
         "leave",
         "archive",
         "mute",
         "moderate",
         "shareHistory"
        ],
        "properties": {
         "post": {
          "type": "boolean"
         },
         "rename": {
          "type": "boolean"
         },
         "addParticipants": {
          "type": "boolean"
         },
         "removeParticipants": {
          "type": "boolean"
         },
         "leave": {
          "type": "boolean"
         },
         "archive": {
          "type": "boolean"
         },
         "mute": {
          "type": "boolean"
         },
         "moderate": {
          "type": "boolean"
         },
         "shareHistory": {
          "type": "boolean"
         }
        }
       }
      }
     }
    ]
   },
   "CostEntryView": {
    "type": "object",
    "required": [
     "id",
     "worklogId",
     "member",
     "workDate",
     "minutes",
     "kind",
     "cause",
     "rateSource",
     "postedAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "worklogId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "workDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "minutes": {
      "type": "integer",
      "minimum": -1440,
      "maximum": 1440
     },
     "kind": {
      "type": "string",
      "enum": [
       "posting",
       "reversal"
      ]
     },
     "cause": {
      "type": "string",
      "enum": [
       "accepted",
       "reopened",
       "revised",
       "rate_changed",
       "role_changed",
       "exchange_changed",
       "rebuild"
      ]
     },
     "rateSource": {
      "type": "string",
      "enum": [
       "project_member",
       "project_role",
       "member",
       "role",
       "none"
      ]
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "ticket": {
      "$ref": "#/components/schemas/TimeTicketRef"
     },
     "cost": {
      "$ref": "#/components/schemas/Money"
     },
     "bill": {
      "$ref": "#/components/schemas/Money"
     },
     "rate": {
      "$ref": "#/components/schemas/HourlyRate",
      "description": "The cost rate that priced the entry (its cost rate version). Absent for rate source none and for an erased amount (XM-869, XM-872)."
     },
     "billRate": {
      "$ref": "#/components/schemas/HourlyRate",
      "description": "The bill rate that priced the entry, while bill rates are on and the entry is billable (XM-869, XM-872)."
     },
     "unconverted": {
      "type": "boolean"
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "CostRebuildRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "reason"
    ],
    "properties": {
     "from": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     }
    }
   },
   "CostTypeRef": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "labour",
       "expense"
      ]
     },
     "category": {
      "$ref": "#/components/schemas/ExpenseCategoryRef"
     }
    }
   },
   "CreatorMemberId": {
    "description": "The member who created the row, by member id only (XM-924). Null when no creator is recorded, when the member erasure has pseudonymised the creator, or when the reader must not see that member's id. Never a name, an e-mail address or an account id.",
    "oneOf": [
     {
      "$ref": "#/components/schemas/Uuid"
     },
     {
      "type": "null"
     }
    ]
   },
   "CurrencyCode": {
    "type": "string",
    "pattern": "^[A-Z]{3}$",
    "description": "An ISO 4217 alphabetic code that the currency registry knows.",
    "example": "EUR"
   },
   "CurrencyView": {
    "type": "object",
    "required": [
     "code",
     "name",
     "minorUnits",
     "enabled",
     "base"
    ],
    "properties": {
     "code": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "name": {
      "type": "string",
      "maxLength": 80,
      "example": "Euro"
     },
     "minorUnits": {
      "type": "integer",
      "minimum": 0,
      "maximum": 3
     },
     "enabled": {
      "type": "boolean"
     },
     "base": {
      "type": "boolean"
     }
    }
   },
   "CurrentMembershipFields": {
    "type": "object",
    "description": "Present when X-Kanso-Tenant names one of the account's tenants.",
    "required": [
     "tenantId"
    ],
    "properties": {
     "tenantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "jobTitle": {
      "type": "string",
      "maxLength": 80
     },
     "defaultProject": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "type": "string"
       },
       "name": {
        "type": "string"
       }
      }
     }
    }
   },
   "CursorLinks": {
    "type": "object",
    "properties": {
     "next": {
      "type": "string",
      "maxLength": 2048,
      "example": "/api/v1/audit-events?page%5Bcursor%5D=eyJ0IjoiMjAyNi0xMC0xN1QxNDozMjowOFoifQ"
     }
    }
   },
   "CursorPageMeta": {
    "type": "object",
    "required": [
     "size",
     "hasMore"
    ],
    "properties": {
     "size": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
     },
     "hasMore": {
      "type": "boolean"
     }
    }
   },
   "CustomFieldConfigInput": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "maxLength": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
     },
     "scale": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4
     },
     "min": {
      "type": "string",
      "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,4})?$"
     },
     "max": {
      "type": "string",
      "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,4})?$"
     },
     "unit": {
      "type": "string",
      "maxLength": 12
     },
     "maxSelections": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20
     },
     "options": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "type": "object",
       "required": [
        "label"
       ],
       "additionalProperties": false,
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "label": {
         "type": "string",
         "minLength": 1,
         "maxLength": 60
        },
        "colour": {
         "$ref": "#/components/schemas/StageColourKey"
        },
        "active": {
         "type": "boolean"
        }
       }
      }
     }
    }
   },
   "CustomFieldConfigView": {
    "type": "object",
    "description": "The typed configuration of the field's type (16 §6.3); members not of the type are absent.",
    "properties": {
     "maxLength": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000
     },
     "scale": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4
     },
     "min": {
      "type": "string",
      "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,4})?$"
     },
     "max": {
      "type": "string",
      "pattern": "^-?[0-9]{1,16}(\\.[0-9]{1,4})?$"
     },
     "unit": {
      "type": "string",
      "maxLength": 12
     },
     "maxSelections": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20
     },
     "options": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/SelectOptionView"
      }
     }
    }
   },
   "CustomFieldCreateRequest": {
    "type": "object",
    "required": [
     "key",
     "name",
     "type",
     "config"
    ],
    "additionalProperties": false,
    "properties": {
     "key": {
      "$ref": "#/components/schemas/CustomFieldKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "description": {
      "type": "string",
      "maxLength": 200
     },
     "type": {
      "$ref": "#/components/schemas/CustomFieldTypeKey"
     },
     "config": {
      "$ref": "#/components/schemas/CustomFieldConfigInput"
     },
     "clientClass": {
      "type": "string",
      "enum": [
       "guarded",
       "never_client"
      ]
     }
    }
   },
   "CustomFieldDeletion": {
    "type": "object",
    "required": [
     "valueCount",
     "projectCount",
     "references"
    ],
    "properties": {
     "valueCount": {
      "type": "integer",
      "minimum": 0
     },
     "projectCount": {
      "type": "integer",
      "minimum": 0
     },
     "references": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/TypedRef"
      }
     },
     "deleted": {
      "type": "boolean",
      "description": "false for a dry run."
     }
    }
   },
   "CustomFieldInputMap": {
    "type": "object",
    "description": "Keyed by the field key; a value is the type's input form (an option id for selects, a member id for member fields), null clears.",
    "maxProperties": 50,
    "additionalProperties": {
     "description": "The type's input form, or null to clear."
    }
   },
   "CustomFieldKey": {
    "type": "string",
    "pattern": "^[a-z][a-z0-9_]{1,39}$",
    "example": "budget_code"
   },
   "CustomFieldPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "description": {
      "type": "string",
      "maxLength": 200
     },
     "config": {
      "$ref": "#/components/schemas/CustomFieldConfigInput"
     },
     "clientClass": {
      "type": "string",
      "enum": [
       "guarded",
       "never_client"
      ]
     }
    }
   },
   "CustomFieldSchemaEntry": {
    "type": "object",
    "required": [
     "key",
     "name",
     "type",
     "config",
     "required",
     "placement",
     "can"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/CustomFieldKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "description": {
      "type": "string",
      "maxLength": 200
     },
     "type": {
      "$ref": "#/components/schemas/CustomFieldTypeKey"
     },
     "config": {
      "description": "The type's typed configuration with option ids and labels — Projects' published CustomFieldConfigView (P2 round 2, CG-02).",
      "allOf": [
       {
        "$ref": "#/components/schemas/CustomFieldConfigView"
       }
      ]
     },
     "required": {
      "type": "boolean"
     },
     "default": {
      "$ref": "#/components/schemas/CustomFieldValue"
     },
     "placement": {
      "type": "object",
      "required": [
       "inCreateDialog",
       "onCard",
       "panelSection"
      ],
      "properties": {
       "inCreateDialog": {
        "type": "boolean"
       },
       "onCard": {
        "type": "boolean"
       },
       "panelSection": {
        "type": "string",
        "enum": [
         "details",
         "more"
        ]
       }
      }
     },
     "accessSensitive": {
      "type": "object",
      "required": [
       "maintenance"
      ],
      "properties": {
       "maintenance": {
        "type": "string",
        "enum": [
         "maintainers_only",
         "consequence_checked"
        ]
       }
      }
     },
     "clientVisible": {
      "type": "boolean",
      "description": "Only for Admins and Product managers of the project."
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "filter"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "filter": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "CustomFieldSelection": {
    "description": "all, none, or an only/except list of custom field keys.",
    "oneOf": [
     {
      "type": "string",
      "enum": [
       "all",
       "none"
      ]
     },
     {
      "type": "object",
      "required": [
       "only"
      ],
      "additionalProperties": false,
      "properties": {
       "only": {
        "type": "array",
        "minItems": 1,
        "maxItems": 50,
        "uniqueItems": true,
        "items": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,39}$"
        }
       }
      }
     },
     {
      "type": "object",
      "required": [
       "except"
      ],
      "additionalProperties": false,
      "properties": {
       "except": {
        "type": "array",
        "minItems": 1,
        "maxItems": 50,
        "uniqueItems": true,
        "items": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,39}$"
        }
       }
      }
     }
    ]
   },
   "CustomFieldTypeKey": {
    "type": "string",
    "enum": [
     "short_text",
     "long_text",
     "number",
     "date",
     "single_select",
     "multi_select",
     "member",
     "url",
     "checkbox"
    ]
   },
   "CustomFieldValue": {
    "type": "object",
    "description": "One of nine typed values with the discriminator type (16 §6.7); masked fields are absent, never null.",
    "required": [
     "type",
     "value"
    ],
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "short_text",
       "long_text",
       "number",
       "date",
       "single_select",
       "multi_select",
       "member",
       "url",
       "checkbox"
      ]
     },
     "value": {
      "description": "short_text/long_text/url: string; number: decimal string with scale 0–4; date: DateOnly; single_select: {id, label}; multi_select: [{id, label}] (1–20); member: MemberRef; checkbox: boolean."
     }
    }
   },
   "CustomFieldValueMap": {
    "type": "object",
    "description": "Keyed by the stable custom field key.",
    "maxProperties": 50,
    "additionalProperties": {
     "$ref": "#/components/schemas/CustomFieldValue"
    }
   },
   "CustomFieldView": {
    "type": "object",
    "required": [
     "id",
     "key",
     "name",
     "type",
     "config",
     "clientClass",
     "status",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/CustomFieldKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Budget code"
     },
     "description": {
      "type": "string",
      "maxLength": 200
     },
     "type": {
      "$ref": "#/components/schemas/CustomFieldTypeKey"
     },
     "config": {
      "$ref": "#/components/schemas/CustomFieldConfigView"
     },
     "clientClass": {
      "type": "string",
      "enum": [
       "guarded",
       "never_client"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived",
       "deleting"
      ]
     },
     "projectCount": {
      "type": "integer",
      "minimum": 0
     },
     "valueCount": {
      "type": "integer",
      "minimum": 0
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "references": {
      "type": "array",
      "maxItems": 50,
      "description": "On listCustomFields only (F-PRJ-13.R08; group E1 live connect, 22 Nov 2026) — what uses the field (active role versions, enabled automation rules); while it is not empty, archive and delete answer 409 custom_field.in_use. Empty for a deleting field.",
      "items": {
       "$ref": "#/components/schemas/TypedRef"
      }
     }
    }
   },
   "DashboardMetrics": {
    "type": "object",
    "required": [
     "myOpenTickets",
     "dueThisWeek",
     "awaitingClientApproval"
    ],
    "properties": {
     "myOpenTickets": {
      "type": "integer",
      "minimum": 0,
      "example": 48
     },
     "dueThisWeek": {
      "type": "integer",
      "minimum": 0
     },
     "awaitingClientApproval": {
      "type": "integer",
      "minimum": 0
     },
     "awaitingClientApprovalSince": {
      "description": "\"Oldest since Oct 13\" (F-WSP-05.R11; XM-1131): when the oldest of the counted approval requests was requested — the same visible rows as awaitingClientApproval. Absent when none is open.",
      "allOf": [
       {
        "$ref": "#/components/schemas/Instant"
       }
      ]
     },
     "myOpenTicketsNewThisWeek": {
      "type": "integer",
      "minimum": 0,
      "description": "The trend of \"My open tickets\" (F-WSP-05.R12; G-H-60): the number of the reader's open tickets that were created in the reader's current week. Absent when it could not be read."
     },
     "week": {
      "type": "object",
      "required": [
       "from",
       "to"
      ],
      "properties": {
       "from": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "to": {
        "$ref": "#/components/schemas/DateOnly"
       }
      }
     }
    }
   },
   "DashboardTicketRow": {
    "type": "object",
    "required": [
     "key",
     "project",
     "stage"
    ],
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 30,
      "example": "ORB-126"
     },
     "title": {
      "type": "string",
      "maxLength": 200,
      "description": "Absent when the reader's mask hides the title (STD-ARCH-011; workspace-2)."
     },
     "project": {
      "$ref": "#/components/schemas/ProjectShortcut"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "stage": {
      "type": "object",
      "required": [
       "name",
       "kind",
       "colour"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 40,
        "example": "In review"
       },
       "kind": {
        "type": "string",
        "enum": [
         "todo",
         "in_progress",
         "in_review",
         "done"
        ]
       },
       "colour": {
        "$ref": "#/components/schemas/StageColourKey"
       }
      }
     },
     "priority": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^[a-z][a-z0-9_]{0,39}$",
      "example": "high",
      "description": "XM-1114 (G-MT-01): the key of an entry of the tenant's priority vocabulary (XM-1098). Not a masked field."
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "loggedMinutes": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1114 (G-MT-01): the logged minutes; absent when the reader's mask hides Time logged."
     },
     "blocked": {
      "type": "boolean",
      "description": "XM-1114 (G-H-43; F-WRK-34.R01): My tickets only — true when an open finish_to_start prerequisite that the reader can view exists; absent when the mask of the ticket's project hides Relations."
     },
     "detail": {
      "$ref": "#/components/schemas/MyWorkDetail"
     }
    }
   },
   "DashboardView": {
    "type": "object",
    "required": [
     "accessibleProjects",
     "metrics",
     "myWork",
     "pinnedProjects",
     "pinnedSource",
     "needsAttention"
    ],
    "properties": {
     "accessibleProjects": {
      "type": "integer",
      "minimum": 0
     },
     "sprintCountdown": {
      "type": "object",
      "description": "The default project's active sprint (D-014; D-111); absent without a default project or an active sprint.",
      "required": [
       "projectKey",
       "sprintName",
       "endsOn"
      ],
      "properties": {
       "projectKey": {
        "type": "string",
        "maxLength": 10
       },
       "sprintName": {
        "type": "string",
        "maxLength": 60
       },
       "endsOn": {
        "$ref": "#/components/schemas/DateOnly"
       }
      }
     },
     "metrics": {
      "$ref": "#/components/schemas/DashboardMetrics"
     },
     "myWork": {
      "type": "object",
      "required": [
       "items",
       "total"
      ],
      "properties": {
       "items": {
        "type": "array",
        "maxItems": 6,
        "items": {
         "$ref": "#/components/schemas/DashboardTicketRow"
        }
       },
       "total": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "pinnedProjects": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/PinnedProjectHealth"
      }
     },
     "pinnedSource": {
      "type": "string",
      "enum": [
       "pinned",
       "recent"
      ],
      "description": "recent when nothing is pinned (D-111)."
     },
     "unavailable": {
      "type": "array",
      "maxItems": 8,
      "description": "The parts that could not be read in time (F-WSP-05 §13 \"Part unavailable\"; workspace-2): their members carry placeholders (0, empty) that the SPA does not show — it renders \"Couldn't load — Retry\" there. Absent when every part was read.",
      "items": {
       "type": "string",
       "enum": [
        "accessibleProjects",
        "myWork",
        "dueThisWeek",
        "awaitingClientApproval",
        "sprintCountdown",
        "pinnedProjects",
        "needsAttention",
        "stageCounts"
       ]
      }
     },
     "stageCounts": {
      "type": "object",
      "description": "My work's donut (F-WSP-05.R10; XM-1122): the reader's open assigned tickets per open stage kind, counted with the predicate of metrics.myOpenTickets, so the three counts add up to it. 0 placeholders while unavailable lists stageCounts.",
      "required": [
       "todo",
       "inProgress",
       "inReview"
      ],
      "properties": {
       "todo": {
        "type": "integer",
        "minimum": 0
       },
       "inProgress": {
        "type": "integer",
        "minimum": 0
       },
       "inReview": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "needsAttention": {
      "type": "object",
      "required": [
       "items",
       "total"
      ],
      "properties": {
       "items": {
        "type": "array",
        "maxItems": 5,
        "items": {
         "$ref": "#/components/schemas/NeedsAttentionItem"
        }
       },
       "total": {
        "type": "integer",
        "minimum": 0
       }
      }
     }
    }
   },
   "DateOnly": {
    "type": "string",
    "format": "date",
    "example": "2026-10-20"
   },
   "DecisionAlternative": {
    "type": "object",
    "required": [
     "option"
    ],
    "properties": {
     "option": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Magic links by e-mail"
     },
     "reasonRejected": {
      "type": "string",
      "maxLength": 1000,
      "example": "The client's security team does not accept e-mail-only sign-in."
     }
    }
   },
   "DecisionDecider": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "named"
      ]
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Priya Shah (Orbit Retail)"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     }
    }
   },
   "DecisionLogRow": {
    "type": "object",
    "required": [
     "origin",
     "statement",
     "status",
     "decidedAt"
    ],
    "properties": {
     "origin": {
      "type": "string",
      "enum": [
       "memory",
       "discovery"
      ]
     },
     "authorKind": {
      "type": "string",
      "enum": [
       "member",
       "agent"
      ],
      "description": "The author of a Memory row's last revision; a Discovery row's decider is a member."
     },
     "sourceKind": {
      "$ref": "#/components/schemas/KnowledgeSourceKind"
     },
     "untrustedContent": {
      "type": "boolean",
      "description": "Always true on the agent surfaces; in the SPA as KnowledgeItemView.untrustedContent."
     },
     "itemKey": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "opportunityId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "statement": {
      "type": "string",
      "maxLength": 500
     },
     "status": {
      "type": "string",
      "enum": [
       "proposed",
       "accepted",
       "superseded",
       "reversed",
       "build",
       "later",
       "drop"
      ],
      "description": "A Discovery decision shows its outcome (build, later, drop)."
     },
     "decidedAt": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "decidedBy": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/DecisionDecider"
      }
     },
     "linkedTicketKeys": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/TicketKey"
      }
     },
     "supersededBy": {
      "$ref": "#/components/schemas/KnowledgeItemKey",
      "description": "Present only when the reader may read the superseding decision now (INV-MEM-16; review SR-BF3-26)."
     }
    }
   },
   "DecisionOutcome": {
    "type": "string",
    "enum": [
     "build",
     "later",
     "drop"
    ]
   },
   "DecisionRecordBody": {
    "type": "object",
    "required": [
     "statement",
     "rationale",
     "decidedBy",
     "decidedAt",
     "status"
    ],
    "properties": {
     "statement": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "example": "Atlas uses SAML single sign-on with Orbit Retail's IdP for every client user."
     },
     "rationale": {
      "type": "string",
      "minLength": 1,
      "maxLength": 5000
     },
     "decidedBy": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/DecisionDecider"
      }
     },
     "decidedAt": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "alternatives": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/DecisionAlternative"
      }
     },
     "consequences": {
      "type": "string",
      "maxLength": 2000
     },
     "status": {
      "$ref": "#/components/schemas/DecisionStatus"
     },
     "statusReason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     },
     "supersededBy": {
      "$ref": "#/components/schemas/KnowledgeItemKey",
      "description": "Present only when the reader may read the superseding decision now (INV-MEM-16; review SR-BF3-26)."
     },
     "reviewOn": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "DecisionStatus": {
    "type": "string",
    "enum": [
     "proposed",
     "accepted",
     "superseded",
     "reversed"
    ]
   },
   "DecisionStatusRequest": {
    "type": "object",
    "required": [
     "status"
    ],
    "properties": {
     "status": {
      "type": "string",
      "enum": [
       "accepted",
       "reversed"
      ]
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     }
    }
   },
   "DeliveryRoleInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "archived": {
      "type": "boolean"
     }
    }
   },
   "DeliveryRoleListMeta": {
    "type": "object",
    "required": [
     "version"
    ],
    "description": "The version of the whole list (also the ETag; the optional If-Match of replaceDeliveryRoles). Fix round 24 Nov 2026 (F1, the lost updates).",
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DeliveryRoleRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Senior developer"
     },
     "archived": {
      "type": "boolean"
     }
    }
   },
   "DeliveryRoleView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "position",
     "archived"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 199
     },
     "archived": {
      "type": "boolean"
     },
     "memberCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Members whose role in force today is this role. Only for a reader of members' roles (view_rates, manage_rates or administer); a count of one names the member (REV-FINC-10)."
     }
    }
   },
   "DeliveryRolesReplaceRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "roles"
    ],
    "properties": {
     "roles": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/DeliveryRoleInput"
      }
     }
    }
   },
   "DependencyEdge": {
    "type": "object",
    "required": [
     "prerequisite",
     "dependent",
     "dependency",
     "conflict"
    ],
    "properties": {
     "prerequisite": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "dependent": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "dependency": {
      "type": "string",
      "enum": [
       "finish_to_start",
       "finish_to_finish"
      ]
     },
     "conflict": {
      "type": "boolean",
      "description": "The dependent's bar starts (finish-to-start) or ends (finish-to-finish) before the prerequisite's due date. A prerequisite in a done stage is never a conflict (F-WRK-34.R08)."
     }
    }
   },
   "DependencySignalView": {
    "type": "object",
    "required": [
     "blocked",
     "openBlockers",
     "openRequirements"
    ],
    "properties": {
     "blocked": {
      "type": "boolean"
     },
     "openBlockers": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Visible open finish-to-start prerequisites."
     },
     "openRequirements": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Visible open finish-to-finish prerequisites."
     }
    }
   },
   "DirectConversationStart": {
    "type": "object",
    "required": [
     "kind",
     "memberId"
    ],
    "additionalProperties": false,
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "direct"
      ]
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "DiscoveryPresenceChannelName": {
    "type": "string",
    "description": "The Discovery board's presence channel at the project's current team audience epoch (owner, 23 Nov 2026). Read it from the server; the SPA builds no name.",
    "maxLength": 140,
    "pattern": "^presence-tenant\\.[0-9a-f-]{36}\\.project\\.[0-9a-f-]{36}\\.discovery\\.v[1-9][0-9]{0,17}$"
   },
   "DiscoveryPresenceSignal": {
    "type": "object",
    "description": "The body of `POST /projects/{projectKey}/discovery/presence` (owner, 23 Nov 2026). `opportunityId` with `open` and `editing` (an opportunity of the path's project); `field` with `editing` only — a key of the closed set, never a value.",
    "required": [
     "activity"
    ],
    "additionalProperties": false,
    "properties": {
     "activity": {
      "type": "string",
      "enum": [
       "open",
       "editing",
       "idle"
      ]
     },
     "opportunityId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "field": {
      "$ref": "#/components/schemas/OpportunityPresenceField"
     }
    }
   },
   "DiscoverySummary": {
    "type": "object",
    "required": [
     "opportunities",
     "interviews",
     "decidedThisMonth"
    ],
    "properties": {
     "opportunities": {
      "type": "integer",
      "minimum": 0,
      "example": 9
     },
     "interviews": {
      "type": "integer",
      "minimum": 0,
      "example": 30
     },
     "decidedThisMonth": {
      "type": "integer",
      "minimum": 0,
      "example": 2
     }
    }
   },
   "DocActivityItem": {
    "type": "object",
    "required": [
     "kind",
     "pageId",
     "at"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "created",
       "version",
       "published",
       "withdrawn",
       "moved",
       "trashed",
       "restored",
       "commented"
      ]
     },
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "actor": {
      "$ref": "#/components/schemas/DocCommentAuthor"
     },
     "versionNumber": {
      "type": "integer",
      "minimum": 1
     },
     "revisionNumber": {
      "type": "integer",
      "minimum": 1
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "DocActivitySummary": {
    "description": "XM-929 (F-DOC-01.R12) — the team's edits of two 7-day windows under the reader's draft read; no person.",
    "type": "object",
    "required": [
     "since",
     "until",
     "editedPages",
     "previousEditedPages",
     "recent"
    ],
    "properties": {
     "since": {
      "$ref": "#/components/schemas/Instant"
     },
     "until": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedPages": {
      "type": "integer",
      "minimum": 0,
      "example": 14
     },
     "previousEditedPages": {
      "type": "integer",
      "minimum": 0,
      "example": 11
     },
     "recent": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "type": "object",
       "required": [
        "id",
        "title",
        "projectKey",
        "editedAt"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "title": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200
        },
        "projectKey": {
         "type": "string",
         "pattern": "^[A-Z][A-Z0-9]{1,9}$"
        },
        "editedAt": {
         "$ref": "#/components/schemas/Instant"
        }
       }
      }
     }
    }
   },
   "DocAgentChangeDecision": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "decision"
    ],
    "properties": {
     "decision": {
      "type": "string",
      "enum": [
       "apply",
       "reject"
      ]
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "DocAgentChangeView": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "spaceId",
     "identity",
     "state",
     "createdAt",
     "expiresAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "create",
       "replace_body"
      ]
     },
     "spaceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "identity": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "baseVersion": {
      "type": "integer",
      "minimum": 1
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "applied",
       "rejected",
       "expired"
      ]
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "diff": {
      "type": "array",
      "maxItems": 2000,
      "items": {
       "$ref": "#/components/schemas/DocTextChange"
      }
     }
    }
   },
   "DocAgentPageRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "title"
    ],
    "properties": {
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "markdown": {
      "type": "string",
      "maxLength": 4194304
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "template": {
      "$ref": "#/components/schemas/DocTemplateRef"
     }
    }
   },
   "DocAttachRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "fileId"
    ],
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "DocAttachmentView": {
    "type": "object",
    "required": [
     "fileId",
     "name",
     "sizeBytes",
     "mimeType",
     "status",
     "attachedAt",
     "referenced"
    ],
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
     },
     "sizeBytes": {
      "$ref": "#/components/schemas/ByteCount"
     },
     "mimeType": {
      "type": "string",
      "maxLength": 255
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "scanning",
       "ready",
       "rejected"
      ]
     },
     "attachedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "attachedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "referenced": {
      "type": "boolean",
      "description": "The head's body references the file (a fileAttachment node or an image)."
     },
     "inPublishedRevision": {
      "type": "boolean"
     }
    }
   },
   "DocAudience": {
    "type": "object",
    "required": [
     "scope"
    ],
    "properties": {
     "scope": {
      "type": "string",
      "enum": [
       "everyone_in_space",
       "restricted"
      ]
     },
     "entries": {
      "type": "array",
      "maxItems": 100,
      "description": "Teams, roles and people when the scope is restricted.",
      "items": {
       "$ref": "#/components/schemas/DocPrincipal"
      }
     }
    }
   },
   "DocAudienceSummary": {
    "type": "object",
    "required": [
     "scope",
     "teams",
     "roles",
     "members",
     "label"
    ],
    "properties": {
     "scope": {
      "type": "string",
      "enum": [
       "space",
       "restricted",
       "admins_only"
      ]
     },
     "teams": {
      "type": "integer",
      "minimum": 0
     },
     "roles": {
      "type": "integer",
      "minimum": 0
     },
     "members": {
      "type": "integer",
      "minimum": 0
     },
     "label": {
      "type": "string",
      "maxLength": 200,
      "example": "Restricted · 1 team, 2 people"
     }
    }
   },
   "DocBacklinkView": {
    "type": "object",
    "required": [
     "pageId",
     "title",
     "space",
     "occurrences"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "space": {
      "$ref": "#/components/schemas/DocSpaceRef"
     },
     "breadcrumb": {
      "type": "array",
      "maxItems": 49,
      "items": {
       "$ref": "#/components/schemas/DocBreadcrumbItem"
      }
     },
     "occurrences": {
      "type": "integer",
      "minimum": 1
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "DocBodyWriteRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "baseDigest"
    ],
    "properties": {
     "baseDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "markdown": {
      "type": "string",
      "maxLength": 4194304,
      "description": "CommonMark with GFM tables and task lists; exactly one of body and markdown."
     }
    }
   },
   "DocBodyWriteResult": {
    "type": "object",
    "required": [
     "outcome"
    ],
    "properties": {
     "outcome": {
      "type": "string",
      "enum": [
       "written",
       "proposed",
       "unchanged"
      ]
     },
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "version": {
      "$ref": "#/components/schemas/DocVersionSummary"
     },
     "changeId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "The pending agent change when the outcome is proposed."
     }
    }
   },
   "DocBreadcrumbItem": {
    "type": "object",
    "required": [
     "id"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "maxLength": 200,
      "description": "Absent for an ancestor the reader cannot read (\"Restricted page\")."
     }
    }
   },
   "DocBuiltinTemplateSwitches": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "builtinKey",
        "name",
        "description",
        "offered",
        "locked"
       ],
       "properties": {
        "builtinKey": {
         "type": "string",
         "maxLength": 40
        },
        "name": {
         "type": "string",
         "minLength": 1,
         "maxLength": 80
        },
        "description": {
         "type": "string",
         "maxLength": 300
        },
        "offered": {
         "type": "boolean"
        },
        "locked": {
         "type": "boolean",
         "description": "Blank page — always offered."
        }
       }
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "version"
      ],
      "properties": {
       "version": {
        "type": "integer",
        "minimum": 0,
        "description": "The docs settings group's version, the If-Match of a change."
       }
      }
     }
    }
   },
   "DocClientLinkConsequence": {
    "type": "object",
    "required": [
     "projectKey",
     "clientVersion",
     "visiblePages",
     "guestCount"
    ],
    "properties": {
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$"
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "visiblePages": {
      "type": "integer",
      "minimum": 0,
      "description": "Pages with their own setting shown, published and with an open client path that the client would read at once (INV-DOC-31)."
     },
     "guestCount": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "DocClientLinkRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "expectedClientVersion"
    ],
    "properties": {
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "DocClientLinkView": {
    "type": "object",
    "required": [
     "projectKey",
     "projectName",
     "current",
     "linkedBy",
     "linkedAt",
     "visiblePages"
    ],
    "properties": {
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$"
     },
     "projectName": {
      "type": "string",
      "maxLength": 200
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "current": {
      "type": "boolean",
      "description": "False when the project's client changed since linking (inert until re-linked)."
     },
     "linkedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "linkedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "visiblePages": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "DocClientSetting": {
    "type": "string",
    "enum": [
     "not_shown",
     "title_only",
     "shown"
    ],
    "description": "A page's own client setting (register §75); a new page starts not_shown; a page reaches a client only when it is shown and every ancestor is title_only or shown."
   },
   "DocClientTagConsequence": {
    "type": "object",
    "required": [
     "clientOrganisation",
     "clientVersion",
     "visibleNow"
    ],
    "properties": {
     "clientOrganisation": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "visibleNow": {
      "type": "boolean",
      "description": "True when tagging shows a published revision to clients at once."
     },
     "revision": {
      "$ref": "#/components/schemas/DocRevisionSummary"
     },
     "guestCount": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "DocClientTagRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "tagged"
    ],
    "properties": {
     "tagged": {
      "type": "boolean"
     },
     "setting": {
      "$ref": "#/components/schemas/DocClientSetting",
      "description": "Spec DS-1 — title_only (with tagged false) shows only the title above shown pages below; shown equals tagged true."
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "DocClientTagView": {
    "type": "object",
    "required": [
     "sharedBy",
     "sharedAt",
     "clientVersion",
     "current"
    ],
    "properties": {
     "sharedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "sharedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "current": {
      "type": "boolean",
      "description": "False when the project's client changed since tagging (re-share in the sharing review)."
     }
    }
   },
   "DocCommentAuthor": {
    "type": "object",
    "required": [
     "kind",
     "displayName",
     "initials"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "client",
       "agent"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "initials": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2
     },
     "former": {
      "type": "boolean"
     }
    }
   },
   "DocCommentRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "body"
    ],
    "properties": {
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "reopen": {
      "type": "boolean",
      "default": false
     }
    }
   },
   "DocCommentView": {
    "type": "object",
    "required": [
     "id",
     "author",
     "createdAt",
     "deleted"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "author": {
      "$ref": "#/components/schemas/DocCommentAuthor"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deleted": {
      "type": "boolean",
      "description": "A tombstone — author and time only."
     },
     "deletionReason": {
      "type": "string",
      "enum": [
       "author",
       "moderator"
      ],
      "description": "A tombstone only: its author deleted it, or a space admin removed it."
     },
     "mentions": {
      "type": "array",
      "maxItems": 20,
      "description": "The people the body's mention nodes name, resolved at read (a removed member reads Former member).",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "delete"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "DocContentDigest": {
    "type": "string",
    "pattern": "^[0-9a-f]{64}$",
    "description": "DocContentDigest — SHA-256 over the canonical body, schema version, frozen title and epoch (RV-SEC-01).",
    "example": "3f1c0d8e2b7a4c6f9e1d2a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f"
   },
   "DocCopyRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "includeChildren"
    ],
    "properties": {
     "spaceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "parentId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "includeChildren": {
      "type": "boolean"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "acknowledgeBroadening": {
      "type": "boolean",
      "default": false,
      "description": "Spec DS-1 — a signed-in member in the web app only; true from a personal token answers 403 access.forbidden (reason session_required, F-DOC-24.R01)."
     }
    }
   },
   "DocCopyResult": {
    "type": "object",
    "required": [
     "pageId",
     "pageCount"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "pageCount": {
      "type": "integer",
      "minimum": 1,
      "description": "The pages copied; the copy holds only pages that the copier can read (INV-DOC-28)."
     },
     "subtreeJob": {
      "$ref": "#/components/schemas/DocSubtreeJobView"
     }
    }
   },
   "DocDeletePreview": {
    "type": "object",
    "required": [
     "pageIds",
     "pageCount",
     "taggedCount",
     "restoreUntil"
    ],
    "description": "Spec DS-1 — counts and lists only the pages that the reader can read (INV-DOC-28); an unreadable page shows only as the blocker subtree_not_readable.",
    "properties": {
     "pageIds": {
      "type": "array",
      "maxItems": 501,
      "description": "Every readable page of the subtree when it holds at most 501 pages; empty above that (the dialog shows the count, and the delete repeats previewDigest), and empty with the blocker subtree_busy.",
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "pageCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The readable pages of the subtree. 0 only with the blocker subtree_busy: a live job hides the subtree, so the preview lists and counts no page (F-DOC-13.R20)."
     },
     "taggedCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The readable pages whose own client setting is shown; 0 with the blocker subtree_busy."
     },
     "restoreUntil": {
      "type": "string",
      "description": "An ISO date, or project_lifetime."
     },
     "blockers": {
      "type": "array",
      "maxItems": 1,
      "description": "Spec DS-1 — subtree_busy when a live subtree job covers the page, an ancestor or a descendant; else subtree_not_readable when the subtree holds a page that the reader cannot read. The delete is then refused (F-DOC-13.R20).",
      "items": {
       "type": "string",
       "enum": [
        "subtree_busy",
        "subtree_not_readable"
       ]
      }
     },
     "previewDigest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$",
      "description": "Spec DS-1 — the SHA-256, as 64 lower-case hexadecimal characters, of the UTF-8 text that joins the canonical ids (lower case, 36 characters) of the subtree's live pages, root included, in ascending order, with one comma between two ids (F-DOC-05 §10); absent when blockers is not empty. The delete repeats it (required above 501 pages)."
     }
    }
   },
   "DocGitConflictResolution": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "keep",
     "gitBlobSha"
    ],
    "properties": {
     "keep": {
      "type": "string",
      "enum": [
       "youniton",
       "git"
      ]
     },
     "gitBlobSha": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
     }
    }
   },
   "DocGitConflictView": {
    "type": "object",
    "required": [
     "pageId",
     "title",
     "gitTitle",
     "detectedAt",
     "kanseoVersion"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "gitTitle": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "path": {
      "type": "string",
      "maxLength": 1024
     },
     "kanseoVersion": {
      "type": "integer",
      "minimum": 1
     },
     "detectedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "gitBody": {
      "$ref": "#/components/schemas/RichTextDocument"
     }
    }
   },
   "DocGitExclusionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "keepOutOfGit"
    ],
    "properties": {
     "keepOutOfGit": {
      "type": "boolean"
     }
    }
   },
   "DocGitRunView": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "trigger",
     "startedAt",
     "filesWritten",
     "filesRead",
     "conflicts"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "export",
       "import",
       "reconcile",
       "initial"
      ]
     },
     "trigger": {
      "type": "string",
      "enum": [
       "publication",
       "version",
       "push",
       "schedule",
       "manual",
       "configuration"
      ]
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "outcome": {
      "type": "string",
      "enum": [
       "succeeded",
       "partial",
       "failed",
       "skipped"
      ]
     },
     "errorCode": {
      "type": "string",
      "maxLength": 60
     },
     "filesWritten": {
      "type": "integer",
      "minimum": 0
     },
     "filesRead": {
      "type": "integer",
      "minimum": 0
     },
     "conflicts": {
      "type": "integer",
      "minimum": 0
     },
     "commitSha": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
     }
    }
   },
   "DocGitSyncRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "connectionId",
     "branch",
     "direction"
    ],
    "properties": {
     "connectionId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "branch": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
     },
     "pathPrefix": {
      "type": "string",
      "maxLength": 200,
      "default": "docs/"
     },
     "direction": {
      "type": "string",
      "enum": [
       "export",
       "import",
       "two_way"
      ]
     },
     "content": {
      "type": "string",
      "enum": [
       "published",
       "head"
      ],
      "default": "published"
     }
    }
   },
   "DocGitSyncView": {
    "type": "object",
    "required": [
     "spaceId",
     "connectionId",
     "repositoryPath",
     "branch",
     "pathPrefix",
     "direction",
     "content",
     "status",
     "version"
    ],
    "properties": {
     "spaceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "connectionId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "provider": {
      "type": "string",
      "enum": [
       "github",
       "gitlab"
      ]
     },
     "repositoryPath": {
      "type": "string",
      "maxLength": 300
     },
     "branch": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
     },
     "pathPrefix": {
      "type": "string",
      "maxLength": 200
     },
     "direction": {
      "type": "string",
      "enum": [
       "export",
       "import",
       "two_way"
      ]
     },
     "content": {
      "type": "string",
      "enum": [
       "published",
       "head"
      ]
     },
     "lastCommit": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}([0-9a-f]{24})?$"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "paused",
       "failing",
       "disconnected"
      ]
     },
     "statusReason": {
      "type": "string",
      "maxLength": 60
     },
     "openConflicts": {
      "type": "integer",
      "minimum": 0
     },
     "lastRunAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocInheritedRestriction": {
    "type": "object",
    "required": [
     "pageId",
     "kind",
     "entryCount"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "maxLength": 200,
      "description": "Absent when the reader cannot read that ancestor (\"Restricted page\")."
     },
     "kind": {
      "type": "string",
      "enum": [
       "view",
       "edit"
      ]
     },
     "entryCount": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "DocLinkTargetKind": {
    "type": "string",
    "enum": [
     "doc_page",
     "ticket",
     "knowledge_item",
     "opportunity",
     "help_desk_request",
     "external_url"
    ]
   },
   "DocLinkView": {
    "type": "object",
    "required": [
     "kind",
     "ref",
     "state",
     "occurrences"
    ],
    "properties": {
     "kind": {
      "$ref": "#/components/schemas/DocLinkTargetKind"
     },
     "ref": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
     },
     "state": {
      "type": "string",
      "enum": [
       "ok",
       "hidden_or_missing",
       "trashed"
      ],
      "description": "hidden_or_missing never says which (KDC-04)."
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "host": {
      "type": "string",
      "maxLength": 253
     },
     "occurrences": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocMarkdownView": {
    "type": "object",
    "required": [
     "pageId",
     "title",
     "space",
     "source",
     "markdown",
     "contentDigest"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "space": {
      "$ref": "#/components/schemas/DocSpaceRef"
     },
     "source": {
      "type": "string",
      "enum": [
       "head",
       "published_revision"
      ]
     },
     "versionNumber": {
      "type": "integer",
      "minimum": 1
     },
     "revisionNumber": {
      "type": "integer",
      "minimum": 1
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "markdown": {
      "type": "string",
      "maxLength": 4194304,
      "description": "CommonMark with GFM tables and task lists; comment marks and internal link addresses removed."
     },
     "origin": {
      "type": "string",
      "enum": [
       "member",
       "agent",
       "git_import",
       "api",
       "template"
      ],
      "description": "Who produced the version the text comes from."
     }
    }
   },
   "DocMovePreview": {
    "type": "object",
    "required": [
     "subtreeSize",
     "async",
     "broadened",
     "blockers",
     "depthAfter"
    ],
    "properties": {
     "subtreeSize": {
      "type": "integer",
      "minimum": 1,
      "description": "The pages of the subtree that the reader can read; an unreadable page is never counted (it shows as the blocker subtree_not_readable)."
     },
     "async": {
      "type": "boolean",
      "description": "True when the subtree is above the synchronous bound and a subtree job runs."
     },
     "depthAfter": {
      "type": "integer",
      "minimum": 1,
      "description": "The deepest level after the move."
     },
     "clientExposed": {
      "type": "integer",
      "minimum": 0,
      "description": "Pages that the reader can read and that a client would read after the move and does not read now (INV-DOC-28)."
     },
     "broadened": {
      "type": "array",
      "maxItems": 20,
      "description": "Who gains access — principals that could not read the moved pages before.",
      "items": {
       "$ref": "#/components/schemas/DocPrincipal"
      }
     },
     "blockers": {
      "type": "array",
      "maxItems": 7,
      "description": "trash_limit — a cross-space move whose moved pages have more trashed child pages than docs.tree.maxPagesPerSpace (F-DOC-13.R22).",
      "items": {
       "type": "string",
       "enum": [
        "client_tagged",
        "public",
        "git_conflict",
        "depth_exceeded",
        "subtree_not_readable",
        "restricted_target",
        "trash_limit"
       ]
      }
     }
    }
   },
   "DocPageCan": {
    "type": "object",
    "required": [
     "edit",
     "publish",
     "share",
     "delete"
    ],
    "properties": {
     "edit": {
      "type": "boolean",
      "description": "edit_docs with docs scope all on an active project — open a write session, rename, move."
     },
     "publish": {
      "type": "boolean"
     },
     "share": {
      "type": "boolean",
      "description": "manage_client_sharing, client portal on and a client organisation. Spec DS-1: the client setting — only a project admin with manage_client_sharing, never the page owner as such (register §75 addendum; D-007)."
     },
     "shareUnavailableReason": {
      "type": "string",
      "enum": [
       "no_permission",
       "project_archived",
       "section",
       "client_portal_off",
       "no_client",
       "not_linked"
      ],
      "description": "Present only when share is false — the first failing condition in this order, so the UI can say why (F-DOC-03.R02, R14). Like every can member an affordance, never authorisation. Spec DS-1 adds not_linked (a tenant or team space without a current client link, INV-DOC-31); a view-restricted page can be shared (register §76 item 4)."
     },
     "delete": {
      "type": "boolean"
     },
     "restoreVersion": {
      "type": "boolean"
     },
     "resetDraft": {
      "type": "boolean",
      "description": "Admins only (administer)."
     },
     "comment": {
      "type": "boolean",
      "description": "Spec DS-1 — read and the comment capability (F-DOC-15)."
     },
     "restrict": {
      "type": "boolean",
      "description": "Spec DS-1 — set or lift a restriction (F-DOC-12)."
     },
     "makePublic": {
      "type": "boolean",
      "description": "Spec DS-1 — the public flag (F-DOC-21)."
     },
     "move": {
      "type": "boolean",
      "description": "Spec DS-1 — move or copy (F-DOC-13)."
     },
     "setVisibility": {
      "type": "boolean",
      "description": "Spec DS-1 — the page owner or a project admin may set the audience, the edit restriction, the owner and Keep out of Git (register §75, §76); the client setting is share."
     }
    }
   },
   "DocPageCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "title"
    ],
    "properties": {
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "kind": {
      "type": "string",
      "enum": [
       "page",
       "section",
       "whiteboard"
      ],
      "default": "page"
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "meetingDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "template": {
      "$ref": "#/components/schemas/DocTemplateRef"
     }
    }
   },
   "DocPageOwnerRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "ownerId"
    ],
    "properties": {
     "ownerId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "DocPagePatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "meetingDate": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "type": "null"
       }
      ]
     },
     "childOrder": {
      "type": "string",
      "enum": [
       "manual",
       "meeting_date_desc"
      ]
     }
    }
   },
   "DocPagePositionRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "parentId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "afterId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "beforeId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "spaceId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "Spec DS-1 — the target space of a cross-space move; absent keeps the space."
     },
     "acknowledgeBroadening": {
      "type": "boolean",
      "default": false,
      "description": "Spec DS-1 — INV-DOC-28."
     }
    }
   },
   "DocPageRestrictionView": {
    "type": "object",
    "required": [
     "inherited",
     "audience",
     "version"
    ],
    "properties": {
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "clientSetting": {
      "$ref": "#/components/schemas/DocClientSetting"
     },
     "clientPathOpen": {
      "type": "boolean"
     },
     "canSet": {
      "type": "boolean",
      "description": "The reader may set the audience, the edit restriction, the owner and Keep out of Git: the page owner or a project admin (register §75)."
     },
     "canSetClientSetting": {
      "type": "boolean",
      "description": "The reader may set the client setting: a project admin with manage_client_sharing (register §75 addendum; D-007)."
     },
     "keepOutOfGit": {
      "type": "boolean",
      "description": "The page or an ancestor is kept out of Git (register §76 item 3)."
     },
     "view": {
      "$ref": "#/components/schemas/DocRestriction"
     },
     "edit": {
      "$ref": "#/components/schemas/DocRestriction"
     },
     "inherited": {
      "type": "array",
      "maxItems": 98,
      "items": {
       "$ref": "#/components/schemas/DocInheritedRestriction"
      }
     },
     "audience": {
      "$ref": "#/components/schemas/DocAudienceSummary"
     },
     "subtreeJob": {
      "$ref": "#/components/schemas/DocSubtreeJobView"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocPageShortcut": {
    "type": "object",
    "required": [
     "id",
     "title",
     "projectKey",
     "clientShared"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Launch plan"
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "example": "ORB"
     },
     "parentTitle": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "clientShared": {
      "type": "boolean"
     },
     "starredAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "openedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "DocPageView": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "title",
     "collaboration",
     "publication",
     "can",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "description": "The project of a project-space page; absent for a page of a tenant or team space (Spec DS-1)."
     },
     "spaceId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "Spec DS-1 — the space of the page. Optional while the code that runs today does not return it. The build package F-DOC-11 makes it required (F-DOC-11.S17; AUTHORING §5, contract compatibility)."
     },
     "space": {
      "$ref": "#/components/schemas/DocSpaceRef"
     },
     "depth": {
      "type": "integer",
      "minimum": 0,
      "maximum": 49
     },
     "breadcrumb": {
      "type": "array",
      "maxItems": 49,
      "items": {
       "$ref": "#/components/schemas/DocBreadcrumbItem"
      }
     },
     "audience": {
      "$ref": "#/components/schemas/DocAudienceSummary"
     },
     "public": {
      "$ref": "#/components/schemas/DocPublicFlagView"
     },
     "templateOrigin": {
      "$ref": "#/components/schemas/DocTemplateRef"
     },
     "openThreads": {
      "type": "integer",
      "minimum": 0
     },
     "watching": {
      "$ref": "#/components/schemas/DocWatchState"
     },
     "gitConflict": {
      "type": "boolean"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef",
      "description": "The page owner (register §75); absent while a removed owner is not replaced."
     },
     "clientSetting": {
      "$ref": "#/components/schemas/DocClientSetting"
     },
     "clientPathOpen": {
      "type": "boolean",
      "description": "Every ancestor is title_only or shown (INV-DOC-40)."
     },
     "kind": {
      "type": "string",
      "enum": [
       "page",
       "section",
       "whiteboard"
      ]
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "meetingDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "head": {
      "$ref": "#/components/schemas/DocVersionSummary"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "bodySource": {
      "type": "string",
      "enum": [
       "head",
       "published_revision",
       "none"
      ],
      "description": "published_revision for a reader with docs scope client_tagged."
     },
     "mentions": {
      "type": "array",
      "maxItems": 50,
      "description": "Q30 (22 Nov 2026) — the members the body's mention nodes (\"@\") name, each once in order (former once removed). Absent when the body mentions nobody.",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "ticketRefs": {
      "type": "array",
      "maxItems": 50,
      "description": "Q30 — the tickets the body's ticketRef nodes (\"#\") name, each once in order, for this reader. Absent when the body names none.",
      "items": {
       "$ref": "#/components/schemas/RichTextTicketRef"
      }
     },
     "pageLinks": {
      "type": "array",
      "maxItems": 50,
      "description": "Q30 — the doc pages the body's pageLink nodes (\"[[\") name, each once in order, for this reader. Absent when the body names none.",
      "items": {
       "$ref": "#/components/schemas/RichTextPageLink"
      }
     },
     "clientTag": {
      "$ref": "#/components/schemas/DocClientTagView"
     },
     "publication": {
      "$ref": "#/components/schemas/DocPublicationState"
     },
     "collaboration": {
      "type": "object",
      "required": [
       "mode"
      ],
      "properties": {
       "mode": {
        "type": "string",
        "enum": [
         "collaborative",
         "single_editor",
         "read_only"
        ],
        "description": "single_editor while collaboration is off (CFL-600); read_only for an oversized or archived page."
       },
       "readOnlyReason": {
        "type": "string",
        "enum": [
         "project_archived",
         "document_too_large",
         "no_edit_capability",
         "space_archived",
         "edit_restricted"
        ]
       },
       "schemaVersion": {
        "type": "integer",
        "minimum": 1
       }
      }
     },
     "can": {
      "$ref": "#/components/schemas/DocPageCan"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocPageVisitRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "pageId"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "DocPrincipal": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "all_members",
       "team",
       "role",
       "member"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "label": {
      "type": "string",
      "maxLength": 200,
      "description": "The current name; \"Former member\" for a removed member. Answers only."
     }
    }
   },
   "DocPublicBulkRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "pageIds",
     "public"
    ],
    "properties": {
     "pageIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "public": {
      "type": "boolean"
     }
    }
   },
   "DocPublicBulkResult": {
    "type": "object",
    "required": [
     "changed",
     "unchanged"
    ],
    "properties": {
     "changed": {
      "type": "integer",
      "minimum": 0
     },
     "unchanged": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "DocPublicFlagRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "public"
    ],
    "properties": {
     "public": {
      "type": "boolean"
     }
    }
   },
   "DocPublicFlagView": {
    "type": "object",
    "required": [
     "public",
     "siteLive"
    ],
    "properties": {
     "public": {
      "type": "boolean"
     },
     "siteLive": {
      "type": "boolean"
     },
     "url": {
      "type": "string",
      "maxLength": 400
     },
     "publishedRevision": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocPublicSiteRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "slug",
     "title"
    ],
    "properties": {
     "slug": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "footer": {
      "oneOf": [
       {
        "type": "string",
        "maxLength": 300
       },
       {
        "type": "null"
       }
      ]
     },
     "homePageId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "indexing": {
      "type": "string",
      "enum": [
       "noindex",
       "index"
      ],
      "default": "noindex"
     }
    }
   },
   "DocPublicSiteView": {
    "type": "object",
    "required": [
     "id",
     "slug",
     "url",
     "title",
     "indexing",
     "status",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "slug": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$"
     },
     "url": {
      "type": "string",
      "maxLength": 300,
      "example": "https://northwind-handbook.docs.youniton.example"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "footer": {
      "type": "string",
      "maxLength": 300
     },
     "homePageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "indexing": {
      "type": "string",
      "enum": [
       "noindex",
       "index"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "draft",
       "published",
       "unpublished",
       "suspended"
      ]
     },
     "statusAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "suspensionReason": {
      "type": "string",
      "maxLength": 500
     },
     "publicPageCount": {
      "type": "integer",
      "minimum": 0
     },
     "domain": {
      "$ref": "#/components/schemas/DocSiteDomainView"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocPublicationState": {
    "type": "object",
    "required": [
     "state"
    ],
    "properties": {
     "state": {
      "type": "string",
      "enum": [
       "unpublished",
       "published",
       "withdrawn"
      ]
     },
     "revision": {
      "$ref": "#/components/schemas/DocRevisionSummary"
     },
     "withdrawnAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "changesSincePublished": {
      "type": "boolean",
      "description": "The head differs from the published version."
     }
    }
   },
   "DocPublishBatchItem": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "pageId",
     "version",
     "contentDigest"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     }
    }
   },
   "DocPublishBatchRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "items"
    ],
    "properties": {
     "items": {
      "type": "array",
      "minItems": 1,
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/DocPublishBatchItem"
      }
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "DocPublishBatchResultItem": {
    "type": "object",
    "required": [
     "pageId",
     "revision"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "revision": {
      "$ref": "#/components/schemas/DocRevisionSummary"
     }
    }
   },
   "DocPublishProposalRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "version",
     "contentDigest"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "DocPublishProposalView": {
    "type": "object",
    "required": [
     "proposalId",
     "pageId",
     "version",
     "contentDigest",
     "state"
    ],
    "properties": {
     "proposalId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "approved",
       "rejected",
       "expired",
       "executed",
       "failed"
      ]
     }
    }
   },
   "DocPublishRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "version",
     "contentDigest"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "DocReaderSource": {
    "type": "string",
    "enum": [
     "head",
     "published"
    ],
    "description": "What a reader who cannot edit a page sees — its latest version (head) or its latest published revision."
   },
   "DocRecordNowResult": {
    "type": "object",
    "required": [
     "outcome",
     "version",
     "title",
     "body",
     "diff",
     "changesAfter"
    ],
    "properties": {
     "outcome": {
      "$ref": "#/components/schemas/DocRecordingOutcome"
     },
     "version": {
      "$ref": "#/components/schemas/DocVersionSummary"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "diff": {
      "type": "array",
      "maxItems": 2000,
      "description": "Block-level text diff against the published revision (all added when unpublished).",
      "items": {
       "$ref": "#/components/schemas/DocTextChange"
      }
     },
     "titleChanged": {
      "type": "boolean"
     },
     "changesAfter": {
      "type": "integer",
      "minimum": 0,
      "description": "Durable updates recorded after this version at answer time."
     },
     "clientConsequence": {
      "$ref": "#/components/schemas/DocClientTagConsequence"
     }
    }
   },
   "DocRecordingOutcome": {
    "type": "string",
    "enum": [
     "recorded",
     "unchanged",
     "covered",
     "superseded"
    ],
    "description": "The synchronous answers; stale exists only on the internal callback."
   },
   "DocRelatedSpacesRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "spaceIds"
    ],
    "properties": {
     "spaceIds": {
      "type": "array",
      "maxItems": 10,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "DocRelatedSpacesView": {
    "type": "object",
    "required": [
     "spaces"
    ],
    "properties": {
     "spaces": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/DocSpaceRef"
      }
     }
    }
   },
   "DocResetRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "reason"
    ],
    "properties": {
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     }
    }
   },
   "DocRestoreRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "publish": {
      "type": "boolean",
      "default": false
     }
    }
   },
   "DocRestoreResult": {
    "type": "object",
    "required": [
     "outcome",
     "version",
     "published"
    ],
    "properties": {
     "outcome": {
      "$ref": "#/components/schemas/DocRecordingOutcome"
     },
     "version": {
      "$ref": "#/components/schemas/DocVersionSummary"
     },
     "published": {
      "type": "boolean",
      "description": "False when the restore's recording was superseded — the Publish dialog shows the head instead."
     },
     "revision": {
      "$ref": "#/components/schemas/DocRevisionSummary"
     }
    }
   },
   "DocRestriction": {
    "type": "object",
    "required": [
     "kind",
     "entries",
     "setBy",
     "setAt"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "view",
       "edit"
      ]
     },
     "entries": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/DocPrincipal"
      }
     },
     "setBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "setAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "DocRestrictionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "view",
       "edit"
      ]
     },
     "entries": {
      "description": "The new entries; null removes the restriction of this kind.",
      "oneOf": [
       {
        "type": "array",
        "minItems": 1,
        "maxItems": 100,
        "items": {
         "$ref": "#/components/schemas/DocPrincipal"
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "acknowledgeBroadening": {
      "type": "boolean",
      "default": false
     },
     "adminOverrideReason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "A tenant Admin who is not a project admin of the page lifts or changes its audience with this reason, while docs.restrictions.adminsBypass is on; audited as doc.page_admin_access (register §76 item 1)."
     }
    }
   },
   "DocRevisionPage": {
    "type": "object",
    "required": [
     "items"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/DocRevisionSummary"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "DocRevisionSummary": {
    "type": "object",
    "required": [
     "number",
     "versionNumber",
     "contentDigest",
     "publishedBy",
     "publishedAt",
     "clientTagged",
     "current"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "versionNumber": {
      "type": "integer",
      "minimum": 1
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "publishedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "publishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "clientTagged": {
      "type": "boolean"
     },
     "current": {
      "type": "boolean",
      "description": "The latest revision and not withdrawn."
     }
    }
   },
   "DocSearchHit": {
    "type": "object",
    "required": [
     "pageId",
     "title",
     "space",
     "updatedAt"
    ],
    "description": "A hit; its title is the current title for a reader who sees the head, and the frozen published title (publishedTitle) for a reader who sees published revisions only (F-DOC-18.R02, R07).",
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "space": {
      "$ref": "#/components/schemas/DocSpaceRef"
     },
     "breadcrumb": {
      "type": "array",
      "maxItems": 49,
      "items": {
       "$ref": "#/components/schemas/DocBreadcrumbItem"
      }
     },
     "snippet": {
      "type": "string",
      "maxLength": 300,
      "description": "Plain text with the matched words between U+E000 and U+E001 markers; absent when docs.search.snippets is off (CFL-631)."
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "source": {
      "type": "string",
      "enum": [
       "head",
       "published_revision"
      ]
     }
    }
   },
   "DocSessionGrant": {
    "type": "object",
    "required": [
     "sessionId",
     "token",
     "expiresAt",
     "documentName",
     "mode",
     "url",
     "schemaVersion",
     "offlineEditing"
    ],
    "properties": {
     "sessionId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "token": {
      "type": "string",
      "maxLength": 2048,
      "description": "ES256 JWT, at most 120 s; sent only in the provider's authentication message, never logged or put in a URL."
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "documentName": {
      "type": "string",
      "pattern": "^t/[0-9a-f-]{36}/doc/[0-9a-f-]{36}/e[1-9][0-9]*$"
     },
     "mode": {
      "type": "string",
      "enum": [
       "write",
       "read"
      ]
     },
     "readOnlyReason": {
      "type": "string",
      "enum": [
       "no_edit_capability",
       "project_archived",
       "preview",
       "editors_limit",
       "document_too_large",
       "space_archived",
       "edit_restricted"
      ]
     },
     "url": {
      "type": "string",
      "maxLength": 200,
      "example": "wss://ws.youniton.example/collab"
     },
     "schemaVersion": {
      "type": "integer",
      "minimum": 1
     },
     "offlineEditing": {
      "type": "boolean"
     }
    }
   },
   "DocSessionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "mode"
    ],
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "write",
       "read"
      ]
     },
     "replacesSession": {
      "type": "string",
      "format": "uuid",
      "description": "The sessionId of this tab's earlier grant for this page whose socket closed; only on the reconnect's open (F-DOC-06.R12). That session is closed superseded before the editors are counted when it is the caller's own session on this page under the same sign-in session; otherwise it is ignored."
     }
    }
   },
   "DocSharedPageItem": {
    "description": "XM-929 (F-DOC-03.R19) — one live page shared with the client, with the title the reader may read; no person.",
    "type": "object",
    "required": [
     "id",
     "title",
     "projectKey",
     "projectName",
     "sharedAt",
     "published"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Launch plan"
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "example": "ORB"
     },
     "projectName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Orbit"
     },
     "sharedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "published": {
      "type": "boolean"
     }
    }
   },
   "DocShortcuts": {
    "type": "object",
    "required": [
     "starred",
     "recent",
     "starLimit"
    ],
    "properties": {
     "starred": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/DocPageShortcut"
      }
     },
     "recent": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/DocPageShortcut"
      }
     },
     "starLimit": {
      "type": "integer",
      "minimum": 1,
      "example": 50
     }
    }
   },
   "DocSiteDomainRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "hostname"
    ],
    "properties": {
     "hostname": {
      "type": "string",
      "minLength": 4,
      "maxLength": 253,
      "example": "docs.northwind.example"
     }
    }
   },
   "DocSiteDomainView": {
    "type": "object",
    "required": [
     "hostname",
     "state",
     "certificate"
    ],
    "properties": {
     "hostname": {
      "type": "string",
      "minLength": 4,
      "maxLength": 253
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "verified",
       "failed"
      ]
     },
     "txtRecordName": {
      "type": "string",
      "maxLength": 300,
      "example": "_youniton-verify.docs.northwind.example"
     },
     "txtRecordValue": {
      "type": "string",
      "maxLength": 100
     },
     "cnameTarget": {
      "type": "string",
      "maxLength": 300
     },
     "certificate": {
      "type": "string",
      "enum": [
       "none",
       "issued",
       "failed"
      ]
     },
     "verifiedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "DocSpaceAccessSettingsRequest": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "description": "Spec DS-1 — the space settings that change who sees what (F-DOC-11.R17); only through the x-audience spa operation setDocSpaceAccessSettings, never through a token (independent review SR-DS1-26).",
    "properties": {
     "defaultAudience": {
      "$ref": "#/components/schemas/DocAudience"
     },
     "readerSource": {
      "$ref": "#/components/schemas/DocReaderSource"
     },
     "clientComments": {
      "type": "boolean"
     }
    }
   },
   "DocSpaceCan": {
    "type": "object",
    "required": [
     "createPage",
     "administer",
     "archive",
     "delete",
     "manageGrants",
     "linkClients",
     "publishPublic",
     "configureGitSync"
    ],
    "properties": {
     "createPage": {
      "type": "boolean"
     },
     "administer": {
      "type": "boolean"
     },
     "archive": {
      "type": "boolean"
     },
     "delete": {
      "type": "boolean"
     },
     "manageGrants": {
      "type": "boolean"
     },
     "linkClients": {
      "type": "boolean"
     },
     "publishPublic": {
      "type": "boolean"
     },
     "configureGitSync": {
      "type": "boolean"
     }
    }
   },
   "DocSpaceCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "kind",
     "name"
    ],
    "description": "Owner #45 (22 Nov 2026): a company space (kind tenant) or a team space (kind team with teamId). No key and no grants: a company space admits every internal member, a team space its team. Another member answers 422 validation.unknown_member; a team space without teamId (or a company space with one) answers 422 doc_space.team_required.",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "tenant",
       "team"
      ]
     },
     "teamId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "$ref": "#/components/schemas/DocSpaceName"
     },
     "description": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "DocSpaceDeletionPreview": {
    "type": "object",
    "required": [
     "pageCount",
     "clientVisibleCount",
     "publicCount",
     "linkedProjects",
     "restoreUntil",
     "blockers"
    ],
    "properties": {
     "pageCount": {
      "type": "integer",
      "minimum": 0
     },
     "clientVisibleCount": {
      "type": "integer",
      "minimum": 0
     },
     "publicCount": {
      "type": "integer",
      "minimum": 0
     },
     "linkedProjects": {
      "type": "integer",
      "minimum": 0
     },
     "restoreUntil": {
      "type": "string",
      "description": "An ISO date, or project_lifetime."
     },
     "blockers": {
      "type": "array",
      "maxItems": 3,
      "items": {
       "type": "string",
       "enum": [
        "public_site_published",
        "git_sync_running",
        "subtree_job_running"
       ]
      }
     }
    }
   },
   "DocSpaceGrant": {
    "type": "object",
    "required": [
     "principal",
     "level"
    ],
    "properties": {
     "principal": {
      "$ref": "#/components/schemas/DocPrincipal"
     },
     "level": {
      "$ref": "#/components/schemas/DocSpaceLevel"
     }
    }
   },
   "DocSpaceGrantList": {
    "type": "object",
    "required": [
     "grants",
     "version"
    ],
    "properties": {
     "grants": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/DocSpaceGrant"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocSpaceGrantsRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "grants"
    ],
    "properties": {
     "grants": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/DocSpaceGrant"
      }
     }
    }
   },
   "DocSpaceKey": {
    "type": "string",
    "pattern": "^[A-Z][A-Z0-9]{1,9}$",
    "example": "ENG"
   },
   "DocSpaceKind": {
    "type": "string",
    "enum": [
     "tenant",
     "team",
     "project"
    ]
   },
   "DocSpaceLevel": {
    "type": "string",
    "enum": [
     "viewer",
     "editor",
     "admin"
    ]
   },
   "DocSpaceListMeta": {
    "description": "listDocSpaces' meta (owner #45): one page of at most 50 spaces and what \"New space\" gives the reader. When more spaces match the filter, hasMore is true and nextCursor gives the next page (fix G114, 27 Nov 2026: never a silent cap).",
    "allOf": [
     {
      "$ref": "#/components/schemas/CursorPageMeta"
     },
     {
      "type": "object",
      "required": [
       "can",
       "creatableTeams"
      ],
      "properties": {
       "nextCursor": {
        "type": "string",
        "maxLength": 512,
        "description": "The page[cursor] of the next page. Only when hasMore is true. The cursor is bound to the lifecycle, kind and q of this page."
       },
       "can": {
        "type": "object",
        "required": [
         "createCompanySpace"
        ],
        "properties": {
         "createCompanySpace": {
          "type": "boolean",
          "description": "The reader can create a company space (edit_docs on a new company space)."
         }
        }
       },
       "creatableTeams": {
        "type": "array",
        "maxItems": 200,
        "description": "The reader's own teams in which the reader can create a team space (edit_docs on a new space of the team). Empty for a client. Each item has type team and the team's name as label.",
        "items": {
         "$ref": "#/components/schemas/TypedRef"
        }
       }
      }
     }
    ]
   },
   "DocSpaceName": {
    "type": "string",
    "minLength": 1,
    "maxLength": 80,
    "example": "Engineering handbook"
   },
   "DocSpacePageCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "A title, a template, or both; without a title the template's title pattern is resolved (F-DOC-14).",
    "properties": {
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "kind": {
      "type": "string",
      "enum": [
       "page",
       "section",
       "whiteboard"
      ],
      "default": "page"
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "meetingDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "template": {
      "$ref": "#/components/schemas/DocTemplateRef"
     }
    }
   },
   "DocSpacePageIndexItem": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "title",
     "depth",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "page",
       "section",
       "whiteboard"
      ]
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "depth": {
      "type": "integer",
      "minimum": 0,
      "maximum": 49
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocSpacePatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "key": {
      "$ref": "#/components/schemas/DocSpaceKey"
     },
     "name": {
      "$ref": "#/components/schemas/DocSpaceName"
     },
     "description": {
      "oneOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ]
     },
     "homePageId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "defaultTemplate": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/DocTemplateRef"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "DocSpaceRef": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "$ref": "#/components/schemas/DocSpaceKind"
     },
     "key": {
      "$ref": "#/components/schemas/DocSpaceKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$"
     }
    }
   },
   "DocSpaceRow": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "name",
     "pageCount",
     "level",
     "lifecycle",
     "updatedAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "$ref": "#/components/schemas/DocSpaceKind"
     },
     "key": {
      "$ref": "#/components/schemas/DocSpaceKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The space's name, or the project's name for a project space."
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$"
     },
     "team": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "pageCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Live pages the reader can read."
     },
     "level": {
      "$ref": "#/components/schemas/DocSpaceLevel"
     },
     "lifecycle": {
      "type": "string",
      "enum": [
       "active",
       "archived",
       "deleted"
      ]
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "can": {
      "$ref": "#/components/schemas/DocSpaceCan",
      "description": "What the reader may do with the space (the card's menu; owner, 23 Nov 2026)."
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "The If-Match of a rename, an archive, an unarchive and a delete."
     }
    }
   },
   "DocSpaceTreeLevel": {
    "type": "object",
    "required": [
     "spaceId",
     "pageCount",
     "nodes",
     "can"
    ],
    "properties": {
     "spaceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "depth": {
      "type": "integer",
      "minimum": 0,
      "maximum": 49
     },
     "pageCount": {
      "type": "integer",
      "minimum": 0
     },
     "nodes": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/DocTreeNode"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     },
     "can": {
      "type": "object",
      "required": [
       "create"
      ],
      "properties": {
       "create": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "DocSpaceView": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "name",
     "readerSource",
     "clientComments",
     "lifecycle",
     "pageCount",
     "level",
     "can",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "$ref": "#/components/schemas/DocSpaceKind"
     },
     "key": {
      "$ref": "#/components/schemas/DocSpaceKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$"
     },
     "team": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "homePageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "readerSource": {
      "$ref": "#/components/schemas/DocReaderSource"
     },
     "defaultTemplate": {
      "$ref": "#/components/schemas/DocTemplateRef"
     },
     "defaultAudience": {
      "$ref": "#/components/schemas/DocAudience"
     },
     "clientComments": {
      "type": "boolean"
     },
     "lifecycle": {
      "type": "string",
      "enum": [
       "active",
       "archived",
       "deleted"
      ]
     },
     "archivedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deletedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "restoreUntil": {
      "type": "string",
      "description": "An ISO date, or project_lifetime — for a deleted space."
     },
     "pageCount": {
      "type": "integer",
      "minimum": 0
     },
     "maxDepth": {
      "type": "integer",
      "minimum": 2,
      "maximum": 50
     },
     "level": {
      "$ref": "#/components/schemas/DocSpaceLevel"
     },
     "publicSiteStatus": {
      "type": "string",
      "enum": [
       "none",
       "draft",
       "published",
       "unpublished",
       "suspended"
      ]
     },
     "gitSyncStatus": {
      "type": "string",
      "enum": [
       "none",
       "active",
       "paused",
       "failing",
       "disconnected"
      ]
     },
     "can": {
      "$ref": "#/components/schemas/DocSpaceCan"
     },
     "watching": {
      "$ref": "#/components/schemas/DocWatchState",
      "description": "The reader's watch of the space (page is false; F-DOC-15.R11)."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocSubtreeJobView": {
    "type": "object",
    "required": [
     "id",
     "cause",
     "percent"
    ],
    "description": "A live or finished subtree job. It has no page counts, so it never counts pages that the reader cannot read (INV-DOC-28).",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "cause": {
      "type": "string",
      "enum": [
       "move",
       "restriction",
       "client_setting",
       "copy",
       "restore"
      ]
     },
     "percent": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "finished": {
      "type": "boolean"
     }
    }
   },
   "DocTemplateCategory": {
    "type": "string",
    "enum": [
     "general",
     "meeting",
     "decision",
     "how_to",
     "retrospective",
     "release_notes",
     "requirements",
     "runbook",
     "handover"
    ]
   },
   "DocTemplateCreateRequest": {
    "type": "object",
    "description": "As built (owner Q15, 24 November 2026). \"Save as template\" sends fromPageId, scope and name. \"Replace <name>\" sends fromPageId and replaceId with If-Match, and no scope or name. The template takes the page's current body; the request has no body.",
    "additionalProperties": false,
    "required": [
     "fromPageId"
    ],
    "properties": {
     "fromPageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "scope": {
      "type": "string",
      "enum": [
       "space",
       "tenant"
      ]
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "description": {
      "oneOf": [
       {
        "type": "string",
        "maxLength": 300
       },
       {
        "type": "null"
       }
      ]
     },
     "replaceId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "DocTemplateListMeta": {
    "description": "listDocTemplates' meta (owner Q15, 24 Nov 2026): one page (hasMore is false) and the choices that \"Save as template\" gives the reader on a page of the space.",
    "allOf": [
     {
      "$ref": "#/components/schemas/CursorPageMeta"
     },
     {
      "type": "object",
      "required": [
       "canSaveToSpace",
       "canSaveToTenant"
      ],
      "properties": {
       "canSaveToSpace": {
        "type": "boolean",
        "description": "The reader is the admin of the space and the space is active: the reader can save a template of this space."
       },
       "canSaveToTenant": {
        "type": "boolean",
        "description": "The reader is a tenant admin and the space is an active company space: the reader can save a tenant template."
       }
      }
     }
    ]
   },
   "DocTemplatePatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "description": {
      "oneOf": [
       {
        "type": "string",
        "maxLength": 300
       },
       {
        "type": "null"
       }
      ]
     },
     "category": {
      "$ref": "#/components/schemas/DocTemplateCategory"
     },
     "archived": {
      "type": "boolean"
     },
     "deleted": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "As built (owner Q15, 24 November 2026): `{deleted: true}` deletes the template for good (no restore) and answers 204. The server reads `name` or `deleted` (DocTemplatePatchRequest)."
     }
    }
   },
   "DocTemplateRef": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "builtin",
       "template"
      ]
     },
     "builtinKey": {
      "type": "string",
      "enum": [
       "blank",
       "meeting_notes",
       "decision_record",
       "how_to",
       "retrospective",
       "release_notes",
       "requirements",
       "runbook",
       "project_handover"
      ]
     },
     "templateId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "A template version; absent means the current version."
     }
    }
   },
   "DocTemplateSaved": {
    "type": "object",
    "description": "As built (owner Q15, 24 November 2026): the answer of \"Save as template\", \"Replace <name>\" (createDocTemplate) and of a rename (updateDocTemplate) — the template's id and its current version.",
    "additionalProperties": false,
    "required": [
     "id",
     "currentVersion"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "currentVersion": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocTemplateSummary": {
    "type": "object",
    "required": [
     "kind",
     "name",
     "category",
     "currentVersion"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "builtin",
       "template"
      ]
     },
     "builtinKey": {
      "type": "string",
      "maxLength": 40
     },
     "templateId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "scope": {
      "type": "string",
      "enum": [
       "catalogue",
       "tenant",
       "space"
      ]
     },
     "spaceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "description": {
      "type": "string",
      "maxLength": 300
     },
     "category": {
      "$ref": "#/components/schemas/DocTemplateCategory"
     },
     "currentVersion": {
      "type": "integer",
      "minimum": 1
     },
     "archived": {
      "type": "boolean"
     },
     "spaceName": {
      "type": "string",
      "maxLength": 120
     },
     "savedBy": {
      "type": "string",
      "maxLength": 200
     },
     "savedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "The If-Match version of a rename or a delete."
     },
     "canManage": {
      "type": "boolean"
     }
    }
   },
   "DocTenantTrashItem": {
    "description": "A row of the Documents home's Trash tab, a space trash row with its space.",
    "allOf": [
     {
      "$ref": "#/components/schemas/DocTrashItem"
     },
     {
      "type": "object",
      "required": [
       "spaceId",
       "spaceName"
      ],
      "properties": {
       "spaceId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "spaceName": {
        "type": "string"
       },
       "spaceArchived": {
        "type": "boolean",
        "description": "Owner Q13 (24 Nov 2026): the space is archived. Only the space's admins see its rows; a restore returns the page into the archived space, which stays archived."
       }
      }
     }
    ]
   },
   "DocTextChange": {
    "type": "object",
    "required": [
     "kind",
     "text"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "added",
       "removed",
       "unchanged"
      ]
     },
     "text": {
      "type": "string",
      "maxLength": 20000
     }
    }
   },
   "DocThreadCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "body"
    ],
    "properties": {
     "inline": {
      "type": "boolean",
      "default": false
     },
     "quote": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300,
      "description": "Required when inline; the marked text as the author saw it."
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     }
    }
   },
   "DocThreadView": {
    "type": "object",
    "required": [
     "id",
     "pageId",
     "audience",
     "inline",
     "state",
     "commentCount",
     "comments",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "inline": {
      "type": "boolean"
     },
     "quote": {
      "type": "string",
      "maxLength": 300
     },
     "state": {
      "type": "string",
      "enum": [
       "open",
       "resolved",
       "orphaned"
      ]
     },
     "resolvedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "resolvedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "commentCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500
     },
     "comments": {
      "type": "array",
      "maxItems": 500,
      "description": "In a list, the first comment and the last three; in a single thread read, every comment (paged by the caller's cursor above 100).",
      "items": {
       "$ref": "#/components/schemas/DocCommentView"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocTitle": {
    "type": "string",
    "minLength": 1,
    "maxLength": 200,
    "example": "Approval process"
   },
   "DocTrashItem": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "title",
     "deletedAt",
     "deletedBy",
     "batchId",
     "restoreUntil",
     "subpageCount",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "page",
       "section",
       "whiteboard"
      ]
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "deletedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deletedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "batchId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "restoreUntil": {
      "type": "string"
     },
     "formerParent": {
      "type": "object",
      "description": "XM-987 — the node's parent at trash time (live or trashed; two levels, INV-DOC-01). Absent for a top-level node.",
      "required": [
       "id",
       "title"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "title": {
        "$ref": "#/components/schemas/DocTitle"
       }
      }
     },
     "subpageCount": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-989 — the node's trashed children of its own delete batch, which \"Delete forever\" removes with it."
     },
     "can": {
      "type": "object",
      "description": "XM-990 — restore while the retention has not passed on an active project; purge (\"Delete forever\", \"Empty trash\") with administer on the active project (owner Q18, 22 Nov 2026).",
      "required": [
       "restore",
       "purge"
      ],
      "properties": {
       "restore": {
        "type": "boolean"
       },
       "purge": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "DocTrashPurgeResult": {
    "type": "object",
    "description": "XM-989 — the pages deleted forever by emptyDocTrash or purgeDocTrashPage (evidence tombstones included) and whether the trash holds more.",
    "required": [
     "purgedCount",
     "hasMore"
    ],
    "properties": {
     "purgedCount": {
      "type": "integer",
      "minimum": 0
     },
     "hasMore": {
      "type": "boolean"
     }
    }
   },
   "DocTrashRestoreRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "Spec DS-1 — the acknowledgement for a restore that broadens the audience or opens a client path (F-DOC-13.R17).",
    "properties": {
     "acknowledgeBroadening": {
      "type": "boolean",
      "default": false
     }
    }
   },
   "DocTreeLevel": {
    "type": "object",
    "required": [
     "projectKey",
     "pageCount",
     "taggedCount",
     "nodes",
     "can"
    ],
    "properties": {
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "example": "ORB"
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "pageCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Live pages of the project (sections excluded)."
     },
     "taggedCount": {
      "type": "integer",
      "minimum": 0
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "nodes": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/DocTreeNode"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     },
     "can": {
      "type": "object",
      "required": [
       "create"
      ],
      "properties": {
       "create": {
        "type": "boolean"
       }
      }
     },
     "trashCount": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-984 (F-DOC-01.R03a): the rows of the project's trash list (listDocTrash). Only on the top level's first page (no parentId, no cursor), and only for a reader who may read the trash (edit_docs on the project); absent on a child level, on a next page and for every other reader."
     }
    }
   },
   "DocTreeNode": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "title",
     "childCount",
     "clientTagged",
     "visibleToClients",
     "position",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "page",
       "section",
       "whiteboard"
      ]
     },
     "parentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "meetingDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "childCount": {
      "type": "integer",
      "minimum": 0
     },
     "childOrder": {
      "type": "string",
      "enum": [
       "manual",
       "meeting_date_desc"
      ]
     },
     "clientTagged": {
      "type": "boolean"
     },
     "visibleToClients": {
      "type": "boolean",
      "description": "Tagged, published, not withdrawn and stamped with the current client version."
     },
     "position": {
      "type": "string",
      "maxLength": 64
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "depth": {
      "type": "integer",
      "minimum": 0,
      "maximum": 49,
      "description": "Spec DS-1 — 0 for a top-level node."
     },
     "restricted": {
      "type": "string",
      "enum": [
       "none",
       "view",
       "edit"
      ],
      "description": "Spec DS-1 — the narrowest restriction on the node's path, for the lock icon."
     },
     "public": {
      "type": "boolean",
      "description": "Spec DS-1 — the page carries the public flag (F-DOC-21)."
     },
     "clientSetting": {
      "$ref": "#/components/schemas/DocClientSetting"
     }
    }
   },
   "DocUnpublishedChange": {
    "type": "object",
    "required": [
     "pageId",
     "title",
     "headVersion",
     "contentDigest",
     "clientTagged",
     "public"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "headVersion": {
      "type": "integer",
      "minimum": 1
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "publishedVersion": {
      "type": "integer",
      "minimum": 1
     },
     "clientTagged": {
      "type": "boolean"
     },
     "public": {
      "type": "boolean"
     },
     "canPublish": {
      "type": "boolean"
     }
    }
   },
   "DocUsageRow": {
    "type": "object",
    "required": [
     "space",
     "pages",
     "versions",
     "attachmentsBytes",
     "comments"
    ],
    "properties": {
     "space": {
      "$ref": "#/components/schemas/DocSpaceRef"
     },
     "pages": {
      "type": "integer",
      "minimum": 0
     },
     "versions": {
      "type": "integer",
      "minimum": 0
     },
     "attachmentsBytes": {
      "$ref": "#/components/schemas/ByteCount"
     },
     "comments": {
      "type": "integer",
      "minimum": 0
     },
     "publicPages": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "DocVersionDiff": {
    "type": "object",
    "required": [
     "from",
     "to",
     "titleChanged",
     "changes",
     "truncated"
    ],
    "properties": {
     "from": {
      "type": "integer",
      "minimum": 1
     },
     "to": {
      "type": "integer",
      "minimum": 1
     },
     "titleChanged": {
      "type": "boolean"
     },
     "changes": {
      "type": "array",
      "maxItems": 2000,
      "items": {
       "$ref": "#/components/schemas/DocTextChange"
      }
     },
     "truncated": {
      "type": "boolean",
      "description": "True when a version holds more than 2,000 blocks; the diff covers the first 2,000."
     }
    }
   },
   "DocVersionPage": {
    "type": "object",
    "required": [
     "items"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/DocVersionSummary"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "DocVersionReason": {
    "type": "string",
    "enum": [
     "idle",
     "interval",
     "publish",
     "restore",
     "seed",
     "unload",
     "reset",
     "retitle",
     "import",
     "api",
     "agent"
    ],
    "description": "import, api and agent are the apply paths of Spec DS-1 (INV-DOC-35) — a Git import, a member's API body write, an agent's write."
   },
   "DocVersionSummary": {
    "type": "object",
    "required": [
     "number",
     "reason",
     "contributors",
     "createdAt",
     "contentDigest"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "reason": {
      "$ref": "#/components/schemas/DocVersionReason"
     },
     "restoredFrom": {
      "type": "integer",
      "minimum": 1
     },
     "contributors": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "contentDigest": {
      "$ref": "#/components/schemas/DocContentDigest"
     },
     "revisions": {
      "type": "array",
      "maxItems": 50,
      "description": "The published revisions that bind this version.",
      "items": {
       "type": "integer",
       "minimum": 1
      }
     },
     "changedSections": {
      "type": "array",
      "maxItems": 5,
      "description": "XM-986 (F-DOC-04.R01a): the headings of the sections that this version changed against its predecessor — added, removed, renamed, moved or edited — at most 5, in order (the changed ones in this version's order, then the removed ones). Decided when the version was recorded. Absent while not decided yet or when the predecessor was pruned before it could be compared.",
      "items": {
       "type": "string",
       "minLength": 1,
       "maxLength": 200
      }
     },
     "changedSectionCount": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-986: how many changed headings there are in all (the history shows \"and N more\" for the ones after changedSections). Present exactly when changedSections is present."
     }
    }
   },
   "DocVersionView": {
    "type": "object",
    "required": [
     "summary",
     "title",
     "body",
     "schemaVersion"
    ],
    "properties": {
     "summary": {
      "$ref": "#/components/schemas/DocVersionSummary"
     },
     "title": {
      "$ref": "#/components/schemas/DocTitle"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "schemaVersion": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "DocWatchState": {
    "type": "object",
    "required": [
     "page",
     "space"
    ],
    "properties": {
     "page": {
      "type": "boolean"
     },
     "space": {
      "type": "boolean"
     }
    }
   },
   "EffectiveSettingView": {
    "type": "object",
    "required": [
     "key",
     "value",
     "default",
     "source",
     "bounds",
     "change",
     "effectiveFrom",
     "can"
    ],
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 120
     },
     "value": {},
     "default": {},
     "source": {
      "type": "string",
      "enum": [
       "registry",
       "platform",
       "plan",
       "tenant_override",
       "tenant",
       "team",
       "project",
       "stage",
       "connection",
       "member",
       "pinned"
      ]
     },
     "bounds": {
      "$ref": "#/components/schemas/SettingBoundsView"
     },
     "limitedBy": {
      "type": "string",
      "enum": [
       "platform",
       "plan",
       "entitlement"
      ]
     },
     "change": {
      "type": "string",
      "enum": [
       "immediate",
       "next_boundary",
       "prospective",
       "next_sign_in",
       "retention_rule"
      ]
     },
     "effect": {
      "type": "string",
      "enum": [
       "business",
       "availability",
       "visibility",
       "security",
       "retention",
       "display"
      ],
      "description": "XM-1038 (PLT-SETTING-EFFECT): what the key affects, from its registry definition (`SettingDefinitionView.effect`). The platform settings (`getPlatformSettings`, `changePlatformSettings`) send it; the console shows it as a badge."
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/Instant"
     },
     "pending": {
      "type": "object",
      "required": [
       "value",
       "effectiveFrom"
      ],
      "properties": {
       "value": {},
       "effectiveFrom": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "needsAttention": {
      "type": "boolean",
      "description": "The stored value did not decode; the safe value applies (INV-PLT-27)."
     },
     "writeVia": {
      "type": "string",
      "maxLength": 120
     },
     "changedBy": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "can": {
      "type": "object",
      "required": [
       "edit"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "EmailAddress": {
    "type": "string",
    "format": "email",
    "minLength": 3,
    "maxLength": 254,
    "example": "ana.k@orbitretail.com"
   },
   "EmailDeliverabilityClearRequest": {
    "type": "object",
    "required": [
     "email"
    ],
    "properties": {
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     }
    }
   },
   "EmailDeliverabilityView": {
    "type": "object",
    "required": [
     "email",
     "state",
     "suppressed"
    ],
    "properties": {
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "state": {
      "type": "string",
      "enum": [
       "ok",
       "soft_bounce",
       "hard_bounce",
       "complaint"
      ]
     },
     "suppressed": {
      "type": "boolean"
     },
     "lastEventAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "clearedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "EnrolmentConfirmation": {
    "description": "The answer of confirmEnrolmentAtSignIn, by the kind of attempt (F-IDN-09.R05, R09; XM-1072): every attempt except an exit attempt gets EnrolmentConfirmed with its eight recovery codes; an exit attempt gets ExitFactorConfirmed, in state exit_granted and without codes.",
    "oneOf": [
     {
      "$ref": "#/components/schemas/EnrolmentConfirmed"
     },
     {
      "$ref": "#/components/schemas/ExitFactorConfirmed"
     }
    ]
   },
   "EnrolmentConfirmed": {
    "type": "object",
    "required": [
     "attempt",
     "recoveryCodes"
    ],
    "description": "A sign-in, invitation, step-up or console enrolment (F-IDN-09.R05); the eight recovery codes are shown once. Its attempt is never in state exit_granted: an exit answer with recovery codes matches no member of EnrolmentConfirmation (F-IDN-09.R09; REV-XM1072-04). The state is the list of the other SignInAttemptView states, not a \"not\", so that the generated client can express the rule (XM-1072 FR2).",
    "properties": {
     "attempt": {
      "allOf": [
       {
        "$ref": "#/components/schemas/SignInAttemptView"
       },
       {
        "type": "object",
        "properties": {
         "state": {
          "type": "string",
          "enum": [
           "started",
           "pending_name",
           "pending_second_factor",
           "pending_enrolment",
           "session"
          ]
         }
        }
       }
      ]
     },
     "recoveryCodes": {
      "$ref": "#/components/schemas/RecoveryCodesIssued"
     }
    }
   },
   "EpicPanel": {
    "type": "object",
    "required": [
     "id",
     "key",
     "state",
     "progress",
     "allTicketsDone",
     "inProgress",
     "tickets",
     "version",
     "can"
    ],
    "description": "BF1-EPIC (§3.15; F-WRK-11.R10–R18): a panel of an epic-level ticket. id is the ticket's id, key its key, name its title (absent when the reader's mask has no Title), owner its assignee (absent without one or when the mask hides the assignee; a reader who cannot view the ticket still sees the owner, register §70), version the ticket's version. ticketsNextCursor continues listTicketChildren (F-WRK-11.R14); with a shared filter or q it continues listProjectTickets with filter[parent]=<key>, the same filters and q and sort=rank (R19; XM-708). members and moreMembers are the assignees of the matching children that the reader can view (R20; absent when the mask hides the assignee); summary is the start of the description of an epic ticket that the reader can view (R21; absent under a mask without Description).",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "startDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "targetDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "completed",
       "cancelled"
      ],
      "description": "XM-1115 (G-EP-01): cancelled is an epic ticket in a done stage with the resolution cancelled. filter[state]=completed lists completed and cancelled epics."
     },
     "completedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "progress": {
      "type": "object",
      "required": [
       "done",
       "total",
       "percent"
      ],
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": "integer",
        "minimum": 0
       },
       "percent": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100
       }
      }
     },
     "counts": {
      "type": "object",
      "required": [
       "todo",
       "inProgress",
       "inReview",
       "done"
      ],
      "description": "XM-1115 (G-EP-01): the live children that the reader can view, by stage kind, and the risks of the open ones (not in a done stage). blocked needs Relations and Status in the mask, overdue Due date (a due date before the reader's today), unassigned Assignee; a risk is absent under its mask. A hidden child never counts.",
      "properties": {
       "todo": {
        "type": "integer",
        "minimum": 0
       },
       "inProgress": {
        "type": "integer",
        "minimum": 0
       },
       "inReview": {
        "type": "integer",
        "minimum": 0
       },
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "blocked": {
        "type": "integer",
        "minimum": 0
       },
       "overdue": {
        "type": "integer",
        "minimum": 0
       },
       "unassigned": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "allTicketsDone": {
      "type": "boolean",
      "description": "Suggests \"Complete epic\" (D-078)."
     },
     "inProgress": {
      "type": "boolean",
      "description": "F-WRK-11.R22 (XM-708): a child that the reader can view is in a stage of kind in_progress or in_review — the design's status \"In progress\"; else \"Planned\" for an active epic."
     },
     "tickets": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/EpicTicketRow"
      }
     },
     "ticketsNextCursor": {
      "type": "string",
      "maxLength": 512
     },
     "members": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "moreMembers": {
      "type": "integer",
      "minimum": 0,
      "description": "The members beyond the first five (+n)."
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "complete",
       "openTicket"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "complete": {
        "type": "boolean"
       },
       "openTicket": {
        "type": "boolean",
        "description": "XM-315 (CFL-422): true when the reader can view the epic's ticket under the ticket rules, so the panel head opens the ticket panel."
       }
      }
     }
    }
   },
   "EpicRef": {
    "type": "object",
    "required": [
     "id",
     "key"
    ],
    "description": "BF1-EPIC (§3.15): the epic-level parent of a ticket — its ticket id, key and title. name is absent when the reader's mask has no Title; the whole member is absent without hierarchy (SR-BF1-43).",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Client approvals"
     }
    }
   },
   "EpicTicketRow": {
    "type": "object",
    "required": [
     "id",
     "key",
     "title",
     "stage",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "stage": {
      "$ref": "#/components/schemas/TicketStage"
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "type": {
      "description": "XM-1103 (register §223 add. 52): the ticket's type; absent when Type is masked.",
      "allOf": [
       {
        "$ref": "#/components/schemas/TicketTypeRef"
       }
      ]
     },
     "priority": {
      "description": "XM-1103: the ticket's priority (not maskable, as on TicketCard). Always present on a new server.",
      "allOf": [
       {
        "$ref": "#/components/schemas/TicketPriority"
       }
      ]
     },
     "dueDate": {
      "description": "XM-1103: the due date; absent when unset or when Due date is masked.",
      "allOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       }
      ]
     },
     "blocked": {
      "type": "boolean",
      "description": "XM-1103: a visible open blocker exists (F-WRK-34.R04); absent when Relations is masked (R03)."
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000,
      "description": "XM-1369 (G-EP-03; F-WRK-11.R24): the estimate in minutes, as on BacklogRow; absent when unset or when Estimate is masked."
     },
     "estimatePoints": {
      "description": "XM-1369 (G-EP-03; F-WRK-11.R24): the story points, as on BacklogRow; absent when unset or when Estimate is masked.",
      "allOf": [
       {
        "$ref": "#/components/schemas/StoryPoints"
       }
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "rerank"
      ],
      "properties": {
       "rerank": {
        "type": "boolean",
        "description": "The reader may reorder this ticket among its epic's tickets: PUT /tickets/{ticketKey}/position with scope epic (F-WRK-03.R14; rerank on the active project)."
       }
      }
     }
    }
   },
   "EstimateUnit": {
    "type": "string",
    "enum": [
     "time",
     "points"
    ],
    "description": "XM-1112 (F-WRK-42.R01): the project's estimate unit (`work.estimate.unit`, `time` by default). The sums and the goal use it; a ticket keeps both values."
   },
   "ExchangeRateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "currency",
     "effectiveFrom",
     "rate"
    ],
    "properties": {
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "rate": {
      "$ref": "#/components/schemas/ExchangeRateValue"
     },
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     },
     "corrects": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ExchangeRateValue": {
    "type": "string",
    "pattern": "^[0-9]{1,6}(\\.[0-9]{1,10})?$",
    "description": "Base-currency units for one unit of the currency.",
    "example": "0.0912000000"
   },
   "ExchangeRateView": {
    "type": "object",
    "required": [
     "id",
     "currency",
     "baseCurrency",
     "effectiveFrom",
     "rate",
     "source",
     "recordedAt",
     "inForce"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "baseCurrency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "rate": {
      "$ref": "#/components/schemas/ExchangeRateValue"
     },
     "source": {
      "type": "string",
      "enum": [
       "manual",
       "ecb"
      ],
      "description": "manual is recorded by a member; ecb is the daily import of the ECB reference rates."
     },
     "referenceDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "recordedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "recordedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     },
     "corrects": {
      "$ref": "#/components/schemas/Uuid"
     },
     "inForce": {
      "type": "boolean",
      "description": "True for the version in force today."
     }
    }
   },
   "ExitFactorConfirmed": {
    "type": "object",
    "required": [
     "attempt"
    ],
    "additionalProperties": false,
    "description": "An exit attempt's factor (F-IDN-09.R09; F-PLT-09.R09); the exit grant, never recovery codes (XM-1072).",
    "properties": {
     "attempt": {
      "allOf": [
       {
        "$ref": "#/components/schemas/SignInAttemptView"
       },
       {
        "type": "object",
        "required": [
         "state"
        ],
        "properties": {
         "state": {
          "const": "exit_granted"
         }
        }
       }
      ]
     }
    }
   },
   "ExitGrantView": {
    "type": "object",
    "required": [
     "tenant",
     "administrator",
     "expiresAt",
     "exports",
     "can"
    ],
    "properties": {
     "tenant": {
      "type": "object",
      "required": [
       "name",
       "state"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 120
       },
       "state": {
        "type": "string",
        "enum": [
         "suspended",
         "deletion_pending"
        ]
       }
      }
     },
     "administrator": {
      "$ref": "#/components/schemas/PersonName"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "downloadsLeft": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5
     },
     "exports": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/TenantExportView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "requestExport",
       "download"
      ],
      "properties": {
       "requestExport": {
        "type": "boolean"
       },
       "download": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ExitStartRequest": {
    "type": "object",
    "required": [
     "tenantSlug"
    ],
    "properties": {
     "tenantSlug": {
      "type": "string",
      "minLength": 3,
      "maxLength": 32,
      "example": "larsen"
     }
    }
   },
   "ExpenseAmountInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "amount",
     "currency"
    ],
    "properties": {
     "amount": {
      "type": "string",
      "pattern": "^[0-9]{1,8}(\\.[0-9]{1,3})?$",
      "example": "1200.00"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     }
    }
   },
   "ExpenseCan": {
    "type": "object",
    "required": [
     "approve",
     "reject",
     "withdraw",
     "reverse",
     "attachReceipt"
    ],
    "properties": {
     "approve": {
      "type": "boolean"
     },
     "reject": {
      "type": "boolean"
     },
     "withdraw": {
      "type": "boolean"
     },
     "reverse": {
      "type": "boolean"
     },
     "attachReceipt": {
      "type": "boolean"
     }
    }
   },
   "ExpenseCategoriesReplaceRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "categories"
    ],
    "properties": {
     "categories": {
      "type": "array",
      "minItems": 1,
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/ExpenseCategoryInput"
      }
     }
    }
   },
   "ExpenseCategoryInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name",
     "kind"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "kind": {
      "type": "string",
      "enum": [
       "licence",
       "travel",
       "subcontractor",
       "other"
      ]
     },
     "archived": {
      "type": "boolean"
     }
    }
   },
   "ExpenseCategoryListMeta": {
    "type": "object",
    "required": [
     "version",
     "can"
    ],
    "description": "The version of the whole list (also the ETag; the optional If-Match of replaceExpenseCategories) and whether the reader may change the list (administer). Group E1 live connect, 22 Nov 2026.",
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "manage"
      ],
      "properties": {
       "manage": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ExpenseCategoryRef": {
    "type": "object",
    "required": [
     "id",
     "name",
     "kind"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Travel"
     },
     "kind": {
      "type": "string",
      "enum": [
       "licence",
       "travel",
       "subcontractor",
       "other"
      ]
     },
     "archived": {
      "type": "boolean"
     }
    }
   },
   "ExpenseCategoryView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "kind",
     "position",
     "archived"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "kind": {
      "type": "string",
      "enum": [
       "licence",
       "travel",
       "subcontractor",
       "other"
      ]
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99
     },
     "archived": {
      "type": "boolean"
     },
     "usage": {
      "type": "integer",
      "minimum": 0,
      "description": "The plan expense lines and the expenses that name the category (F-FIN-10.R02 — the kind is fixed above 0). Group E1 live connect, 22 Nov 2026."
     }
    }
   },
   "ExpenseComparisonFigures": {
    "type": "object",
    "properties": {
     "planned": {
      "$ref": "#/components/schemas/Money"
     },
     "actual": {
      "$ref": "#/components/schemas/Money"
     },
     "provisional": {
      "$ref": "#/components/schemas/Money"
     },
     "forecast": {
      "$ref": "#/components/schemas/Money"
     },
     "variance": {
      "$ref": "#/components/schemas/Money"
     },
     "burnPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 100000
     }
    }
   },
   "ExpenseDecisionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "decision"
    ],
    "properties": {
     "decision": {
      "type": "string",
      "enum": [
       "approve",
       "reject"
      ]
     },
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     }
    }
   },
   "ExpenseFigures": {
    "type": "object",
    "required": [
     "amount"
    ],
    "properties": {
     "amount": {
      "$ref": "#/components/schemas/Money"
     },
     "bill": {
      "$ref": "#/components/schemas/Money"
     },
     "count": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "ExpenseReasonRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "reason"
    ],
    "properties": {
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     }
    }
   },
   "ExpenseReceiptAttachRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "uploadId"
    ],
    "properties": {
     "uploadId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ExpenseReceiptView": {
    "type": "object",
    "required": [
     "fileId",
     "name",
     "sizeBytes",
     "scan",
     "attachedAt",
     "attachedBy"
    ],
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 255
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1
     },
     "scan": {
      "type": "string",
      "enum": [
       "pending",
       "clean",
       "blocked"
      ]
     },
     "attachedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "attachedBy": {
      "$ref": "#/components/schemas/MemberRef"
     }
    }
   },
   "ExpenseRecordRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "categoryId",
     "incurredOn",
     "amount"
    ],
    "properties": {
     "categoryId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "incurredOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "amount": {
      "$ref": "#/components/schemas/ExpenseAmountInput"
     },
     "quantity": {
      "$ref": "#/components/schemas/SubcontractorQuantity"
     },
     "rebillable": {
      "type": "boolean",
      "default": false
     },
     "ticketKey": {
      "type": "string",
      "maxLength": 20
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "supplier": {
      "type": "string",
      "maxLength": 120
     },
     "reference": {
      "type": "string",
      "maxLength": 80
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "corrects": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ExpenseView": {
    "type": "object",
    "required": [
     "id",
     "project",
     "category",
     "incurredOn",
     "amount",
     "projectAmount",
     "state",
     "recordedAt",
     "recordedBy",
     "receiptCount",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "category": {
      "$ref": "#/components/schemas/ExpenseCategoryRef"
     },
     "incurredOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "amount": {
      "$ref": "#/components/schemas/Money"
     },
     "projectAmount": {
      "$ref": "#/components/schemas/Money"
     },
     "baseAmount": {
      "$ref": "#/components/schemas/Money"
     },
     "quantity": {
      "$ref": "#/components/schemas/SubcontractorQuantity"
     },
     "rebillable": {
      "type": "boolean"
     },
     "billAmount": {
      "$ref": "#/components/schemas/Money"
     },
     "ticket": {
      "$ref": "#/components/schemas/TimeTicketRef"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "memberHidden": {
      "type": "boolean",
      "description": "True when the expense is for a person whom this reader may not see named (F-FIN-11.R10)."
     },
     "formerMember": {
      "type": "boolean"
     },
     "supplier": {
      "type": "string",
      "maxLength": 120
     },
     "reference": {
      "type": "string",
      "maxLength": 80
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "state": {
      "type": "string",
      "enum": [
       "recorded",
       "approved",
       "rejected",
       "withdrawn",
       "reversed"
      ]
     },
     "corrects": {
      "$ref": "#/components/schemas/Uuid"
     },
     "correctedBy": {
      "$ref": "#/components/schemas/Uuid"
     },
     "recordedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "recordedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decidedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "decisionReason": {
      "type": "string",
      "maxLength": 500
     },
     "receiptCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5
     },
     "receiptsHidden": {
      "type": "boolean",
      "description": "True when the expense is for a member whom this reader may not see named; the receipts and the note then stay hidden (F-FIN-11.R10, R11)."
     },
     "unconverted": {
      "type": "boolean"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "$ref": "#/components/schemas/ExpenseCan"
     }
    }
   },
   "ExtensionGrant": {
    "type": "object",
    "description": "Exactly one clause (07 §2.10); never administer.",
    "minProperties": 1,
    "maxProperties": 1,
    "additionalProperties": false,
    "properties": {
     "capabilities": {
      "type": "array",
      "minItems": 1,
      "maxItems": 29,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/CapabilityKey"
      }
     },
     "projects": {
      "type": "object",
      "required": [
       "scope",
       "projectIds"
      ],
      "additionalProperties": false,
      "properties": {
       "scope": {
        "type": "string",
        "enum": [
         "only"
        ]
       },
       "projectIds": {
        "type": "array",
        "minItems": 1,
        "maxItems": 100,
        "uniqueItems": true,
        "items": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      }
     },
     "time": {
      "type": "string",
      "enum": [
       "monthly_totals",
       "weekly_totals",
       "own_entries",
       "all_entries"
      ]
     },
     "docs": {
      "type": "string",
      "enum": [
       "all",
       "client_tagged"
      ]
     },
     "chat": {
      "type": "boolean",
      "enum": [
       true
      ]
     },
     "relationships": {
      "type": "string",
      "enum": [
       "view",
       "manage"
      ]
     }
    }
   },
   "FacetFlagInput": {
    "type": "string",
    "enum": [
     "true"
    ],
    "description": "XM-1166: the value of the rules that take no ids (empty, notEmpty and their negated keys); any other value is 400 query.invalid naming the parameter."
   },
   "FacetRulesInput": {
    "type": "object",
    "minProperties": 1,
    "maxProperties": 10,
    "additionalProperties": false,
    "description": "XM-1166 (F-WRK-01.R04; the design's filter bar, G-WB-07, G-BL-03): the rules of one facet filter (stage, label, epicId, type; since G-MT-08 also the projectKey, stageKind and priority of GET /me/tickets, F-WSP-08.R07), combined with AND. The operators are the registry version 1 of FacetOperator. anyOf, allOf and noneOf take a comma list of ids (or type keys); empty and notEmpty take the value true. A key not.<operator> is the same rule negated (the design's Negate): not.anyOf is noneOf, not.empty is notEmpty, and not.allOf keeps at least one of the values away. An unknown operator, a bad value or an empty list is 400 query.invalid naming the exact parameter (filter[label][allOf]).",
    "properties": {
     "anyOf": {
      "type": "string",
      "maxLength": 3800
     },
     "allOf": {
      "type": "string",
      "maxLength": 3800
     },
     "noneOf": {
      "type": "string",
      "maxLength": 3800
     },
     "empty": {
      "$ref": "#/components/schemas/FacetFlagInput"
     },
     "notEmpty": {
      "$ref": "#/components/schemas/FacetFlagInput"
     },
     "not.anyOf": {
      "type": "string",
      "maxLength": 3800
     },
     "not.allOf": {
      "type": "string",
      "maxLength": 3800
     },
     "not.noneOf": {
      "type": "string",
      "maxLength": 3800
     },
     "not.empty": {
      "$ref": "#/components/schemas/FacetFlagInput"
     },
     "not.notEmpty": {
      "$ref": "#/components/schemas/FacetFlagInput"
     }
    }
   },
   "FeatureSwitchKey": {
    "type": "string",
    "minLength": 3,
    "maxLength": 120,
    "pattern": "^[a-z][a-z0-9]*(\\.[A-Za-z0-9][A-Za-z0-9_-]*){1,3}$",
    "description": "XM-1331 (F-PLT-15.R10): the key of one row of the feature-switch map, from the catalogue (`apps/api/resources/feature-switches/catalogue.json`) — `area.<rail area>`, `section.<surface>.<group>`, `page.<surface>.<sidebar entry id>`, `features.<context code>`, `feature.<F- ID>`, `flag.<FeatureFlagKey>`. A key is never renamed or reused.",
    "example": "page.admin.members"
   },
   "FieldSchemaView": {
    "type": "object",
    "required": [
     "fieldSetVersion",
     "fields"
    ],
    "properties": {
     "fieldSetVersion": {
      "type": "integer",
      "minimum": 1
     },
     "fields": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/CustomFieldSchemaEntry"
      }
     }
    }
   },
   "FieldSetLibraryField": {
    "type": "object",
    "description": "XM-1427 (F-PRJ-14.R12). A library field as the field-set editor's picker shows it. `config.options` holds the active options only.",
    "required": [
     "id",
     "key",
     "name",
     "type",
     "config"
    ],
    "additionalProperties": false,
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/CustomFieldKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Budget code"
     },
     "type": {
      "$ref": "#/components/schemas/CustomFieldTypeKey"
     },
     "config": {
      "$ref": "#/components/schemas/CustomFieldConfigView"
     }
    }
   },
   "FinanceAccessView": {
    "type": "object",
    "required": [
     "viewRates",
     "manageRates",
     "billRates",
     "baseCurrency",
     "financeProjectCount",
     "managedProjectCount",
     "projectRatesProjectCount"
    ],
    "properties": {
     "viewRates": {
      "type": "boolean"
     },
     "manageRates": {
      "type": "boolean"
     },
     "billRates": {
      "type": "boolean"
     },
     "baseCurrency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "financeProjectCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Projects where the reader holds view_finance: the money and the rates of these projects (finance §3.11 FA-1)."
     },
     "managedProjectCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Projects where the reader holds manage_finance."
     },
     "projectRatesProjectCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Projects where the reader holds set_project_rates."
     }
    }
   },
   "FinanceFigures": {
    "type": "object",
    "required": [
     "minutes"
    ],
    "properties": {
     "minutes": {
      "type": "integer",
      "minimum": 0
     },
     "cost": {
      "$ref": "#/components/schemas/Money"
     },
     "bill": {
      "$ref": "#/components/schemas/Money"
     }
    }
   },
   "FinanceNotice": {
    "type": "object",
    "required": [
     "code"
    ],
    "properties": {
     "code": {
      "type": "string",
      "enum": [
       "no_baseline",
       "amounts_unconverted",
       "minutes_unrated",
       "estimates_hidden",
       "estimate_field_hidden",
       "estimates_unassigned_uncosted",
       "entries_hidden_time_level",
       "expenses_unconverted",
       "reference_rates_stale"
      ]
     },
     "count": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "FinanceReason": {
    "type": "string",
    "minLength": 1,
    "maxLength": 500
   },
   "FinanceSignedFigures": {
    "type": "object",
    "required": [
     "minutes"
    ],
    "properties": {
     "minutes": {
      "type": "integer"
     },
     "cost": {
      "$ref": "#/components/schemas/Money"
     },
     "bill": {
      "$ref": "#/components/schemas/Money"
     }
    }
   },
   "FlowPresenceSignal": {
    "type": "object",
    "description": "Owner, 23 Nov 2026: `{activity: editing, stepId}` — the person edits that step of the open flow — or `{activity: idle}`. No other member, no free text.",
    "required": [
     "activity"
    ],
    "additionalProperties": false,
    "properties": {
     "activity": {
      "type": "string",
      "enum": [
       "editing",
       "idle"
      ]
     },
     "stepId": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{0,39}$"
     }
    }
   },
   "GeoAttributionView": {
    "type": "object",
    "description": "The GeoIP database's credit, shown wherever a location derived from it is shown (register §58; DB-IP Lite is CC BY 4.0).",
    "required": [
     "text",
     "url"
    ],
    "properties": {
     "text": {
      "type": "string",
      "maxLength": 80,
      "example": "IP Geolocation by DB-IP"
     },
     "url": {
      "type": "string",
      "format": "uri",
      "maxLength": 200,
      "example": "https://db-ip.com/"
     }
    }
   },
   "GitLabInstance": {
    "type": "object",
    "required": [
     "id",
     "url",
     "label",
     "inUse"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "url": {
      "$ref": "#/components/schemas/InstanceUrl"
     },
     "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "Northwind GitLab"
     },
     "inUse": {
      "type": "integer",
      "minimum": 0,
      "description": "Live connections that use the instance."
     }
    }
   },
   "GitProviderKey": {
    "type": "string",
    "enum": [
     "github",
     "gitlab"
    ]
   },
   "GoalProgressView": {
    "type": "object",
    "required": [
     "method",
     "byCount"
    ],
    "properties": {
     "percent": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Absent when nothing can be computed; the SPA shows an em dash."
     },
     "method": {
      "type": "string",
      "enum": [
       "estimate_with_median",
       "estimate_only",
       "ticket_count"
      ]
     },
     "byCount": {
      "type": "boolean",
      "description": "True when no sprint ticket has an estimate and the value is done ÷ total tickets (D-028)."
     },
     "unit": {
      "$ref": "#/components/schemas/EstimateUnit"
     }
    }
   },
   "GroupConversationStart": {
    "type": "object",
    "required": [
     "kind",
     "memberIds"
    ],
    "additionalProperties": false,
    "description": "Without a title (owner, register §229 Q11; XM-1052: \"New message\" with several people) the server names the group from its participants' names — the caller first, then the members in the given order, joined by \", \" and cut with \"+N\" at 80 characters — until someone renames it.",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "group"
      ]
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "memberIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 199,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "HelpDeskAcceptDraft": {
    "type": "object",
    "required": [
     "title",
     "priority",
     "placement",
     "shareWithClient"
    ],
    "properties": {
     "typeKey": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$",
      "example": "bug",
      "description": "A type of the project's catalogue (Spec BF-1); the default type when absent."
     },
     "parentKey": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "priority": {
      "type": "string",
      "enum": [
       "high",
       "medium",
       "low"
      ]
     },
     "assigneeId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "placement": {
      "type": "string",
      "enum": [
       "backlog",
       "active_sprint"
      ]
     },
     "shareWithClient": {
      "type": "boolean"
     },
     "copyFileIds": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "customFields": {
      "type": "object",
      "maxProperties": 50,
      "description": "Custom-field values by field id, validated by Work (F-WRK-26)."
     },
     "teamMessage": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000,
      "description": "An optional client-visible reply posted with the decision."
     }
    }
   },
   "HelpDeskAcceptProposal": {
    "type": "object",
    "required": [
     "files",
     "customFields"
    ],
    "description": "Owner, 23 Nov 2026 (H1 rest; F-HLP-08.R03, R05) - `GET /requests/{requestKey}/accept-proposal`.",
    "properties": {
     "files": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/HelpDeskFileView"
      },
      "description": "The request's files that scanned clean."
     },
     "customFields": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "key",
        "name",
        "type",
        "value"
       ],
       "properties": {
        "key": {
         "type": "string",
         "maxLength": 64,
         "description": "The custom field's key (the key of `HelpDeskAcceptDraft.customFields`)."
        },
        "name": {
         "type": "string",
         "maxLength": 60
        },
        "type": {
         "type": "string",
         "enum": [
          "short_text",
          "long_text",
          "number",
          "date",
          "single_select",
          "multi_select",
          "checkbox",
          "url"
         ]
        },
        "value": {
         "description": "The proposed input in Work's shape: text, a number, a boolean, an option id or a list of option ids."
        },
        "options": {
         "type": "array",
         "maxItems": 100,
         "items": {
          "type": "object",
          "required": [
           "id",
           "label"
          ],
          "properties": {
           "id": {
            "$ref": "#/components/schemas/Uuid"
           },
           "label": {
            "type": "string",
            "maxLength": 60
           }
          }
         }
        }
       }
      }
     }
    }
   },
   "HelpDeskApiRequestDraft": {
    "allOf": [
     {
      "$ref": "#/components/schemas/HelpDeskRequestDraft"
     },
     {
      "type": "object",
      "properties": {
       "externalReference": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "pattern": "^[A-Za-z0-9._:/#-]+$",
        "example": "orbit-desk:case:88412"
       },
       "reporter": {
        "$ref": "#/components/schemas/HelpDeskReporter"
       }
      }
     }
    ]
   },
   "HelpDeskCategory": {
    "type": "object",
    "required": [
     "key",
     "name"
    ],
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$",
      "example": "website_bug"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Website bug"
     },
     "description": {
      "type": "string",
      "maxLength": 200
     },
     "defaultTypeKey": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$",
      "example": "bug"
     },
     "defaultPriority": {
      "type": "string",
      "enum": [
       "high",
       "medium",
       "low"
      ]
     },
     "defaultImpact": {
      "type": "string",
      "enum": [
       "low",
       "medium",
       "high",
       "urgent"
      ],
      "description": "XM-1285: the impact a new request of the category gets when the requester chose none; the portal form preselects it."
     },
     "defaultTriageOwnerId": {
      "allOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       }
      ],
      "description": "XM-1285: the triage owner a new request of the category gets before the project's helpdesk.defaultTriageOwner, while the member is active and may triage there. Internal reads only."
     },
     "archived": {
      "type": "boolean"
     }
    }
   },
   "HelpDeskCategoryTemplate": {
    "type": "object",
    "required": [
     "key",
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "defaultPriority": {
      "type": "string",
      "enum": [
       "high",
       "medium",
       "low"
      ]
     }
    }
   },
   "HelpDeskChannel": {
    "type": "string",
    "enum": [
     "portal",
     "api",
     "internal",
     "email"
    ],
    "x-extensible-enum": true
   },
   "HelpDeskClientListCount": {
    "type": "object",
    "description": "A bounded count of the client list (XM-1036; F-HLP-03.R16). `atLeast` false: `count` is exact. `atLeast` true: at least `count` requests (above 1,000 the count is 1,000; the page shows \"1,000+\").",
    "required": [
     "count",
     "atLeast"
    ],
    "additionalProperties": false,
    "properties": {
     "count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
     },
     "atLeast": {
      "type": "boolean"
     }
    }
   },
   "HelpDeskClientListMeta": {
    "allOf": [
     {
      "$ref": "#/components/schemas/CursorPageMeta"
     },
     {
      "type": "object",
      "required": [
       "total",
       "openCount"
      ],
      "properties": {
       "total": {
        "$ref": "#/components/schemas/HelpDeskClientListCount",
        "description": "The requests of the filter (`status` and `q`) over the list's scope (\"Showing n of N\")."
       },
       "openCount": {
        "$ref": "#/components/schemas/HelpDeskClientListCount",
        "description": "The requests of the filter `open` without `q` over the list's scope (\"N open\")."
       }
      }
     }
    ]
   },
   "HelpDeskClientRequestCounts": {
    "type": "object",
    "description": "The portal shell's Requests tab (F-HLP-03.R13) over the requests the reader may read: the requests waiting for the client's reply (at most 99, `capped` when more), whether any request is readable, and whether the reader may send a request.",
    "required": [
     "waitingForYou",
     "capped",
     "hasRequests",
     "can"
    ],
    "properties": {
     "waitingForYou": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99
     },
     "capped": {
      "type": "boolean"
     },
     "hasRequests": {
      "type": "boolean"
     },
     "can": {
      "type": "object",
      "required": [
       "submit"
      ],
      "properties": {
       "submit": {
        "type": "boolean"
       },
       "submitRefusal": {
        "type": "string",
        "enum": [
         "preview",
         "form_off",
         "role"
        ],
        "description": "Present when `submit` is false (XM-749): the first that holds of `preview` (View as client is read-only), `form_off` (the portal does not take requests: Help desk's portal channel or the form is closed) and `role` (the reader's client role lacks `submit_requests`). It names only the reader's own situation (KDC-04)."
       }
      }
     }
    }
   },
   "HelpDeskClientRequestRow": {
    "type": "object",
    "required": [
     "key",
     "summary",
     "status",
     "submittedAt",
     "updatedAt"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/HelpDeskRequestKey"
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "status": {
      "$ref": "#/components/schemas/HelpDeskClientStatus"
     },
     "categoryName": {
      "type": "string",
      "maxLength": 60
     },
     "impact": {
      "$ref": "#/components/schemas/HelpDeskImpact"
     },
     "submittedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "externalReference": {
      "type": "string",
      "maxLength": 200,
      "description": "API readers only."
     },
     "waitingForYou": {
      "type": "boolean"
     },
     "requesterName": {
      "type": "string",
      "maxLength": 120,
      "description": "The requester (F-HLP-03.R02; XM-1485), only under the scope `organisation`: the guest who sent the request, or the guest a team member logged it for. Never a team member; absent for a request without a guest. \"Former member\" for a guest who is removed, erased or not in the directory (XM-1094; register §229 item 17)."
     },
     "neededBy": {
      "$ref": "#/components/schemas/DateOnly",
      "description": "The client's \"Needed by\" day (XM-981); absent when none."
     }
    }
   },
   "HelpDeskClientRequestView": {
    "type": "object",
    "required": [
     "key",
     "summary",
     "description",
     "status",
     "impact",
     "submittedAt",
     "updatedAt",
     "messages",
     "files",
     "closedWithoutReply",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid",
      "description": "XM-1029: the request's id, the upload target `help_desk_request(id)` of a reply's files (F-HLP-03.R07)."
     },
     "key": {
      "$ref": "#/components/schemas/HelpDeskRequestKey"
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000
     },
     "status": {
      "$ref": "#/components/schemas/HelpDeskClientStatus"
     },
     "impact": {
      "$ref": "#/components/schemas/HelpDeskImpact"
     },
     "categoryName": {
      "type": "string",
      "maxLength": 60
     },
     "fields": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/HelpDeskFieldValue"
      }
     },
     "requesterName": {
      "type": "string",
      "maxLength": 120,
      "description": "The requester (XM-1485): the guest who sent the request, or the guest a team member logged it for. Never a team member; absent for a request without a guest. \"Former member\" for a guest who is removed, erased or not in the directory (XM-1094; register §229 item 17)."
     },
     "neededBy": {
      "$ref": "#/components/schemas/DateOnly",
      "description": "The client's \"Needed by\" day (XM-981); absent when none."
     },
     "handledBy": {
      "$ref": "#/components/schemas/PortalPersonRef",
      "description": "\"Handled by\" (F-HLP-03.R15; XM-981): the assignee of the linked ticket, only while the reader sees that ticket and the reader's client field plan shows the assignee; the `ref` is in the ticket's scope. Never the triage owner (INV-HLP-04) and never an operator (register §230 add. 2, Q19 (a)). Absent otherwise; the page shows \"Not assigned yet\"."
     },
     "submittedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "externalReference": {
      "type": "string",
      "maxLength": 200
     },
     "rejectionReason": {
      "$ref": "#/components/schemas/HelpDeskRejectionReason"
     },
     "clientMessage": {
      "type": "string",
      "maxLength": 2000
     },
     "closedWithoutReply": {
      "type": "boolean",
      "description": "True when the auto-close closed the request because no client message came after an information request (`closed{no_response}`; F-HLP-08.R13): the page reads \"Closed — no reply received\" instead of \"Closed\" (F-HLP-03.R06; XM-749). False for every other request. A request closed because the project's client changed is never readable by the current client (INV-HLP-04)."
     },
     "linkedTicket": {
      "$ref": "#/components/schemas/HelpDeskLinkedTicket"
     },
     "followUpOf": {
      "$ref": "#/components/schemas/HelpDeskRequestKey"
     },
     "followUpOfDeleted": {
      "type": "boolean",
      "description": "True when the earlier request was purged; followUpOf then holds its stored key (follow_up_of_key) and the page shows \"Follow-up of ORB-R12 (deleted)\"."
     },
     "messages": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/HelpDeskMessageView"
      }
     },
     "messagesTruncated": {
      "type": "boolean",
      "description": "True when more than 200 messages exist; read the messages operation."
     },
     "files": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/HelpDeskFileView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "reply",
       "withdraw",
       "followUp"
      ],
      "properties": {
       "reply": {
        "type": "boolean"
       },
       "withdraw": {
        "type": "boolean"
       },
       "followUp": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "HelpDeskClientStatus": {
    "type": "string",
    "description": "The client label of a state (RequestClientStatusPolicy).",
    "enum": [
     "received",
     "in_review",
     "waiting_for_you",
     "accepted",
     "done",
     "rejected",
     "withdrawn",
     "closed"
    ]
   },
   "HelpDeskConnectionInput": {
    "type": "object",
    "required": [
     "name",
     "clientRoleId",
     "abilities",
     "readScope"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "Orbit Desk"
     },
     "clientRoleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "abilities": {
      "type": "array",
      "minItems": 1,
      "maxItems": 4,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "enum": [
        "requests:create",
        "requests:read",
        "requests:reply",
        "files:upload"
       ]
      }
     },
     "readScope": {
      "type": "string",
      "enum": [
       "own",
       "organisation"
      ]
     },
     "allowedRanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 43,
       "example": "203.0.113.0/24"
      }
     },
     "requestsPerMinute": {
      "type": "integer",
      "minimum": 1,
      "maximum": 600
     },
     "createsPerHour": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000
     },
     "uploadsPerHour": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000
     },
     "webhook": {
      "type": "object",
      "required": [
       "endpointId",
       "events"
      ],
      "properties": {
       "endpointId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "events": {
        "type": "array",
        "minItems": 1,
        "maxItems": 5,
        "uniqueItems": true,
        "items": {
         "type": "string",
         "enum": [
          "request.created",
          "request.updated",
          "request.message_posted",
          "request.decided",
          "request.closed"
         ]
        }
       }
      }
     }
    }
   },
   "HelpDeskConnectionView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "projectKey",
     "organisationName",
     "clientRoleName",
     "abilities",
     "readScope",
     "state",
     "tokens",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "organisationName": {
      "type": "string",
      "maxLength": 120
     },
     "clientRoleName": {
      "type": "string",
      "maxLength": 60
     },
     "abilities": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string"
      }
     },
     "readScope": {
      "type": "string",
      "enum": [
       "own",
       "organisation"
      ]
     },
     "allowedRanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 43
      }
     },
     "requestsPerMinute": {
      "type": "integer",
      "minimum": 1,
      "maximum": 600
     },
     "createsPerHour": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000
     },
     "uploadsPerHour": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000
     },
     "webhookEndpointName": {
      "type": "string",
      "maxLength": 80
     },
     "webhookEvents": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "type": "string"
      }
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "paused",
       "revoked"
      ]
     },
     "revokeCause": {
      "type": "string",
      "enum": [
       "by_admin",
       "client_changed",
       "role_unavailable",
       "tenant_deleted"
      ]
     },
     "tokens": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "$ref": "#/components/schemas/HelpDeskTokenView"
      }
     },
     "lastUsedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "HelpDeskDecisionResult": {
    "type": "object",
    "required": [
     "request"
    ],
    "properties": {
     "request": {
      "$ref": "#/components/schemas/HelpDeskTriageView"
     },
     "ticketKey": {
      "$ref": "#/components/schemas/TicketKey"
     }
    }
   },
   "HelpDeskFieldValue": {
    "type": "object",
    "required": [
     "key",
     "value"
    ],
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$"
     },
     "value": {
      "description": "By the field's kind - a string (text, long_text, single_select option key, date YYYY-MM-DD, url), a number, a boolean (checkbox) or an array of option keys (multi_select).",
      "oneOf": [
       {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
       },
       {
        "type": "number"
       },
       {
        "type": "boolean"
       },
       {
        "type": "array",
        "minItems": 1,
        "maxItems": 20,
        "items": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,29}$"
        }
       }
      ]
     }
    }
   },
   "HelpDeskFileView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "sizeBytes",
     "status"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1
     },
     "status": {
      "type": "string",
      "enum": [
       "checking",
       "ready",
       "blocked"
      ]
     },
     "downloadUrl": {
      "type": "string",
      "maxLength": 2048,
      "description": "Present only while status is ready. A path of the API, never a signed URL - for a connection, the path of downloadIntakeRequestFile; in the portal and the workspace, the path of downloadFile with its tenant query (?tenant=, a browser navigation carries no tenant header; G-HD3). A signed URL comes only from that operation and is valid 60 seconds."
     }
    }
   },
   "HelpDeskFormClientView": {
    "description": "The client read of the form (`getPortalRequestForm`; F-HLP-01.R10; XM-749; REV-BHP-RC1-04).",
    "allOf": [
     {
      "$ref": "#/components/schemas/HelpDeskFormView"
     },
     {
      "type": "object",
      "required": [
       "can"
      ],
      "properties": {
       "can": {
        "type": "object",
        "required": [
         "submit"
        ],
        "additionalProperties": false,
        "description": "Whether the reader may send the form. `submitRefusal` is present when `submit` is false, with the rule of `HelpDeskClientRequestCounts.can` (F-HLP-03.R13): `preview` (View as client is read-only) or `role` (the reader's role has no `submit_requests`), so the SPA shows \"Your role cannot send requests\" instead of a form that the submission refuses. The form read answers `404 project.not_found` while the form is off, so this enum has no `form_off`.",
        "properties": {
         "submit": {
          "type": "boolean"
         },
         "submitRefusal": {
          "type": "string",
          "enum": [
           "preview",
           "role"
          ]
         }
        }
       },
       "maxFileBytes": {
        "type": "integer",
        "minimum": 1,
        "description": "XM-1060: the size bound of one file in bytes (the tenant's `files.maxUploadBytes`), so the form says \"up to … each\" before an upload. Files still checks each upload."
       }
      }
     }
    ]
   },
   "HelpDeskFormDraft": {
    "type": "object",
    "required": [
     "categories",
     "fields",
     "attachments"
    ],
    "properties": {
     "intro": {
      "type": "string",
      "maxLength": 1000,
      "example": "Tell us what happened. We answer within one working day."
     },
     "categories": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "$ref": "#/components/schemas/HelpDeskCategory"
      },
      "description": "All categories, archived ones included. At most 20 † are active (F-HLP-01.R04; the internal read's `limits.activeCategories`); 1,000 † in total is an abuse bound."
     },
     "fields": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "$ref": "#/components/schemas/HelpDeskFormField"
      },
      "description": "All fields, archived ones included. At most 20 † are active (F-HLP-01.R04; the internal read's `limits.activeFields`); 1,000 † in total is an abuse bound."
     },
     "attachments": {
      "type": "object",
      "required": [
       "allowed",
       "maxFiles"
      ],
      "properties": {
       "allowed": {
        "type": "boolean"
       },
       "maxFiles": {
        "type": "integer",
        "minimum": 1,
        "maximum": 10
       }
      }
     }
    }
   },
   "HelpDeskFormField": {
    "type": "object",
    "required": [
     "key",
     "label",
     "kind",
     "required"
    ],
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$",
      "example": "browser"
     },
     "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Browser"
     },
     "help": {
      "type": "string",
      "maxLength": 200
     },
     "kind": {
      "type": "string",
      "enum": [
       "text",
       "long_text",
       "number",
       "single_select",
       "multi_select",
       "date",
       "checkbox",
       "url"
      ]
     },
     "required": {
      "type": "boolean"
     },
     "options": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "key",
        "label"
       ],
       "properties": {
        "key": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,29}$"
        },
        "label": {
         "type": "string",
         "minLength": 1,
         "maxLength": 60
        }
       }
      }
     },
     "mapsTo": {
      "$ref": "#/components/schemas/Uuid"
     },
     "categories": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "type": "string",
       "pattern": "^[a-z][a-z0-9_]{1,29}$"
      },
      "description": "Keys of categories of the same form, archived ones included (F-HLP-01.R06)."
     },
     "archived": {
      "type": "boolean"
     }
    }
   },
   "HelpDeskFormInternalView": {
    "description": "The internal read of the form: `getHelpDeskForm` and the answers of `saveHelpDeskForm` and `setHelpDeskFormEnabled` (F-HLP-01.R02, G-HD6). The connection read (`getIntakeForm`) is `HelpDeskFormView` and carries no `can` (REV-BHP-RC1-04).",
    "allOf": [
     {
      "$ref": "#/components/schemas/HelpDeskFormView"
     },
     {
      "type": "object",
      "required": [
       "can",
       "limits"
      ],
      "properties": {
       "can": {
        "type": "object",
        "required": [
         "edit"
        ],
        "additionalProperties": false,
        "description": "What the reader may do with the form: `edit` is true when the reader may save the form and turn it on or off (`administer`, or `plan` on the project while `helpdesk.formEditors` is `admins_and_pms`).",
        "properties": {
         "edit": {
          "type": "boolean"
         }
        }
       },
       "limits": {
        "type": "object",
        "required": [
         "activeCategories",
         "activeFields"
        ],
        "additionalProperties": false,
        "description": "The size limits that the save applies (F-HLP-01.R04, `RequestFormLimits`). Only active categories and active fields count; archived ones do not. The editor shows these numbers and keeps no copy of them.",
        "properties": {
         "activeCategories": {
          "type": "integer",
          "minimum": 1,
          "example": 20
         },
         "activeFields": {
          "type": "integer",
          "minimum": 1,
          "example": 20
         }
        }
       }
      }
     }
    ]
   },
   "HelpDeskFormView": {
    "allOf": [
     {
      "$ref": "#/components/schemas/HelpDeskFormDraft"
     },
     {
      "type": "object",
      "required": [
       "enabled",
       "version",
       "available"
      ],
      "properties": {
       "enabled": {
        "type": "boolean"
       },
       "version": {
        "type": "integer",
        "minimum": 1
       },
       "available": {
        "type": "boolean",
        "description": "Help desk is available for the project (HelpDeskAvailabilityPolicy)."
       },
       "unavailableReason": {
        "type": "string",
        "enum": [
         "module_off",
         "plan",
         "flag",
         "project_archived",
         "no_client_organisation"
        ]
       },
       "acceptedFileTypes": {
        "type": "array",
        "maxItems": 100,
        "items": {
         "type": "string",
         "maxLength": 100
        }
       }
      }
     }
    ]
   },
   "HelpDeskHeldMailDecision": {
    "type": "object",
    "required": [
     "decision"
    ],
    "additionalProperties": false,
    "properties": {
     "decision": {
      "type": "string",
      "enum": [
       "release",
       "reject"
      ]
     }
    }
   },
   "HelpDeskHeldMailView": {
    "type": "object",
    "required": [
     "id",
     "mailboxId",
     "sender",
     "subject",
     "senderClass",
     "dmarc",
     "state",
     "receivedAt",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "mailboxId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "sender": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "senderName": {
      "type": "string",
      "maxLength": 120
     },
     "subject": {
      "type": "string",
      "maxLength": 998
     },
     "excerpt": {
      "type": "string",
      "maxLength": 500,
      "description": "Plain text; untrusted."
     },
     "senderClass": {
      "type": "string",
      "enum": [
       "guest",
       "unknown"
      ]
     },
     "dmarc": {
      "type": "string",
      "enum": [
       "pass",
       "fail",
       "none"
      ]
     },
     "reason": {
      "type": "string",
      "maxLength": 60
     },
     "state": {
      "type": "string",
      "enum": [
       "held",
       "linked",
       "rejected"
      ]
     },
     "requestKey": {
      "type": "string",
      "maxLength": 40
     },
     "receivedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "HelpDeskHistoryEntry": {
    "type": "object",
    "required": [
     "kind",
     "actorKind",
     "occurredAt"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "submitted",
       "triage_owner_changed",
       "state_changed",
       "decision_started",
       "decision_abandoned",
       "message_posted",
       "file_added",
       "service_level_changed",
       "progress_changed",
       "reporter_erased",
       "message_redacted"
      ]
     },
     "actorKind": {
      "type": "string",
      "enum": [
       "member",
       "guest",
       "connection",
       "assistant",
       "automation",
       "system"
      ]
     },
     "actorName": {
      "type": "string",
      "maxLength": 120
     },
     "cause": {
      "type": "string",
      "maxLength": 60
     },
     "before": {
      "type": "string",
      "maxLength": 60
     },
     "after": {
      "type": "string",
      "maxLength": 60
     },
     "occurredAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "HelpDeskImpact": {
    "type": "string",
    "enum": [
     "low",
     "medium",
     "high",
     "urgent"
    ]
   },
   "HelpDeskInternalRequestDraft": {
    "allOf": [
     {
      "$ref": "#/components/schemas/HelpDeskRequestDraft"
     },
     {
      "type": "object",
      "properties": {
       "onBehalfOfGuestId": {
        "$ref": "#/components/schemas/Uuid"
       }
      }
     }
    ]
   },
   "HelpDeskLinkedTicket": {
    "type": "object",
    "description": "Present only when the reader sees the linked ticket (INV-HLP-10).",
    "required": [
     "key",
     "status"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "status": {
      "$ref": "#/components/schemas/ClientStageView"
     }
    }
   },
   "HelpDeskMailFileNotTaken": {
    "type": "object",
    "description": "F-HLP-11.R12: an attachment of a mail that is not on the request — its name, its size and why. `messageId`: the reply it came with (absent: the submission).",
    "required": [
     "name",
     "sizeBytes",
     "reason"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 0
     },
     "reason": {
      "type": "string",
      "enum": [
       "files_not_allowed",
       "too_many_files",
       "too_large",
       "empty",
       "type_not_accepted",
       "name_not_accepted",
       "storage_full",
       "not_stored"
      ]
     },
     "messageId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "HelpDeskMailboxChange": {
    "type": "object",
    "required": [
     "status"
    ],
    "additionalProperties": false,
    "properties": {
     "status": {
      "type": "string",
      "enum": [
       "active",
       "paused"
      ]
     }
    }
   },
   "HelpDeskMailboxInput": {
    "type": "object",
    "required": [
     "localPart"
    ],
    "additionalProperties": false,
    "properties": {
     "localPart": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{0,39}$",
      "example": "orbit.help",
      "description": "The part before \"@\" (MailboxAddress, F-HLP-11.R04). The domain is the tenant's intake domain."
     }
    }
   },
   "HelpDeskMailboxListMeta": {
    "type": "object",
    "required": [
     "canManage",
     "max",
     "defaultLocalPart"
    ],
    "properties": {
     "canManage": {
      "type": "boolean",
      "description": "The reader holds `plan` on the project and can add an address or turn one on or off."
     },
     "max": {
      "type": "integer",
      "minimum": 1,
      "description": "The most addresses that one project can have (F-HLP-11.R04)."
     },
     "defaultLocalPart": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[a-z0-9][a-z0-9._-]{0,39}$",
      "example": "help-orb",
      "description": "The first free name of MailboxDefaultNamePolicy that the e-mail switch opens (F-HLP-11.R24). Null when the project has an address or the reader cannot manage the addresses."
     }
    }
   },
   "HelpDeskMailboxView": {
    "type": "object",
    "required": [
     "id",
     "address",
     "status",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "address": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "paused"
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "HelpDeskMergeDraft": {
    "type": "object",
    "required": [
     "ticketKey"
    ],
    "properties": {
     "ticketKey": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "copyFileIds": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "noteToTicket": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     },
     "teamMessage": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000
     }
    }
   },
   "HelpDeskMessageDraft": {
    "type": "object",
    "required": [
     "body"
    ],
    "properties": {
     "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000,
      "example": "It also happens on an iPad with Safari 19.1."
     },
     "fileIds": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "HelpDeskMessageView": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "authorName",
     "body",
     "postedAt",
     "createdBy"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "client",
       "team",
       "info_request",
       "internal_note"
      ],
      "description": "internal_note only in the internal view."
     },
     "authorName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Lena Ruiz",
      "description": "On a client read, \"Former member\" for an author who is removed, erased or not in the directory (XM-1094; register §229 item 17)."
     },
     "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "redacted": {
      "type": "boolean"
     },
     "files": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/HelpDeskFileView"
      }
     },
     "createdBy": {
      "$ref": "#/components/schemas/CreatorMemberId",
      "description": "The author's member id (F-HLP-03.R14; XM-924). In the portal, only the reading guest's own id when that guest wrote the message; null for every other message and in a preview. For an internal reader, the id of the member or guest who wrote it. For a connection, always null. Null for a message from a connection or from the system."
     }
    }
   },
   "HelpDeskProjectTemplate": {
    "type": "object",
    "description": "XM-1722 (F-PRJ-07.R11–R14; register §223 addendum 63): the help-desk template of the defaults for new projects.",
    "required": [
     "stages",
     "categories",
     "defaultView",
     "notifyClientWhenTicketDone",
     "serviceLevelsEnabled"
    ],
    "additionalProperties": false,
    "properties": {
     "stages": {
      "type": "array",
      "minItems": 2,
      "maxItems": 12,
      "description": "Every state key is in exactly one stage (R12).",
      "items": {
       "$ref": "#/components/schemas/HelpDeskStageTemplate"
      }
     },
     "categories": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/HelpDeskCategoryTemplate"
      }
     },
     "defaultView": {
      "type": "string",
      "enum": [
       "queue",
       "board"
      ]
     },
     "notifyClientWhenTicketDone": {
      "type": "boolean"
     },
     "serviceLevelsEnabled": {
      "type": "boolean",
      "description": "The start value of the project key helpdesk.serviceLevels.enabled."
     }
    }
   },
   "HelpDeskRejectDraft": {
    "type": "object",
    "required": [
     "reason"
    ],
    "properties": {
     "reason": {
      "$ref": "#/components/schemas/HelpDeskRejectionReason"
     },
     "clientMessage": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "example": "This change is outside the scope of the current contract. Please contact Lena Ruiz."
     }
    }
   },
   "HelpDeskRejectionReason": {
    "type": "string",
    "enum": [
     "out_of_scope",
     "not_reproducible",
     "duplicate_closed",
     "already_done",
     "spam",
     "other"
    ],
    "x-extensible-enum": true
   },
   "HelpDeskReporter": {
    "type": "object",
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Sam Lee"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "externalId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "orbit-desk-user-4471"
     }
    }
   },
   "HelpDeskRequestDraft": {
    "type": "object",
    "required": [
     "summary",
     "description"
    ],
    "properties": {
     "categoryKey": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$",
      "example": "website_bug"
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Checkout button does nothing on Safari"
     },
     "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000,
      "example": "Since this morning the checkout button on the product page does not respond on Safari 19."
     },
     "impact": {
      "$ref": "#/components/schemas/HelpDeskImpact"
     },
     "fields": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/HelpDeskFieldValue"
      }
     },
     "fileIds": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "followUpOf": {
      "$ref": "#/components/schemas/HelpDeskRequestKey"
     },
     "neededBy": {
      "description": "The client's \"Needed by\" day (F-HLP-02.R13; XM-981), optional; null or absent is no day. Not before today in the earliest zone (UTC−12; `help_desk.needed_by_past`) and at most 1,830 days after it (`help_desk.needed_by_too_far`).",
      "oneOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "HelpDeskRequestKey": {
    "type": "string",
    "pattern": "^[A-Z][A-Z0-9]{1,9}-R[1-9][0-9]{0,8}$",
    "example": "ORB-R17"
   },
   "HelpDeskRequestState": {
    "type": "string",
    "enum": [
     "submitted",
     "in_triage",
     "awaiting_information",
     "accepted",
     "merged",
     "rejected",
     "withdrawn",
     "closed"
    ]
   },
   "HelpDeskServiceLevelState": {
    "type": "string",
    "enum": [
     "none",
     "on_track",
     "at_risk",
     "breached",
     "met",
     "missed"
    ]
   },
   "HelpDeskServiceLevelView": {
    "type": "object",
    "required": [
     "state"
    ],
    "properties": {
     "state": {
      "$ref": "#/components/schemas/HelpDeskServiceLevelState"
     },
     "dueAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "metAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "paused": {
      "type": "boolean"
     }
    }
   },
   "HelpDeskStageStateKey": {
    "type": "string",
    "description": "The request states of help desk §3.2; accepted is split by the linked ticket (accepted_open, accepted_done).",
    "enum": [
     "submitted",
     "in_triage",
     "awaiting_information",
     "accepted_open",
     "accepted_done",
     "merged",
     "rejected",
     "withdrawn",
     "closed"
    ]
   },
   "HelpDeskStageTemplate": {
    "type": "object",
    "required": [
     "name",
     "clientName",
     "states"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "clientName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "states": {
      "type": "array",
      "minItems": 1,
      "maxItems": 9,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/HelpDeskStageStateKey"
      }
     }
    }
   },
   "HelpDeskTicketCandidate": {
    "type": "object",
    "required": [
     "key",
     "title"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "stageName": {
      "type": "string",
      "maxLength": 40
     }
    }
   },
   "HelpDeskTokenCreate": {
    "type": "object",
    "required": [
     "expiresInDays"
    ],
    "properties": {
     "expiresInDays": {
      "type": "integer",
      "enum": [
       30,
       90,
       180,
       365
      ]
     }
    }
   },
   "HelpDeskTokenIssued": {
    "type": "object",
    "required": [
     "token",
     "plainTextToken"
    ],
    "properties": {
     "token": {
      "$ref": "#/components/schemas/HelpDeskTokenView"
     },
     "plainTextToken": {
      "type": "string",
      "minLength": 20,
      "maxLength": 120,
      "description": "Shown once. Never stored in plain text."
     }
    }
   },
   "HelpDeskTokenView": {
    "type": "object",
    "required": [
     "id",
     "prefix",
     "createdAt",
     "expiresAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "prefix": {
      "type": "string",
      "maxLength": 24,
      "example": "kanso_hdt_0192f"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "overlapEndsAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastUsedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "HelpDeskTriageCounts": {
    "type": "object",
    "required": [
     "submitted",
     "inTriage",
     "awaitingInformation",
     "atRisk",
     "breached",
     "mine"
    ],
    "properties": {
     "submitted": {
      "type": "integer",
      "minimum": 0
     },
     "inTriage": {
      "type": "integer",
      "minimum": 0
     },
     "awaitingInformation": {
      "type": "integer",
      "minimum": 0
     },
     "atRisk": {
      "type": "integer",
      "minimum": 0
     },
     "breached": {
      "type": "integer",
      "minimum": 0
     },
     "mine": {
      "type": "integer",
      "minimum": 0
     },
     "unowned": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1280: the open requests without a triage owner."
     },
     "closed": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1280: the requests in a terminal state."
     },
     "open": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1280: submitted + in triage + awaiting information."
     },
     "capped": {
      "type": "boolean",
      "description": "True when a count reached 1,000."
     }
    }
   },
   "HelpDeskTriageLinkedTicket": {
    "type": "object",
    "description": "XM-1281: the linked ticket as the triager may see it; a field the triager's projection plan masks is absent; a ticket the triager cannot see is no card.",
    "required": [
     "key",
     "clientVisible"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "stageName": {
      "type": "string",
      "maxLength": 40
     },
     "stageKind": {
      "type": "string",
      "enum": [
       "todo",
       "progress",
       "review",
       "done"
      ]
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "clientVisible": {
      "type": "boolean"
     }
    }
   },
   "HelpDeskTriageListMeta": {
    "description": "listTriageRequests' meta (F-HLP-07): the keyset page, the filtered total and, on the first page only, the reader's layout, the project's view settings and the stages.",
    "allOf": [
     {
      "$ref": "#/components/schemas/CursorPageMeta"
     },
     {
      "type": "object",
      "required": [
       "total"
      ],
      "properties": {
       "total": {
        "description": "XM-1280: the filtered total, capped at 1,000 (`atLeast` when capped).",
        "type": "object",
        "required": [
         "count",
         "atLeast"
        ],
        "properties": {
         "count": {
          "type": "integer",
          "minimum": 0
         },
         "atLeast": {
          "type": "boolean"
         }
        }
       },
       "viewPreference": {
        "description": "XM-943 (owner, 23 Nov 2026: H5): page 1 only — the reader's display layout of the view `help_desk_queue` (F-WRK-41.R10); the project default is saved by a holder of `plan`.",
        "$ref": "#/components/schemas/ViewPreference"
       },
       "views": {
        "description": "H5 (owner, 23 Nov 2026): page 1 only — the project's `helpdesk.views.*` (how the Help desk pages open).",
        "type": "object",
        "required": [
         "defaultView",
         "boardGrouping",
         "queueOrder"
        ],
        "properties": {
         "defaultView": {
          "type": "string",
          "enum": [
           "queue",
           "board"
          ]
         },
         "boardGrouping": {
          "type": "string",
          "enum": [
           "stage",
           "owner",
           "impact"
          ]
         },
         "queueOrder": {
          "type": "string",
          "enum": [
           "due",
           "newest",
           "oldest"
          ]
         }
        }
       },
       "stages": {
        "description": "H5 (owner, 23 Nov 2026; `helpdesk.stages`): page 1 only — the eight fixed stages in the order of a request's life: the client status, the team's name (the state chip), the client's name and the request states that the stage shows.",
        "type": "array",
        "maxItems": 8,
        "items": {
         "type": "object",
         "required": [
          "status",
          "name",
          "clientName",
          "states"
         ],
         "properties": {
          "status": {
           "type": "string",
           "enum": [
            "received",
            "in_review",
            "waiting_for_you",
            "accepted",
            "done",
            "rejected",
            "withdrawn",
            "closed"
           ]
          },
          "name": {
           "type": "string",
           "maxLength": 40
          },
          "clientName": {
           "type": "string",
           "maxLength": 40
          },
          "states": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     }
    ]
   },
   "HelpDeskTriageOwnerChange": {
    "type": "object",
    "properties": {
     "memberId": {
      "description": "The new triage owner; null clears the owner. Absent means the caller claims the request.",
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "HelpDeskTriageRow": {
    "type": "object",
    "required": [
     "key",
     "summary",
     "state",
     "channel",
     "impact",
     "submittedAt",
     "organisationName",
     "firstResponse",
     "decision",
     "version"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/HelpDeskRequestKey"
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "state": {
      "$ref": "#/components/schemas/HelpDeskRequestState"
     },
     "channel": {
      "$ref": "#/components/schemas/HelpDeskChannel"
     },
     "impact": {
      "$ref": "#/components/schemas/HelpDeskImpact"
     },
     "categoryName": {
      "type": "string",
      "maxLength": 60
     },
     "organisationName": {
      "type": "string",
      "maxLength": 120,
      "example": "Orbit Retail"
     },
     "requesterName": {
      "type": "string",
      "maxLength": 120
     },
     "triageOwner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "submittedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastClientActivityAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "firstResponse": {
      "$ref": "#/components/schemas/HelpDeskServiceLevelView"
     },
     "decision": {
      "$ref": "#/components/schemas/HelpDeskServiceLevelView"
     },
     "decisionInProgress": {
      "type": "boolean"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "sourceName": {
      "type": "string",
      "maxLength": 120,
      "description": "XM-1280 (F-HLP-07.R04): the connection's name of an api request, the mailbox of an email request, the member who logged an internal request."
     },
     "messageCount": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1280: the request's messages, internal notes included."
     }
    }
   },
   "HelpDeskTriageServiceLevels": {
    "type": "object",
    "description": "XM-1006 (F-HLP-09; owner §223 add. 63): the open requests by the worse state of their clocks now, and the clocks that stopped in the window met or missed; each count capped at 1,000.",
    "required": [
     "onTrack",
     "atRisk",
     "breached",
     "paused",
     "met",
     "missed",
     "windowDays",
     "capped"
    ],
    "properties": {
     "onTrack": {
      "type": "integer",
      "minimum": 0
     },
     "atRisk": {
      "type": "integer",
      "minimum": 0
     },
     "breached": {
      "type": "integer",
      "minimum": 0
     },
     "paused": {
      "type": "integer",
      "minimum": 0
     },
     "met": {
      "type": "integer",
      "minimum": 0
     },
     "missed": {
      "type": "integer",
      "minimum": 0
     },
     "metShare": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "The window's met share in whole percent; absent when no clock stopped in the window."
     },
     "windowDays": {
      "type": "integer",
      "minimum": 1
     },
     "capped": {
      "type": "boolean"
     }
    }
   },
   "HelpDeskTriageView": {
    "allOf": [
     {
      "$ref": "#/components/schemas/HelpDeskTriageRow"
     },
     {
      "type": "object",
      "required": [
       "description",
       "messages",
       "files",
       "history",
       "can"
      ],
      "properties": {
       "id": {
        "type": "string",
        "format": "uuid",
        "description": "XM-980: the request's id — the team's upload target `help_desk_request` (a reply's or a note's files)."
       },
       "description": {
        "type": "string",
        "minLength": 1,
        "maxLength": 20000
       },
       "fields": {
        "type": "array",
        "maxItems": 20,
        "items": {
         "$ref": "#/components/schemas/HelpDeskFieldValue"
        }
       },
       "reporter": {
        "$ref": "#/components/schemas/HelpDeskReporter"
       },
       "connectionName": {
        "type": "string",
        "maxLength": 80
       },
       "externalReference": {
        "type": "string",
        "maxLength": 200
       },
       "linkedTicketKey": {
        "$ref": "#/components/schemas/TicketKey"
       },
       "linkedTicketVisible": {
        "type": "boolean"
       },
       "linkedTicket": {
        "$ref": "#/components/schemas/HelpDeskTriageLinkedTicket"
       },
       "progress": {
        "type": "string",
        "enum": [
         "open",
         "done"
        ],
        "description": "XM-1281 (help desk §3.2): an accepted or merged request's progress."
       },
       "followUpOf": {
        "$ref": "#/components/schemas/HelpDeskRequestKey"
       },
       "messagesTruncated": {
        "type": "boolean"
       },
       "historyTruncated": {
        "type": "boolean"
       },
       "rejectionReason": {
        "$ref": "#/components/schemas/HelpDeskRejectionReason"
       },
       "clientMessage": {
        "type": "string",
        "maxLength": 2000
       },
       "messages": {
        "type": "array",
        "maxItems": 200,
        "items": {
         "$ref": "#/components/schemas/HelpDeskMessageView"
        }
       },
       "files": {
        "type": "array",
        "maxItems": 10,
        "items": {
         "$ref": "#/components/schemas/HelpDeskFileView"
        }
       },
       "filesNotTaken": {
        "type": "array",
        "maxItems": 500,
        "description": "F-HLP-11.R12: the attachments of the request's mails that were not taken.",
        "items": {
         "$ref": "#/components/schemas/HelpDeskMailFileNotTaken"
        }
       },
       "duplicateCandidates": {
        "type": "array",
        "maxItems": 5,
        "items": {
         "$ref": "#/components/schemas/HelpDeskTicketCandidate"
        }
       },
       "history": {
        "type": "array",
        "maxItems": 200,
        "items": {
         "$ref": "#/components/schemas/HelpDeskHistoryEntry"
        }
       },
       "can": {
        "type": "object",
        "required": [
         "triage",
         "accept",
         "merge",
         "reject",
         "askForInformation",
         "shareWithClient"
        ],
        "properties": {
         "triage": {
          "type": "boolean"
         },
         "accept": {
          "type": "boolean"
         },
         "merge": {
          "type": "boolean"
         },
         "reject": {
          "type": "boolean"
         },
         "askForInformation": {
          "type": "boolean"
         },
         "shareWithClient": {
          "type": "boolean"
         }
        }
       }
      }
     }
    ]
   },
   "HelpDeskUploadRequest": {
    "type": "object",
    "required": [
     "target",
     "fileName",
     "sizeBytes",
     "mimeType"
    ],
    "additionalProperties": false,
    "properties": {
     "target": {
      "type": "object",
      "required": [
       "type"
      ],
      "additionalProperties": false,
      "properties": {
       "type": {
        "type": "string",
        "enum": [
         "request_draft",
         "request"
        ],
        "description": "request_draft for a new request of the connection's project; request for a reply on requestKey."
       },
       "requestKey": {
        "$ref": "#/components/schemas/HelpDeskRequestKey"
       }
      }
     },
     "fileName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "example": "receipt.pdf"
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000000,
      "example": 182044,
      "description": "At most the tenant's files.maxUploadBytes and the single-request bound of 100 MB (one presigned PUT; no multipart for a connection)."
     },
     "mimeType": {
      "type": "string",
      "maxLength": 127,
      "example": "application/pdf"
     },
     "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     }
    }
   },
   "HierarchySummary": {
    "type": "object",
    "required": [
     "ancestors",
     "childCount"
    ],
    "properties": {
     "parent": {
      "$ref": "#/components/schemas/ParentRef"
     },
     "ancestors": {
      "type": "array",
      "maxItems": 2,
      "description": "The parent first, then its parent. The list stops before the first ticket that the reader cannot view (SR-BF1-01).",
      "items": {
       "$ref": "#/components/schemas/ParentRef"
      }
     },
     "childCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The direct children that the reader can view. It is at most 5,000 †, except for an epic that the one-time epic move left above its bound (§3.15; SR-BF1-32)."
     },
     "truncated": {
      "type": "boolean",
      "description": "The roll-ups hold the figures of the first 10,000 † descendants only (F-WRK-31 §11)."
     },
     "childProgress": {
      "type": "object",
      "required": [
       "done",
       "total"
      ],
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": "integer",
        "minimum": 0
       },
       "percent": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100,
        "description": "Absent when no child counts."
       }
      }
     },
     "estimateRollup": {
      "type": "object",
      "description": "Absent when Estimate is masked.",
      "required": [
       "ownMinutes",
       "descendantMinutes",
       "unestimatedDescendants"
      ],
      "properties": {
       "ownMinutes": {
        "type": "integer",
        "minimum": 0
       },
       "descendantMinutes": {
        "type": "integer",
        "minimum": 0
       },
       "unestimatedDescendants": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "loggedRollup": {
      "type": "object",
      "description": "Absent when Time logged is masked.",
      "required": [
       "ownMinutes",
       "descendantMinutes"
      ],
      "properties": {
       "ownMinutes": {
        "type": "integer",
        "minimum": 0
       },
       "descendantMinutes": {
        "type": "integer",
        "minimum": 0
       }
      }
     }
    }
   },
   "HistoryShareConsequence": {
    "type": "object",
    "required": [
     "clientVersion",
     "targetPeriod",
     "messageCount",
     "fileCount",
     "sentence"
    ],
    "properties": {
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "targetPeriod": {
      "type": "integer",
      "minimum": 2
     },
     "messageCount": {
      "type": "integer",
      "minimum": 1
     },
     "fileCount": {
      "type": "integer",
      "minimum": 0
     },
     "sentence": {
      "type": "string",
      "maxLength": 300,
      "example": "Clients of Lumen Co will see 14 messages and 3 files from the conversation with Orbit Retail."
     }
    }
   },
   "HistoryShareRequest": {
    "type": "object",
    "required": [
     "fromPeriod",
     "messageIds",
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "fromPeriod": {
      "type": "integer",
      "minimum": 1
     },
     "messageIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 500,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "HistoryShareResult": {
    "type": "object",
    "required": [
     "shareId",
     "targetPeriod",
     "messageCount",
     "fileCount"
    ],
    "properties": {
     "shareId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "targetPeriod": {
      "type": "integer",
      "minimum": 2
     },
     "messageCount": {
      "type": "integer",
      "minimum": 1
     },
     "fileCount": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "HourlyRate": {
    "type": "object",
    "description": "A non-negative hourly amount in one enabled currency; the amount is a decimal string.",
    "required": [
     "amount",
     "currency"
    ],
    "properties": {
     "amount": {
      "type": "string",
      "pattern": "^[0-9]{1,7}(\\.[0-9]{1,4})?$",
      "example": "45.00"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     }
    }
   },
   "IanaTimeZone": {
    "type": "string",
    "minLength": 1,
    "maxLength": 64,
    "pattern": "^[A-Za-z0-9_+-]+(/[A-Za-z0-9_+-]+){0,2}$",
    "example": "Europe/Vilnius"
   },
   "ImpersonationAccountWriteProblem": {
    "description": "The problem `403 impersonation.blocked_surface` with `surface` `account` (F-PLT-22.R08, R10; XM-1488). During an impersonation, a request that carries a member which changes the account in every tenant of the user is refused as a whole. Nothing of the request is written. It has the members of Problem and two extensions, `surface` and `fields`. No other member is permitted.",
    "allOf": [
     {
      "$ref": "#/components/schemas/Problem"
     },
     {
      "type": "object",
      "required": [
       "surface",
       "fields"
      ],
      "properties": {
       "code": {
        "type": "string",
        "enum": [
         "impersonation.blocked_surface"
        ]
       },
       "surface": {
        "type": "string",
        "enum": [
         "account"
        ]
       },
       "fields": {
        "type": "array",
        "minItems": 1,
        "maxItems": 16,
        "description": "The account-wide members of the request, one item for each member, in the order of the request. The pointer `\"\"` names the whole document: the request has no member, and the operation is account-wide as a whole. Show which settings are closed during an impersonation; do not parse the `detail` text.",
        "items": {
         "type": "object",
         "required": [
          "pointer"
         ],
         "properties": {
          "pointer": {
           "type": "string",
           "description": "The JSON Pointer (RFC 6901) of the member in the request body."
          }
         },
         "additionalProperties": false
        },
        "example": [
         {
          "pointer": "/name"
         },
         {
          "pointer": "/timeZone"
         }
        ]
       }
      }
     }
    ],
    "unevaluatedProperties": false
   },
   "ImpersonationEntryInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "token"
    ],
    "properties": {
     "token": {
      "type": "string",
      "minLength": 43,
      "maxLength": 64,
      "description": "The one-time entry token of the start (60 seconds, one use)."
     }
    }
   },
   "ImpersonationMode": {
    "type": "string",
    "enum": [
     "read_write",
     "read_only"
    ]
   },
   "ImpersonationState": {
    "type": "object",
    "description": "The console Owner's active impersonation (F-PLT-22) — the banner's state.",
    "additionalProperties": false,
    "required": [
     "id",
     "mode",
     "tenant",
     "operator",
     "subject",
     "startedAt",
     "expiresAt",
     "secondsLeft"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "mode": {
      "$ref": "#/components/schemas/ImpersonationMode"
     },
     "tenant": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "id",
       "slug",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "slug": {
        "type": "string",
        "maxLength": 63,
        "example": "northwind"
       },
       "name": {
        "type": "string",
        "maxLength": 120,
        "example": "Northwind Group"
       }
      }
     },
     "operator": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "$ref": "#/components/schemas/PersonName"
       }
      }
     },
     "subject": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "memberId",
       "displayName",
       "initials",
       "roleLabel",
       "audience"
      ],
      "properties": {
       "memberId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "displayName": {
        "$ref": "#/components/schemas/PersonName"
       },
       "initials": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2
       },
       "roleLabel": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
       },
       "audience": {
        "type": "string",
        "enum": [
         "internal",
         "client"
        ]
       }
      }
     },
     "startedAt": {
      "type": "string",
      "format": "date-time"
     },
     "expiresAt": {
      "type": "string",
      "format": "date-time"
     },
     "secondsLeft": {
      "type": "integer",
      "minimum": 0,
      "maximum": 14400
     }
    }
   },
   "InboundCallView": {
    "type": "object",
    "required": [
     "id",
     "webhookId",
     "receivedAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "webhookId": {
      "type": "string",
      "maxLength": 200
     },
     "receivedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "bodyAvailable": {
      "type": "boolean"
     },
     "runsStarted": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "InboundEndpointInput": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "availableToProjectRules": {
      "type": "boolean"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "paused",
       "disabled"
      ]
     },
     "allowedRanges": {
      "type": "array",
      "maxItems": 20,
      "description": "F-AUT-22.R09: each item is a CIDR text, or a {cidr, note} item (the design's label of the range; the note is at most 80 characters).",
      "items": {
       "oneOf": [
        {
         "type": "string",
         "maxLength": 43
        },
        {
         "type": "object",
         "required": [
          "cidr"
         ],
         "additionalProperties": false,
         "properties": {
          "cidr": {
           "type": "string",
           "maxLength": 43
          },
          "note": {
           "type": "string",
           "maxLength": 80
          }
         }
        }
       ]
      }
     },
     "endPreviousSecret": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "A14-06: the previous secret of a rotation stops verifying now, not after its 24 hours (Admins only; audited)."
     }
    }
   },
   "InboundEndpointSecretView": {
    "type": "object",
    "required": [
     "endpoint",
     "secret"
    ],
    "description": "The only answers that carry the secret (create and rotate); never readable again.",
    "properties": {
     "endpoint": {
      "$ref": "#/components/schemas/InboundEndpointView"
     },
     "secret": {
      "type": "string",
      "pattern": "^whsec_[A-Za-z0-9+/=]{43,64}$"
     },
     "previousValidUntil": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "InboundEndpointView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "url",
     "status",
     "availableToProjectRules",
     "usedByFlows",
     "createdAt",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "Order system"
     },
     "url": {
      "type": "string",
      "maxLength": 300,
      "description": "The address that the outside system calls."
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "paused",
       "disabled"
      ]
     },
     "availableToProjectRules": {
      "type": "boolean"
     },
     "allowedRanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 43
      }
     },
     "secretRotatingUntil": {
      "$ref": "#/components/schemas/Instant"
     },
     "verificationFailures": {
      "type": "integer",
      "minimum": 0
     },
     "refusedCalls": {
      "type": "integer",
      "minimum": 0,
      "description": "Calls with a known id: a repeat or a conflict. Written at most once per minute."
     },
     "usedByFlows": {
      "type": "integer",
      "minimum": 0
     },
     "lastCallAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "InstanceUrl": {
    "type": "string",
    "maxLength": 2048,
    "pattern": "^https://",
    "example": "https://git.northwind.example"
   },
   "Instant": {
    "type": "string",
    "format": "date-time",
    "example": "2026-10-20T13:10:00Z"
   },
   "InterviewNotePage": {
    "type": "object",
    "required": [
     "items"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/InterviewNoteView"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "InterviewNotePatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     },
     "participant": {
      "type": [
       "string",
       "null"
      ],
      "minLength": 1,
      "maxLength": 120
     },
     "interviewedOn": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     }
    }
   },
   "InterviewNoteRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "summary"
    ],
    "properties": {
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     },
     "participant": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "interviewedOn": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "InterviewNoteView": {
    "type": "object",
    "required": [
     "id",
     "summary",
     "author",
     "createdAt",
     "canEdit",
     "canRemove"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     },
     "participant": {
      "type": "string",
      "maxLength": 120,
      "example": "Store operations lead, Orbit Retail"
     },
     "interviewedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "author": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "canEdit": {
      "type": "boolean",
      "description": "The author, while holding discovery_contribute."
     },
     "canRemove": {
      "type": "boolean",
      "description": "The author with discovery_contribute, or a member with discovery_manage."
     },
     "canReply": {
      "type": "boolean",
      "description": "discovery_contribute (F-DSC-05.R12; XM-1786)."
     },
     "canReact": {
      "type": "boolean",
      "description": "discovery_contribute (F-DSC-05.R14; XM-1786)."
     },
     "canResolve": {
      "type": "boolean",
      "description": "The author with discovery_contribute, or a member with discovery_manage (F-DSC-05.R16; XM-1786)."
     },
     "replyCount": {
      "type": "integer",
      "minimum": 0,
      "description": "All the replies of the note (F-DSC-05.R13)."
     },
     "replies": {
      "type": "array",
      "maxItems": 10,
      "description": "The first replies, oldest first; listInterviewNoteReplies gives all of them (F-DSC-05.R13).",
      "items": {
       "$ref": "#/components/schemas/InterviewReplyView"
      }
     },
     "reactions": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ReactionSummaryView"
      }
     },
     "resolvedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "resolvedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "InterviewReplyList": {
    "type": "object",
    "required": [
     "items"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 100,
      "description": "All the replies of the note, oldest first (F-DSC-05.R13).",
      "items": {
       "$ref": "#/components/schemas/InterviewReplyView"
      }
     }
    }
   },
   "InterviewReplyRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "body"
    ],
    "description": "A reply to an interview note (F-DSC-05.R12; XM-1786): plain text, never markup.",
    "properties": {
     "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     }
    }
   },
   "InterviewReplyView": {
    "type": "object",
    "description": "A reply to an interview note, one level (F-DSC-05.R12, R14; XM-1786).",
    "required": [
     "id",
     "noteId",
     "body",
     "author",
     "createdAt",
     "canEdit",
     "canRemove",
     "canReact",
     "reactions"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "noteId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     },
     "author": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "canEdit": {
      "type": "boolean",
      "description": "The author, while holding discovery_contribute."
     },
     "canRemove": {
      "type": "boolean",
      "description": "The author with discovery_contribute, or a member with discovery_manage."
     },
     "canReact": {
      "type": "boolean",
      "description": "discovery_contribute."
     },
     "reactions": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ReactionSummaryView"
      }
     }
    }
   },
   "InvitationAcceptRequest": {
    "type": "object",
    "required": [
     "method"
    ],
    "additionalProperties": false,
    "properties": {
     "token": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true,
      "description": "Required with password and session; absent with provider — the attempt at pending_name already holds the invitation (by its token hash, bound to this browser), so the name step can finish on /sign-in/continue after the provider's callback (F-TEN-08.R17; CG-08). A token sent with provider must name the attempt's invitation, else 401 auth.attempt_expired and the attempt ends."
     },
     "method": {
      "type": "string",
      "enum": [
       "password",
       "session",
       "provider"
      ],
      "description": "password creates the account or verifies the existing one; session accepts for the signed-in invited account; provider completes a Google, Microsoft or SAML acceptance whose attempt stopped at pending_name (F-TEN-08.R17). Google, Microsoft and SAML start through their own operations with intent invitation."
     },
     "password": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128,
      "writeOnly": true
     },
     "name": {
      "description": "\"Your name\" — required with password when no account exists for the invited e-mail, and with provider (F-TEN-08.R07, R17).",
      "allOf": [
       {
        "$ref": "#/components/schemas/PersonName"
       }
      ]
     }
    }
   },
   "InvitationAddressDetail": {
    "type": "string",
    "description": "The reason of an address's status (F-TEN-07.R03, R18). For invalid — address_malformed (R02), not_permitted (an open invitation of the address the actor can see but may not resend, F-TEN-09.R07), address_unavailable (an open invitation the actor cannot see — the neutral refusal that discloses nothing, INV-TEN-02), grants_outdated (an open invitation whose role or project no longer exists or is archived, F-TEN-09.R04). For a skip — the skip itself.",
    "enum": [
     "invitation.address_malformed",
     "invitation.not_permitted",
     "invitation.address_unavailable",
     "invitation.grants_outdated",
     "skipped_member",
     "skipped_duplicate",
     "skipped_recently_sent",
     "skipped_resend_limit"
    ]
   },
   "InvitationAddressValidation": {
    "type": "object",
    "required": [
     "input",
     "status"
    ],
    "properties": {
     "input": {
      "type": "string",
      "maxLength": 320
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "status": {
      "type": "string",
      "description": "invalid blocks the whole batch (F-TEN-07.R04) and always carries a detail; a refusal the actor cannot act on is invalid, never a new status (F-TEN-07.R18).",
      "enum": [
       "will_invite",
       "will_grant",
       "will_resend",
       "skipped_member",
       "skipped_duplicate",
       "skipped_recently_sent",
       "skipped_resend_limit",
       "invalid"
      ]
     },
     "grantedProjects": {
      "type": "array",
      "maxItems": 50,
      "description": "For will_grant, the batch's projects the client guest does not yet hold — the only grants of the invitation (F-TEN-07.R17).",
      "items": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     "existingRole": {
      "description": "For will_grant, the client guest's current role, which acceptance keeps (\"keeps their role Client\", F-TEN-07.R17; CG-10).",
      "allOf": [
       {
        "$ref": "#/components/schemas/RoleRef"
       }
      ]
     },
     "invitationId": {
      "description": "The existing invitation for will_resend, skipped_recently_sent, skipped_resend_limit and not_permitted; never for address_unavailable.",
      "allOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       }
      ]
     },
     "detail": {
      "$ref": "#/components/schemas/InvitationAddressDetail"
     }
    }
   },
   "InvitationBatchRequest": {
    "type": "object",
    "required": [
     "addressText",
     "roleId",
     "projects",
     "requireTwoFactor"
    ],
    "additionalProperties": false,
    "properties": {
     "addressText": {
      "type": "string",
      "minLength": 1,
      "maxLength": 16384,
      "description": "Raw input; split on commas, semicolons, whitespace and newlines (D-059); at most 50 addresses.",
      "example": "ana.k@orbitretail.com, p.ortiz@orbitretail.com"
     },
     "roleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "teamId": {
      "description": "Internal audience and administer holders only; null or absent for none.",
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "projects": {
      "type": "array",
      "maxItems": 50,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/InvitationProjectRef"
      }
     },
     "requireTwoFactor": {
      "type": "boolean"
     }
    }
   },
   "InvitationBatchResult": {
    "type": "object",
    "required": [
     "batchId",
     "invited",
     "resent",
     "skipped"
    ],
    "properties": {
     "batchId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "invited": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/PendingInvitationRow"
      }
     },
     "resent": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/PendingInvitationRow"
      }
     },
     "skipped": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/InvitationAddressValidation"
      }
     }
    }
   },
   "InvitationBatchValidation": {
    "type": "object",
    "required": [
     "addresses",
     "summary",
     "seats"
    ],
    "properties": {
     "addresses": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/InvitationAddressValidation"
      }
     },
     "summary": {
      "type": "object",
      "required": [
       "invite",
       "resend",
       "skipped",
       "invalid"
      ],
      "properties": {
       "invite": {
        "type": "integer",
        "minimum": 0
       },
       "resend": {
        "type": "integer",
        "minimum": 0
       },
       "skipped": {
        "type": "integer",
        "minimum": 0
       },
       "invalid": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "seats": {
      "$ref": "#/components/schemas/SeatUsage"
     },
     "sendable": {
      "type": "boolean",
      "description": "True when no address is invalid and at least one would be invited or resent."
     }
    }
   },
   "InvitationLandingView": {
    "type": "object",
    "required": [
     "tenantName",
     "teamMask",
     "inviter",
     "invitedOn",
     "expiresAt",
     "audience",
     "role",
     "projects",
     "methods",
     "accountExists",
     "invitedEmailMasked",
     "passwordMinLength",
     "twoFactorRequired",
     "firstAdmin"
    ],
    "properties": {
     "tenantName": {
      "type": "string"
     },
     "teamMask": {
      "$ref": "#/components/schemas/ClientTeamLabel"
     },
     "inviter": {
      "type": "object",
      "required": [
       "displayName",
       "initials"
      ],
      "description": "The inviting member's name and initials; for an operator or system inviter (tenant provisioning's first Admin) \"the Youniton team\" and \"Y\" — never an operator's name (F-TEN-08.R03).",
      "properties": {
       "displayName": {
        "$ref": "#/components/schemas/PersonName"
       },
       "initials": {
        "type": "string",
        "maxLength": 2
       }
      }
     },
     "invitedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "role": {
      "type": "object",
      "required": [
       "name"
      ],
      "properties": {
       "name": {
        "type": "string"
       }
      }
     },
     "team": {
      "type": "object",
      "properties": {
       "name": {
        "type": "string"
       }
      }
     },
     "projects": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "name"
       ],
       "properties": {
        "name": {
         "type": "string"
        }
       }
      }
     },
     "clientOrganisation": {
      "type": "object",
      "properties": {
       "name": {
        "type": "string"
       }
      }
     },
     "methods": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "enum": [
        "password",
        "google",
        "microsoft",
        "saml"
       ]
      }
     },
     "accountExists": {
      "type": "boolean"
     },
     "invitedEmailMasked": {
      "type": "string",
      "example": "d…@orbitretail.com"
     },
     "passwordMinLength": {
      "type": "integer",
      "minimum": 12,
      "maximum": 128
     },
     "twoFactorRequired": {
      "type": "boolean"
     },
     "firstAdmin": {
      "type": "boolean",
      "description": "True for the first-admin invitation of tenant provisioning (the inviter is an operator, D-117). The screen then lists the automation that the acceptance turns on (CFL-809, F-AUT-09 §13)."
     }
    }
   },
   "InvitationLookupRequest": {
    "type": "object",
    "required": [
     "token"
    ],
    "additionalProperties": false,
    "properties": {
     "token": {
      "type": "string",
      "minLength": 43,
      "maxLength": 43,
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "description": "The invitation token read from /invite/{token}; never placed in an API URL (06 §8.2)."
     }
    }
   },
   "InvitationOptions": {
    "type": "object",
    "required": [
     "grantableRoles",
     "canAssignTeam",
     "expiryDays",
     "maxAddresses",
     "maxProjects",
     "seats",
     "twoFactorPolicy"
    ],
    "properties": {
     "grantableRoles": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "id",
        "name",
        "description",
        "audience",
        "isAdmin",
        "twoFactorRequiredByPolicy"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "name": {
         "type": "string"
        },
        "description": {
         "type": "string",
         "minLength": 1,
         "maxLength": 200,
         "description": "The role's description (F-ACC-01.R16; XM-994)."
        },
        "audience": {
         "type": "string",
         "enum": [
          "internal",
          "client"
         ]
        },
        "isAdmin": {
         "type": "boolean"
        },
        "twoFactorRequiredByPolicy": {
         "type": "boolean"
        }
       }
      }
     },
     "canAssignTeam": {
      "type": "boolean"
     },
     "teams": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/NamedRef"
      }
     },
     "expiryDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 30
     },
     "maxAddresses": {
      "type": "integer",
      "enum": [
       50
      ]
     },
     "maxProjects": {
      "type": "integer",
      "minimum": 1
     },
     "seats": {
      "$ref": "#/components/schemas/SeatUsage"
     },
     "twoFactorPolicy": {
      "type": "string",
      "enum": [
       "everyone",
       "admins",
       "optional"
      ]
     },
     "clientPortalAvailable": {
      "type": "boolean",
      "description": "False when the plan does not include the client portal (D-034); client roles are then not offered."
     },
     "emailDomain": {
      "description": "XM-993 (F-TEN-07.R20) — the tenant's primary e-mail domain, for the invite dialog's hint (\"@northwind.com\"); null when unknown.",
      "type": [
       "string",
       "null"
      ],
      "maxLength": 253
     }
    }
   },
   "InvitationProjectCandidate": {
    "type": "object",
    "required": [
     "id",
     "key",
     "name",
     "eligible"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string"
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "eligible": {
      "type": "boolean"
     },
     "ineligibleReason": {
      "type": "string",
      "enum": [
       "no_client_organisation",
       "portal_unavailable",
       "archived",
       "not_sharing_manager"
      ]
     }
    }
   },
   "InvitationProjectRef": {
    "type": "object",
    "required": [
     "projectKey"
    ],
    "additionalProperties": false,
    "description": "A project named by Projects' published key (projects §10 `ProjectKey`, the published language of `ProjectDirectoryQuery`); Tenancy resolves it to a `ProjectId` with `ProjectDirectoryQuery::manyByKey` and stores only the id (P2 round 2).",
    "properties": {
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "InvoiceAddRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "number",
     "clientId",
     "net",
     "vatPercent",
     "dueOn"
    ],
    "description": "A new open invoice (R16). net is the amount without VAT in EUR.",
    "properties": {
     "number": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "clientId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "net": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,7})(\\.[0-9]{1,2})?$",
      "description": "EUR above 0 and at most 10000000."
     },
     "vatPercent": {
      "$ref": "#/components/schemas/VatPercentText"
     },
     "dueOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "issuedOn": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "type": "null"
       }
      ]
     },
     "projectId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ],
      "minLength": 1,
      "maxLength": 500
     }
    }
   },
   "InvoiceClientRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string"
     }
    }
   },
   "InvoicePaidRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "The paid date; today in the accounting time zone when it is not given (R17).",
    "properties": {
     "paidOn": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "InvoiceProjectRef": {
    "type": "object",
    "required": [
     "id",
     "key",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "type": "string"
     },
     "name": {
      "type": "string"
     }
    }
   },
   "InvoiceStatus": {
    "type": "string",
    "enum": [
     "open",
     "paid",
     "overdue"
    ],
    "description": "open and paid are stored (the paid date); overdue is an open invoice with a due date before today (R17)."
   },
   "InvoiceView": {
    "type": "object",
    "required": [
     "id",
     "number",
     "client",
     "total",
     "net",
     "vatPercent",
     "vat",
     "dueOn",
     "issuedOn",
     "paidOn",
     "status",
     "project",
     "note"
    ],
    "description": "One invoice of the simple list (R16, R17). The list shows one amount, the total; the dialog also shows net (the amount without VAT), vatPercent and vat (half up to the cent). Every amount is EUR.",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "number": {
      "type": "string"
     },
     "client": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/InvoiceClientRef"
       },
       {
        "type": "null"
       }
      ],
      "description": "Null when the caller cannot see the client."
     },
     "total": {
      "$ref": "#/components/schemas/Money"
     },
     "net": {
      "$ref": "#/components/schemas/Money"
     },
     "vatPercent": {
      "$ref": "#/components/schemas/VatPercentText"
     },
     "vat": {
      "$ref": "#/components/schemas/Money"
     },
     "dueOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "issuedOn": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "type": "null"
       }
      ]
     },
     "paidOn": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       },
       {
        "type": "null"
       }
      ],
      "description": "Null while the invoice is open."
     },
     "status": {
      "$ref": "#/components/schemas/InvoiceStatus"
     },
     "project": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/InvoiceProjectRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "InvoicesView": {
    "type": "object",
    "required": [
     "invoices",
     "vatRates",
     "can"
    ],
    "properties": {
     "invoices": {
      "type": "array",
      "maxItems": 20000,
      "items": {
       "$ref": "#/components/schemas/InvoiceView"
      }
     },
     "vatRates": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "description": "The VAT rates that the invoice dialog offers (setting finance.invoices.vatRates).",
      "items": {
       "$ref": "#/components/schemas/VatPercentText"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "change"
      ],
      "properties": {
       "change": {
        "type": "boolean",
        "description": "The caller may add invoices and mark them as paid or open."
       }
      }
     }
    }
   },
   "ItemAccessView": {
    "type": "object",
    "required": [
     "segment",
     "visibility",
     "audienceLabel"
    ],
    "description": "The access classification of an item (F-MEM-13.R01) — the one place that says who can read it.",
    "properties": {
     "segment": {
      "$ref": "#/components/schemas/MemorySegmentRef"
     },
     "visibility": {
      "$ref": "#/components/schemas/KnowledgeVisibility"
     },
     "audienceLabel": {
      "type": "string",
      "maxLength": 200,
      "example": "Sales · 2 roles, 1 team, 3 people"
     },
     "sharedWithClient": {
      "type": "string",
      "maxLength": 120,
      "description": "The client organisation's name when the item is shared."
     }
    }
   },
   "ItemSegmentRequest": {
    "type": "object",
    "required": [
     "segment"
    ],
    "properties": {
     "segment": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     }
    }
   },
   "JiraImportDryRunInput": {
    "type": "object",
    "required": [
     "fileId",
     "mapping"
    ],
    "additionalProperties": false,
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "attachmentsFileId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "Optional (XM-112). A ZIP of Jira's attachment files, named by attachment id, uploaded like the CSV (import_source for import(id)). The import finds each Attachment cell's file in it; nothing is fetched from Jira. XM-1241: when the export names one or more attachment ids and the archive holds none of them, 422 integration.import_file_invalid (reason layout) at /attachmentsFileId."
     },
     "mapping": {
      "type": "object",
      "required": [
       "statuses"
      ],
      "additionalProperties": false,
      "properties": {
       "statuses": {
        "type": "object",
        "description": "Jira status name → stage id of the target project; unmapped statuses go to the first stage of kind todo.",
        "maxProperties": 100,
        "additionalProperties": {
         "$ref": "#/components/schemas/Uuid"
        }
       },
       "datePattern": {
        "type": "string",
        "maxLength": 40,
        "example": "dd/MMM/yy h:mm a"
       },
       "customFields": {
        "type": "object",
        "description": "Jira column header → {fieldId} of a compatible library field or {create {name, type}} (F-WRK-29). A create entry makes (or finds, by name and type) a library field through Projects' CreateImportField and adds it to the project's field set before the dry run is queued (XM-112); a select type takes the column's distinct values (at most 200) as options.",
        "maxProperties": 50,
        "additionalProperties": {
         "type": "object",
         "additionalProperties": false,
         "properties": {
          "fieldId": {
           "$ref": "#/components/schemas/Uuid"
          },
          "create": {
           "type": "object",
           "required": [
            "name",
            "type"
           ],
           "properties": {
            "name": {
             "type": "string",
             "minLength": 1,
             "maxLength": 80
            },
            "type": {
             "type": "string",
             "maxLength": 30,
             "enum": [
              "short_text",
              "long_text",
              "number",
              "date",
              "single_select",
              "multi_select",
              "member",
              "url",
              "checkbox"
             ]
            }
           }
          }
         }
        }
       },
       "addMissingOptions": {
        "type": "boolean",
        "default": false
       },
       "links": {
        "type": "object",
        "description": "F-INT-09.R12: each Jira link type of the Inward issue link (…) and Outward issue link (…) columns → a relation kind of the tenant ({kind}) or skip ({skip: true}). An unmapped link type is skipped (import.link_skipped, reason import.link_type_skipped). The proposals of the mapping step: Blocks → blocks, Duplicate → duplicates, Relates → relates_to, Cloners → clones.",
        "maxProperties": 50,
        "additionalProperties": {
         "type": "object",
         "additionalProperties": false,
         "properties": {
          "kind": {
           "type": "string",
           "pattern": "^[a-z][a-z0-9_]{1,29}$"
          },
          "skip": {
           "type": "boolean",
           "enum": [
            true
           ]
          }
         }
        }
       },
       "types": {
        "type": "object",
        "description": "F-INT-09.R12, F-WRK-30.R13: each Jira Issue Type → a project type key. Work decides the key when it creates the row: a key that the project lacks or an archived type gives the default type and a report line. An unmapped Issue Type imports with the default type (import.type_unmapped). A type of the level subtask waits for the row's parent (F-WRK-31.R14).",
        "maxProperties": 50,
        "additionalProperties": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,29}$"
        }
       },
       "source": {
        "type": [
         "string",
         "null"
        ],
        "enum": [
         "jira_csv",
         "jira_rest_export",
         null
        ],
        "description": "F-INT-09.R14 (XM-1387): the format the Admin chose in the Format choice. Absent or null: the source is detected by the upload's shape. A format whose adapter does not recognise the upload answers 422 integration.import_file_invalid (reason source_mismatch, candidates)."
       },
       "unmatchedPeopleTo": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/Uuid"
         },
         {
          "type": "null"
         }
        ],
        "description": "F-INT-09.R14 (XM-1387; owner 16 November 2026): the member that gets the work of each unmatched person. Absent or null: the importing Admin."
       },
       "sourceTimeZone": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/IanaTimeZone"
         },
         {
          "type": "null"
         }
        ],
        "description": "F-INT-09.R04, R14 (XM-1387): the zone of the export's zone-less dates and times, for every source. Absent or null: the tenant's accounting zone. The page proposes the zone the profile detected (source.timeZone)."
       }
      }
     }
    }
   },
   "JiraImportRunInput": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "attachments": {
      "type": "object",
      "required": [
       "site",
       "email",
       "apiToken"
      ],
      "additionalProperties": false,
      "description": "Never taken (XM-112; CFL-813) — a run that names it answers 422 integration.import_attachments_unavailable and holds no credential. The attachments come from the archive the dry run checked (attachmentsFileId).",
      "properties": {
       "site": {
        "type": "string",
        "maxLength": 2048,
        "pattern": "^https://",
        "example": "https://northwind.atlassian.net"
       },
       "email": {
        "$ref": "#/components/schemas/EmailAddress"
       },
       "apiToken": {
        "type": "string",
        "minLength": 8,
        "maxLength": 512,
        "writeOnly": true
       }
      }
     }
    }
   },
   "JiraImportSourceProfile": {
    "type": "object",
    "required": [
     "fileId",
     "rows",
     "statuses",
     "unlistedStatuses",
     "customColumns",
     "unlistedColumns"
    ],
    "description": "F-INT-09.R13 (XM-1080): the profile of an uploaded Jira export for the mapping step. Values are the file's text as data (never evaluated).",
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "rows": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
     },
     "statuses": {
      "type": "array",
      "maxItems": 100,
      "description": "The distinct Status values (case-insensitive) in the order of the file.",
      "items": {
       "type": "string",
       "minLength": 1,
       "maxLength": 120
      }
     },
     "unlistedStatuses": {
      "type": "integer",
      "minimum": 0,
      "description": "The distinct Status values that are not listed: past the first 100, or longer than 120 characters. Their rows go to the first stage of kind todo."
     },
     "customColumns": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "type": "object",
       "required": [
        "column",
        "compatible",
        "newOptions"
       ],
       "properties": {
        "column": {
         "type": "string",
         "maxLength": 120,
         "example": "Custom field (Region)"
        },
        "compatible": {
         "type": "array",
         "maxItems": 9,
         "description": "The library field types that take every non-empty cell, most specific first.",
         "items": {
          "type": "string",
          "enum": [
           "number",
           "date",
           "checkbox",
           "url",
           "member",
           "single_select",
           "multi_select",
           "short_text",
           "long_text"
          ]
         }
        },
        "newOptions": {
         "type": "array",
         "maxItems": 200,
         "description": "The select values that the project's field of the column's name (fieldId) does not have yet; empty without such a select field.",
         "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 60
         }
        },
        "fieldId": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      }
     },
     "unlistedColumns": {
      "type": "integer",
      "minimum": 0,
      "description": "The Custom field (…) headers that are not listed: a header longer than 120 characters (the mapping cannot name it), or a later spelling of a listed field name (one column for each field name, compared case-insensitively)."
     },
     "source": {
      "type": "object",
      "required": [
       "kind",
       "issues",
       "comments",
       "attachments",
       "worklogs",
       "timeZone"
      ],
      "additionalProperties": false,
      "description": "F-INT-09.R14 (XM-1387; owner 16 November 2026): the source that read the upload and what it holds, counted on the profile's one parse — the page's detected-source line.",
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "jira_csv",
         "jira_rest_export"
        ]
       },
       "issues": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000
       },
       "comments": {
        "type": "integer",
        "minimum": 0
       },
       "attachments": {
        "type": "integer",
        "minimum": 0
       },
       "worklogs": {
        "type": "integer",
        "minimum": 0
       },
       "timeZone": {
        "oneOf": [
         {
          "$ref": "#/components/schemas/IanaTimeZone"
         },
         {
          "type": "null"
         }
        ],
        "description": "The zone the source names for its times (a REST export: its users' most frequent profile zone); null when the source names none. The Map step proposes it as mapping.sourceTimeZone, else the tenant's accounting zone."
       }
      }
     }
    }
   },
   "JiraImportView": {
    "type": "object",
    "required": [
     "id",
     "project",
     "state",
     "progress",
     "counts",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "project": {
      "type": "object",
      "required": [
       "key"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/ProjectKey"
       }
      }
     },
     "state": {
      "type": "string",
      "enum": [
       "draft",
       "dry_run_queued",
       "dry_run_running",
       "dry_run_done",
       "dry_run_failed",
       "queued",
       "running",
       "succeeded",
       "failed",
       "cancelled"
      ]
     },
     "cancelReason": {
      "type": "string",
      "enum": [
       "requested",
       "flag_off",
       "expired"
      ],
      "description": "expired: a draft or a checked import not run within 30 days of its last step (F-INT-09 §12)"
     },
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "attachmentsFileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "counts": {
      "type": "object",
      "required": [
       "rows",
       "created",
       "skipped",
       "failed",
       "attachments",
       "timeEntries",
       "timeEntriesSkipped"
      ],
      "properties": {
       "rows": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000
       },
       "created": {
        "type": "integer",
        "minimum": 0
       },
       "skipped": {
        "type": "integer",
        "minimum": 0
       },
       "failed": {
        "type": "integer",
        "minimum": 0
       },
       "attachments": {
        "type": "integer",
        "minimum": 0,
        "description": "XM-1241 (JIRA-IMPORT-ARCHIVE-TALLY): attachments stored by the run (each batch adds the files it stored); 0 after a dry run. Not the export's named count (tally.attachments)."
       },
       "timeEntries": {
        "type": "integer",
        "minimum": 0,
        "description": "XM-1387 (F-INT-09.R15): after a dry run, the work logs that the import would send to Time (the logs of the rows ready); during and after a run, the time entries that Time wrote. 0 for a source without work logs."
       },
       "timeEntriesSkipped": {
        "type": "integer",
        "minimum": 0,
        "description": "XM-1387 (F-INT-09.R15): the work logs that do not become a time entry — the logs of a refused row, a log that Time refused, a log that the source refused (each has its report line in the column Worklog, except a refused row's logs)."
       }
      }
     },
     "rowErrors": {
      "type": "array",
      "maxItems": 200,
      "description": "The first 200 row errors; the full report is GET /imports/{importId}/report (CSV).",
      "items": {
       "type": "object",
       "required": [
        "row",
        "code"
       ],
       "properties": {
        "row": {
         "type": "integer",
         "minimum": 1
        },
        "jiraKey": {
         "type": "string",
         "maxLength": 64
        },
        "column": {
         "type": "string",
         "maxLength": 120
        },
        "code": {
         "type": "string",
         "maxLength": 80
        },
        "reason": {
         "type": "string",
         "maxLength": 80,
         "description": "F-INT-09.R12: why a parent or a link was skipped (import.parent_skipped, import.link_skipped), a problem code — for example import.link_outside_import, import.link_type_skipped, ticket_relation.cycle, ticket_relation.exists."
        },
        "worklogId": {
         "type": "string",
         "maxLength": 64,
         "description": "F-INT-09.R17 (XM-1387): the Jira id of a work log that the import did not import (column Worklog)."
        },
        "date": {
         "type": "string",
         "format": "date",
         "description": "F-INT-09.R17 (XM-1387): the day of a work log that the import did not import (import.worklog_too_long, import.worklog_invalid), as the source writes it."
        },
        "minutes": {
         "type": "integer",
         "minimum": 0,
         "description": "F-INT-09.R17 (XM-1387): the time of that work log, in whole minutes."
        }
       }
      }
     },
     "tally": {
      "type": "object",
      "required": [
       "tickets",
       "epics",
       "comments",
       "attachments",
       "attachmentsFound",
       "parents",
       "links"
      ],
      "description": "The dry run's counts (R05) — ticket rows ready, epic rows, comments and attachments the export names (epics are not imported; the epic import is BF1-EPIC's), and (R12) the parents and links of the second pass.",
      "properties": {
       "tickets": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000
       },
       "epics": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000
       },
       "comments": {
        "type": "integer",
        "minimum": 0
       },
       "attachments": {
        "type": "integer",
        "minimum": 0
       },
       "attachmentsFound": {
        "type": "integer",
        "minimum": 0,
        "description": "XM-1241 (JIRA-IMPORT-ARCHIVE-TALLY): of the attachment ids the export names, how many the archive holds — counted over the same rows as attachments (every row, a refused one too), so attachments − attachmentsFound are missing from the archive. 0 without an archive."
       },
       "parents": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000,
        "description": "F-INT-09.R12: the parents (Parent, Parent id) that the second pass sends to Work."
       },
       "links": {
        "type": "integer",
        "minimum": 0,
        "description": "F-INT-09.R12: the links between rows of the file, of a mapped link type, that the second pass sends to Work (each Jira link once)."
       }
      }
     },
     "links": {
      "type": "object",
      "required": [
       "done",
       "parents",
       "relations",
       "skipped",
       "resends"
      ],
      "description": "F-INT-09.R12: the second pass, once it started — the items of the file's link list done, the parents set, the relations added, the skip lines, and the batches sent again after a wait (409 ticket_relation.graph_busy, after Retry-After).",
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "parents": {
        "type": "integer",
        "minimum": 0
       },
       "relations": {
        "type": "integer",
        "minimum": 0
       },
       "skipped": {
        "type": "integer",
        "minimum": 0
       },
       "resends": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "sprints": {
      "type": "object",
      "required": [
       "board",
       "sprintRows",
       "offReason"
      ],
      "description": "F-INT-09.R18 (owner, 30 November 2026, \"B' kanban rule + A (Recommended)\"): what the finished dry run found about the sprints of the source. Present only after a dry run finished. The import changes no project setting: the import page shows the reason and offers to turn the project's Backlog & sprints module off through the project settings (PATCH /projects/{projectKey}), by the person's own right.",
      "properties": {
       "board": {
        "type": [
         "string",
         "null"
        ],
        "enum": [
         "kanban",
         "scrum",
         null
        ],
        "description": "The type of the source's Jira board: a REST export's csv/Board_Columns.csv (Board Type; Scrum when one board is Scrum). Null when the source names no board (the native CSV) or no known type."
       },
       "sprintRows": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000,
        "description": "The rows that the import would create with a sprint value (a Sprint or Custom field (Sprint) cell)."
       },
       "offReason": {
        "type": [
         "string",
         "null"
        ],
        "enum": [
         "kanban_board",
         "no_sprint_value",
         null
        ],
        "description": "Why the source has no sprints: kanban_board (the board is Kanban) or no_sprint_value (no row that the import would create has a sprint value). Null when the source has sprints."
       }
      }
     },
     "rowErrorCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Every row error the import found: the report keeps the first 10,000 and counts all; the first 200 are inline."
     },
     "errorCode": {
      "type": "string",
      "maxLength": 80,
      "description": "Why a dry run or run failed (e.g. integration.import_file_invalid, project.not_found, integration.import_failed, integration.import_link_wait_exceeded), or (XM-396) why it cannot go on: integration.import_mapping_unreadable or integration.import_report_unreadable when this release cannot read the stored mapping or row report."
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "KnowledgeAuthorView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "agent",
       "system"
      ]
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "agent": {
      "type": "object",
      "required": [
       "id",
       "name",
       "kind"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 80,
        "example": "Atlas coding agent"
       },
       "kind": {
        "$ref": "#/components/schemas/AgentIdentityKind"
       },
       "revoked": {
        "type": "boolean"
       }
      }
     },
     "onBehalfOf": {
      "$ref": "#/components/schemas/MemberRef"
     }
    }
   },
   "KnowledgeBacklinkRow": {
    "type": "object",
    "required": [
     "itemKey",
     "type",
     "title",
     "relation",
     "state"
    ],
    "properties": {
     "itemKey": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "relation": {
      "$ref": "#/components/schemas/KnowledgeRelation"
     },
     "state": {
      "$ref": "#/components/schemas/KnowledgeItemState"
     },
     "decisionStatus": {
      "$ref": "#/components/schemas/DecisionStatus"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "KnowledgeItemBody": {
    "type": "object",
    "description": "The typed body of the item type (memory §3.3). Exactly the member that the item's type names is present.",
    "properties": {
     "note": {
      "type": "object",
      "required": [
       "content"
      ],
      "properties": {
       "content": {
        "$ref": "#/components/schemas/KnowledgeMarkdown"
       }
      }
     },
     "fact": {
      "type": "object",
      "required": [
       "statement"
      ],
      "properties": {
       "statement": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "validFrom": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "validUntil": {
        "$ref": "#/components/schemas/DateOnly"
       }
      }
     },
     "decision": {
      "$ref": "#/components/schemas/DecisionRecordBody"
     },
     "meetingSummary": {
      "type": "object",
      "required": [
       "meeting",
       "summary"
      ],
      "properties": {
       "meeting": {
        "$ref": "#/components/schemas/MeetingFacts"
       },
       "summary": {
        "$ref": "#/components/schemas/KnowledgeMarkdown"
       }
      }
     },
     "meetingTranscript": {
      "type": "object",
      "required": [
       "passageCount",
       "durationMs"
      ],
      "properties": {
       "meetingItemKey": {
        "$ref": "#/components/schemas/KnowledgeItemKey",
        "description": "Present only when the reader may read the meeting summary now (INV-MEM-16; review SR-BF3-26)."
       },
       "language": {
        "type": "string",
        "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$"
       },
       "passageCount": {
        "type": "integer",
        "minimum": 1,
        "maximum": 20000
       },
       "durationMs": {
        "type": "integer",
        "minimum": 0,
        "maximum": 86400000
       }
      }
     },
     "actionItem": {
      "type": "object",
      "required": [
       "statement",
       "status"
      ],
      "properties": {
       "statement": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "assigneeMemberId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "assigneeName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       },
       "dueDate": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "status": {
        "type": "string",
        "enum": [
         "open",
         "ticketed",
         "done",
         "dropped"
        ]
       },
       "ticketKey": {
        "$ref": "#/components/schemas/TicketKey"
       }
      }
     },
     "question": {
      "type": "object",
      "required": [
       "question",
       "status"
      ],
      "properties": {
       "question": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "status": {
        "type": "string",
        "enum": [
         "open",
         "answered"
        ]
       }
      }
     },
     "risk": {
      "type": "object",
      "required": [
       "statement",
       "likelihood",
       "impact",
       "status"
      ],
      "properties": {
       "statement": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
       },
       "likelihood": {
        "type": "string",
        "enum": [
         "low",
         "medium",
         "high"
        ]
       },
       "impact": {
        "type": "string",
        "enum": [
         "low",
         "medium",
         "high"
        ]
       },
       "mitigation": {
        "type": "string",
        "maxLength": 2000
       },
       "status": {
        "type": "string",
        "enum": [
         "open",
         "mitigated",
         "accepted",
         "closed"
        ]
       }
      }
     },
     "feedback": {
      "type": "object",
      "required": [
       "content"
      ],
      "properties": {
       "content": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
       },
       "sentiment": {
        "type": "string",
        "enum": [
         "positive",
         "neutral",
         "negative"
        ]
       },
       "fromName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       }
      }
     },
     "changeRecord": {
      "type": "object",
      "required": [
       "changeKind"
      ],
      "properties": {
       "changeKind": {
        "type": "string",
        "enum": [
         "merge",
         "deploy",
         "release",
         "incident",
         "other"
        ]
       },
       "environment": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40,
        "example": "production"
       },
       "ref": {
        "$ref": "#/components/schemas/KnowledgeSourceRef"
       },
       "details": {
        "type": "string",
        "maxLength": 5000
       }
      }
     }
    }
   },
   "KnowledgeItemInput": {
    "type": "object",
    "required": [
     "type",
     "title",
     "body"
    ],
    "properties": {
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Atlas uses SAML SSO for client users"
     },
     "body": {
      "$ref": "#/components/schemas/KnowledgeItemBody"
     },
     "tags": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
      }
     },
     "source": {
      "$ref": "#/components/schemas/KnowledgeSource"
     },
     "occurredAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "links": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/KnowledgeLinkInput"
      }
     },
     "supersedes": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "segment": {
      "$ref": "#/components/schemas/MemorySegmentKey",
      "description": "Default general; the writer must read the segment (F-MEM-13.R05)."
     },
     "visibility": {
      "$ref": "#/components/schemas/KnowledgeVisibility",
      "description": "Members only, with manage_client_sharing; the agent API has no such member."
     }
    }
   },
   "KnowledgeItemKey": {
    "type": "string",
    "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}-[Kk][1-9][0-9]{0,8}$",
    "description": "A knowledge item key such as ORB-K12; upper-cased by the server.",
    "example": "ORB-K12"
   },
   "KnowledgeItemPatch": {
    "type": "object",
    "description": "JSON Merge Patch; a present body replaces the complete body of the item's type.",
    "properties": {
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "body": {
      "$ref": "#/components/schemas/KnowledgeItemBody"
     },
     "tags": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$"
      }
     },
     "occurredAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "revisionReason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     }
    }
   },
   "KnowledgeItemRow": {
    "type": "object",
    "required": [
     "key",
     "type",
     "title",
     "excerpt",
     "state",
     "visibility",
     "segment",
     "author",
     "sourceKind",
     "updatedAt"
    ],
    "properties": {
     "segment": {
      "$ref": "#/components/schemas/MemorySegmentRef"
     },
     "key": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "excerpt": {
      "type": "string",
      "maxLength": 300
     },
     "state": {
      "$ref": "#/components/schemas/KnowledgeItemState"
     },
     "visibility": {
      "$ref": "#/components/schemas/KnowledgeVisibility"
     },
     "author": {
      "$ref": "#/components/schemas/KnowledgeAuthorView"
     },
     "sourceKind": {
      "$ref": "#/components/schemas/KnowledgeSourceKind"
     },
     "decisionStatus": {
      "$ref": "#/components/schemas/DecisionStatus"
     },
     "tags": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string"
      }
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "score": {
      "type": "number",
      "description": "Search only; an ordinal of this answer, never compared across answers."
     },
     "untrustedContent": {
      "type": "boolean",
      "description": "As KnowledgeItemView.untrustedContent; always true on the agent surfaces."
     }
    }
   },
   "KnowledgeItemState": {
    "type": "string",
    "enum": [
     "proposed",
     "active",
     "retracted",
     "rejected"
    ]
   },
   "KnowledgeItemTypeKey": {
    "type": "string",
    "enum": [
     "note",
     "fact",
     "decision",
     "meeting_summary",
     "meeting_transcript",
     "action_item",
     "question",
     "risk",
     "feedback",
     "change_record"
    ],
    "x-extensible-enum": true,
    "description": "The KnowledgeItemTypeRegistry version 1 (memory §3.3)."
   },
   "KnowledgeItemView": {
    "type": "object",
    "required": [
     "key",
     "projectKey",
     "type",
     "typeSchemaVersion",
     "title",
     "body",
     "tags",
     "visibility",
     "access",
     "state",
     "source",
     "author",
     "createdAt",
     "updatedAt",
     "version",
     "revisionCount",
     "links",
     "can"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "typeSchemaVersion": {
      "type": "integer",
      "minimum": 1
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "body": {
      "$ref": "#/components/schemas/KnowledgeItemBody"
     },
     "tags": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string"
      }
     },
     "visibility": {
      "$ref": "#/components/schemas/KnowledgeVisibility"
     },
     "access": {
      "$ref": "#/components/schemas/ItemAccessView"
     },
     "state": {
      "$ref": "#/components/schemas/KnowledgeItemState"
     },
     "source": {
      "$ref": "#/components/schemas/KnowledgeSource"
     },
     "author": {
      "$ref": "#/components/schemas/KnowledgeAuthorView"
     },
     "lastAuthor": {
      "$ref": "#/components/schemas/KnowledgeAuthorView"
     },
     "occurredAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "revisionCount": {
      "type": "integer",
      "minimum": 1
     },
     "pendingRevision": {
      "type": "boolean"
     },
     "writtenByAgent": {
      "type": "boolean",
      "description": "True when an agent wrote a revision of the item; the SPA labels the text \"Written by an agent\"."
     },
     "screening": {
      "type": "string",
      "enum": [
       "clean",
       "suspected"
      ],
      "description": "The index-time injection screen's mark; the SPA labels a suspected text \"Check this text\"."
     },
     "untrustedContent": {
      "type": "boolean",
      "description": "On the agent API and the MCP server always true: every text that Youniton returns to an agent is data, whoever wrote it (INV-MEM-10). In the SPA true when writtenByAgent is true or screening is suspected."
     },
     "links": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/KnowledgeLinkView"
      }
     },
     "can": {
      "type": "object",
      "properties": {
       "revise": {
        "type": "boolean"
       },
       "retract": {
        "type": "boolean"
       },
       "restore": {
        "type": "boolean"
       },
       "share": {
        "type": "boolean"
       },
       "curate": {
        "type": "boolean"
       },
       "changeSegment": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "KnowledgeLinkInput": {
    "type": "object",
    "required": [
     "relation",
     "target"
    ],
    "properties": {
     "relation": {
      "$ref": "#/components/schemas/KnowledgeRelation"
     },
     "target": {
      "$ref": "#/components/schemas/KnowledgeTargetInput"
     }
    }
   },
   "KnowledgeLinkView": {
    "type": "object",
    "required": [
     "id",
     "relation",
     "direction",
     "target",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "relation": {
      "$ref": "#/components/schemas/KnowledgeRelation"
     },
     "direction": {
      "type": "string",
      "enum": [
       "outgoing",
       "incoming"
      ]
     },
     "target": {
      "type": "object",
      "required": [
       "kind",
       "ref"
      ],
      "properties": {
       "kind": {
        "$ref": "#/components/schemas/KnowledgeTargetKind"
       },
       "ref": {
        "type": "string",
        "maxLength": 2048,
        "description": "For external_url, an https link that obeys the shared link rule (XM-1043; 05-api §8.7); a link whose stored target fails the rule today is left out of the list."
       },
       "title": {
        "type": "string",
        "maxLength": 200,
        "description": "The target's title as the reader sees it; absent for external_url."
       },
       "label": {
        "type": "string",
        "maxLength": 120
       },
       "host": {
        "type": "string",
        "maxLength": 253,
        "description": "external_url only."
       }
      }
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdBy": {
      "$ref": "#/components/schemas/KnowledgeAuthorView"
     }
    }
   },
   "KnowledgeMarkdown": {
    "type": "string",
    "minLength": 1,
    "maxLength": 20000,
    "description": "CommonMark without raw HTML; rendered with the allow-list of 11-frontend §8.7 (no images, Youniton and https links only)."
   },
   "KnowledgeReasonRequest": {
    "type": "object",
    "properties": {
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     }
    }
   },
   "KnowledgeRelation": {
    "type": "string",
    "enum": [
     "relates_to",
     "decided_in",
     "implements",
     "tracked_by",
     "supersedes",
     "derived_from",
     "answers",
     "part_of"
    ],
    "x-extensible-enum": true
   },
   "KnowledgeRevisionView": {
    "type": "object",
    "required": [
     "revisionNo",
     "kind",
     "author",
     "at",
     "bodyDigest",
     "redacted"
    ],
    "properties": {
     "revisionNo": {
      "type": "integer",
      "minimum": 1
     },
     "kind": {
      "type": "string",
      "enum": [
       "created",
       "revised",
       "state_changed",
       "visibility_changed",
       "linked",
       "unlinked",
       "redacted",
       "text_erased",
       "screened"
      ]
     },
     "author": {
      "$ref": "#/components/schemas/KnowledgeAuthorView"
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     },
     "changed": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string"
      }
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     },
     "pending": {
      "type": "string",
      "enum": [
       "waiting",
       "accepted",
       "rejected"
      ]
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "body": {
      "$ref": "#/components/schemas/KnowledgeItemBody"
     },
     "bodyDigest": {
      "$ref": "#/components/schemas/Sha256Hex"
     },
     "redacted": {
      "type": "boolean"
     }
    }
   },
   "KnowledgeSearchMeta": {
    "type": "object",
    "required": [
     "mode",
     "semanticAvailable"
    ],
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "keyword",
       "semantic",
       "list"
      ]
     },
     "semanticAvailable": {
      "type": "boolean"
     },
     "semanticUnavailableReason": {
      "type": "string",
      "enum": [
       "assist_unavailable",
       "source_off",
       "budget_exhausted",
       "not_indexed"
      ]
     },
     "size": {
      "type": "integer",
      "minimum": 0,
      "maximum": 50
     },
     "hasMore": {
      "type": "boolean"
     }
    }
   },
   "KnowledgeSource": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "$ref": "#/components/schemas/KnowledgeSourceKind"
     },
     "ref": {
      "$ref": "#/components/schemas/KnowledgeSourceRef"
     }
    }
   },
   "KnowledgeSourceKind": {
    "type": "string",
    "enum": [
     "person",
     "agent",
     "meeting",
     "help_desk",
     "ci"
    ],
    "x-extensible-enum": true
   },
   "KnowledgeSourceRef": {
    "type": "object",
    "required": [
     "system",
     "externalId"
    ],
    "properties": {
     "system": {
      "type": "string",
      "pattern": "^[a-z0-9_.-]{1,40}$",
      "example": "github-actions"
     },
     "externalId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "run-88412"
     },
     "url": {
      "type": "string",
      "maxLength": 2048,
      "pattern": "^https://",
      "example": "https://github.com/northwind/atlas-web/actions/runs/88412"
     }
    }
   },
   "KnowledgeTargetInput": {
    "type": "object",
    "required": [
     "kind",
     "ref"
    ],
    "properties": {
     "kind": {
      "$ref": "#/components/schemas/KnowledgeTargetKind"
     },
     "ref": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048,
      "description": "A ticket key, an item key, a doc page or opportunity id, a request key, or an https URL.",
      "example": "ORB-124"
     },
     "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "external_url only."
     }
    }
   },
   "KnowledgeTargetKind": {
    "type": "string",
    "enum": [
     "ticket",
     "knowledge_item",
     "doc_page",
     "opportunity",
     "help_desk_request",
     "external_url"
    ],
    "x-extensible-enum": true
   },
   "KnowledgeTypeCatalogue": {
    "type": "object",
    "required": [
     "registryVersion",
     "types"
    ],
    "properties": {
     "registryVersion": {
      "type": "integer",
      "minimum": 1,
      "example": 1
     },
     "types": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/KnowledgeTypeView"
      }
     }
    }
   },
   "KnowledgeTypeView": {
    "type": "object",
    "required": [
     "key",
     "schemaVersion",
     "enabled",
     "clientShareable",
     "sourceKinds"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "schemaVersion": {
      "type": "integer",
      "minimum": 1
     },
     "enabled": {
      "type": "boolean"
     },
     "clientShareable": {
      "type": "boolean"
     },
     "sourceKinds": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/KnowledgeSourceKind"
      }
     }
    }
   },
   "KnowledgeVisibility": {
    "type": "string",
    "enum": [
     "internal",
     "client"
    ]
   },
   "KnowledgeVisibilityRequest": {
    "type": "object",
    "required": [
     "visibility"
    ],
    "properties": {
     "visibility": {
      "$ref": "#/components/schemas/KnowledgeVisibility"
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "LabelColour": {
    "type": "string",
    "enum": [
     "grey",
     "blue",
     "green",
     "amber",
     "red",
     "purple",
     "teal",
     "pink"
    ],
    "description": "The closed label palette (design tokens; work §3.6)."
   },
   "LabelCreateRequest": {
    "type": "object",
    "required": [
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     }
    }
   },
   "LabelEditRequest": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     }
    }
   },
   "LabelMergePreview": {
    "type": "object",
    "required": [
     "source",
     "target",
     "ticketCount",
     "alreadyTagged",
     "targetAccessSensitive"
    ],
    "properties": {
     "source": {
      "$ref": "#/components/schemas/ProjectLabelView"
     },
     "target": {
      "$ref": "#/components/schemas/ProjectLabelView"
     },
     "ticketCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Tickets carrying the source."
     },
     "alreadyTagged": {
      "type": "integer",
      "minimum": 0,
      "description": "Of those, tickets that already carry the target."
     },
     "targetAccessSensitive": {
      "type": "boolean",
      "description": "The merge can widen a role audience; only holders of manage_client_sharing may confirm it."
     }
    }
   },
   "LabelMergeRequest": {
    "type": "object",
    "required": [
     "targetLabelId",
     "expectedTicketCount"
    ],
    "additionalProperties": false,
    "properties": {
     "targetLabelId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "expectedTicketCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5000,
      "description": "The count the confirmation showed; a different live count answers 409 label.merge_count_changed."
     }
    }
   },
   "LabelMergeResult": {
    "type": "object",
    "required": [
     "target",
     "retaggedTickets"
    ],
    "properties": {
     "target": {
      "$ref": "#/components/schemas/ProjectLabelView"
     },
     "retaggedTickets": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5000
     }
    }
   },
   "LabelRef": {
    "type": "object",
    "required": [
     "id",
     "name",
     "colour"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     },
     "archived": {
      "type": "boolean",
      "description": "An archived label still on the ticket, shown muted (work §3.6)."
     }
    }
   },
   "Landing": {
    "type": "object",
    "required": [
     "area"
    ],
    "properties": {
     "area": {
      "type": "string",
      "enum": [
       "workspace",
       "administration",
       "portal",
       "none"
      ]
     },
     "tenantSlug": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
     },
     "projectKey": {
      "type": "string"
     },
     "section": {
      "type": "string"
     },
     "consolePointer": {
      "type": "boolean",
      "description": "True for an operator account without a tenant (06 §3.5)."
     }
    }
   },
   "Locale": {
    "type": "string",
    "enum": [
     "en",
     "lt",
     "de"
    ],
    "example": "en"
   },
   "LoggingPeriodAuditRow": {
    "type": "object",
    "description": "One change of a logging period (F-TIM-13.R06; the web app `PeriodAuditRow`): the action, the period, the actor (absent for the scheduled close of `time:logging-periods`), the time, the announced date and the reopen reason.",
    "required": [
     "id",
     "action",
     "period",
     "at"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "action": {
      "type": "string",
      "enum": [
       "announced",
       "closed",
       "reopened"
      ]
     },
     "period": {
      "type": "object",
      "required": [
       "id",
       "kind",
       "from",
       "to",
       "scope"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "kind": {
        "type": "string",
        "enum": [
         "week",
         "month"
        ]
       },
       "from": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "to": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "scope": {
        "$ref": "#/components/schemas/LoggingPeriodScope"
       }
      }
     },
     "by": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     },
     "closesOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     }
    }
   },
   "LoggingPeriodCloseRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "A close (no `closesOn`) or an announced close (`closesOn` after the tenant's today) of the period of this kind, start and scope (F-TIM-13.R01–R03). `start` is the first day of a week (the tenant's week start) or of a month.",
    "required": [
     "kind",
     "start",
     "scope"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "week",
       "month"
      ]
     },
     "start": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "scope": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "kind"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "tenant",
         "team",
         "project"
        ]
       },
       "teamId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "projectId": {
        "$ref": "#/components/schemas/Uuid"
       }
      }
     },
     "closesOn": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "LoggingPeriodHistory": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/LoggingPeriodAuditRow"
      }
     },
     "meta": {
      "type": "object",
      "properties": {
       "nextCursor": {
        "type": [
         "string",
         "null"
        ]
       }
      }
     }
    }
   },
   "LoggingPeriodScope": {
    "type": "object",
    "description": "Whose time a logging period holds (F-TIM-13.R01, R05): the tenant, one team (its name when the team exists) or one project (its key and name when the project exists).",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "tenant",
       "team",
       "project"
      ]
     },
     "teamId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "teamName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "projectId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     }
    }
   },
   "LoggingPeriodView": {
    "type": "object",
    "description": "A logging period (F-TIM-13 §10; the web app `LoggingPeriod`, `ClosedPeriod`, `UpcomingClose`). The client writes the label. `closedBy` and `closedAt` are present while the period is closed; `announcedBy`, `announcedAt` and `closesOn` while it is announced; `reopenedBy` and `reopenedAt` while it is reopened.",
    "required": [
     "id",
     "kind",
     "from",
     "to",
     "scope",
     "state",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "week",
       "month"
      ]
     },
     "from": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "to": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "scope": {
      "$ref": "#/components/schemas/LoggingPeriodScope"
     },
     "state": {
      "type": "string",
      "enum": [
       "announced",
       "closed",
       "reopened"
      ]
     },
     "closesOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "announcedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "announcedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "closedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "closedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "reopenedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "reopenedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "LoggingPeriods": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/LoggingPeriodView"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "more"
      ],
      "properties": {
       "more": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ManualWebhookSetup": {
    "type": "object",
    "description": "Shown once, for a manual webhook; the secret is never readable again.",
    "required": [
     "url",
     "secret",
     "events"
    ],
    "properties": {
     "url": {
      "type": "string",
      "maxLength": 2048,
      "example": "https://app.youniton.com/webhooks/gitlab/0192f1a8-7c3e-7b10-9a2e-5d1f0c4b8e21"
     },
     "secret": {
      "type": "string",
      "minLength": 43,
      "maxLength": 64
     },
     "events": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "enum": [
        "merge_requests",
        "push",
        "pull_request"
       ]
      }
     }
    }
   },
   "MeetingFacts": {
    "type": "object",
    "required": [
     "externalId",
     "provider",
     "title",
     "startedAt",
     "endedAt"
    ],
    "properties": {
     "externalId": {
      "type": "string",
      "pattern": "^([A-Za-z0-9._:/-]{1,200}|This text was erased\\.)$",
      "example": "tr:mtg:2026-11-02:atlas-weekly",
      "description": "The meeting id of a knowledge item's meeting record. After the member erasure, the erased phrase replaces the id that a member typed in a manual record (§12; REV-MEMC-RR3-02), and a stored record sends it back. The add refuses the phrase (a fresh record), and a revise may send it only when the live id is already the phrase: 422 memory.body_invalid otherwise (REV-MEMC-RR4-03). In a record that an agent wrote, the id is the agent's idempotency key, and a member's revise that changes it answers 422 memory.meeting_id_fixed (REV-MEMC-RR4-04). The meeting intake uses MeetingIntakeFacts, which refuses the phrase."
     },
     "provider": {
      "type": "string",
      "enum": [
       "transcriber"
      ],
      "x-extensible-enum": true
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Atlas weekly with Orbit Retail"
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "endedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "language": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$",
      "example": "en"
     },
     "participants": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/MeetingParticipant"
      },
      "description": "Input and internal view only. Stored as rows of mem_meeting_participants, never in the stored body or a revision; a revision view has no participants. Clients read names and roles only (ClientKnowledgeBody)."
     }
    }
   },
   "MeetingIntakeFacts": {
    "type": "object",
    "description": "The meeting of a meeting intake (F-MEM-09; MeetingIntakeV1.meeting). Its own schema, so that the intake keeps the plain id pattern of MeetingExternalId (REV-MEMC-RR4-03).",
    "required": [
     "externalId",
     "provider",
     "title",
     "startedAt",
     "endedAt"
    ],
    "properties": {
     "externalId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:/-]{1,200}$",
      "example": "tr:mtg:2026-11-02:atlas-weekly",
      "description": "The transcriber's meeting id; with the identity and the project, the key of the idempotent intake (mem_meeting_intakes.external_id has the same check). Never the erased phrase."
     },
     "provider": {
      "type": "string",
      "enum": [
       "transcriber"
      ],
      "x-extensible-enum": true
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Atlas weekly with Orbit Retail"
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "endedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "language": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$",
      "example": "en"
     },
     "participants": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/MeetingParticipant"
      },
      "description": "Stored as rows of mem_meeting_participants, never in the stored body or a revision."
     }
    }
   },
   "MeetingIntakeResult": {
    "type": "object",
    "required": [
     "externalId",
     "revision",
     "decisionItemKeys",
     "actionItemKeys",
     "transcriptStored",
     "stored",
     "segment"
    ],
    "properties": {
     "stored": {
      "type": "boolean",
      "description": "False when the meeting's segment has meetingIntake do_not_store; then no item exists (F-MEM-13.R09)."
     },
     "segment": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     },
     "externalId": {
      "type": "string",
      "maxLength": 200
     },
     "revision": {
      "type": "integer",
      "minimum": 1
     },
     "summaryItemKey": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "transcriptItemKey": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "transcriptStored": {
      "type": "boolean",
      "description": "False when memory.meetings.transcripts or the segment's meetingIntake keeps no transcript."
     },
     "decisionItemKeys": {
      "type": "object",
      "additionalProperties": {
       "$ref": "#/components/schemas/KnowledgeItemKey"
      },
      "description": "The producer's ref → the item key."
     },
     "actionItemKeys": {
      "type": "object",
      "additionalProperties": {
       "$ref": "#/components/schemas/KnowledgeItemKey"
      }
     },
     "state": {
      "$ref": "#/components/schemas/KnowledgeItemState"
     },
     "skipped": {
      "type": "array",
      "maxItems": 150,
      "items": {
       "type": "string",
       "maxLength": 80
      },
      "description": "The producer refs whose items a person changed or accepted; a later revision did not change them."
     },
     "skippedOutOfReach": {
      "type": "integer",
      "minimum": 0,
      "maximum": 152,
      "description": "The items of the meeting that are outside the identity's readable segments now (the segment test only, not transcripts:read); never named (F-MEM-09.R10; INV-MEM-16; review SR-BF3-25, SR-BF3-34)."
     }
    }
   },
   "MeetingIntakeV1": {
    "type": "object",
    "required": [
     "contractVersion",
     "projectKey",
     "meeting",
     "revision",
     "summary",
     "consent"
    ],
    "description": "The meeting-intake contract, version 1 (memory §3.8; F-MEM-09). At most 4 MiB †.",
    "properties": {
     "contractVersion": {
      "type": "integer",
      "enum": [
       1
      ]
     },
     "consent": {
      "type": "object",
      "required": [
       "noticeGiven"
      ],
      "description": "The producer states that every participant got the recording notice before the recording (CFL-547 item 7).",
      "properties": {
       "noticeGiven": {
        "type": "boolean",
        "enum": [
         true
        ]
       },
       "method": {
        "type": "string",
        "enum": [
         "spoken",
         "chat",
         "calendar",
         "organiser"
        ],
        "description": "How the notice was given."
       }
      }
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "revision": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
     },
     "segmentKey": {
      "$ref": "#/components/schemas/MemorySegmentKey",
      "description": "The meeting's segment, one of the identity's segments; default by F-MEM-13.R08. The named or default segment must be in the identity's segments ∩ the owner's readable segments; otherwise 422 validation.failed with memory.segment_not_allowed (F-MEM-13.R08; review SR-BF3-33)."
     },
     "meeting": {
      "$ref": "#/components/schemas/MeetingIntakeFacts"
     },
     "summary": {
      "type": "object",
      "required": [
       "title",
       "text"
      ],
      "properties": {
       "title": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       },
       "text": {
        "$ref": "#/components/schemas/KnowledgeMarkdown"
       }
      }
     },
     "transcript": {
      "type": "object",
      "required": [
       "passages"
      ],
      "properties": {
       "language": {
        "type": "string",
        "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$"
       },
       "stt": {
        "type": "string",
        "maxLength": 60,
        "example": "soniox-eu"
       },
       "passages": {
        "type": "array",
        "minItems": 1,
        "maxItems": 20000,
        "items": {
         "type": "object",
         "required": [
          "speakerLabel",
          "startMs",
          "endMs",
          "text",
          "finality"
         ],
         "properties": {
          "speakerLabel": {
           "type": "string",
           "minLength": 1,
           "maxLength": 120
          },
          "startMs": {
           "type": "integer",
           "minimum": 0
          },
          "endMs": {
           "type": "integer",
           "minimum": 0
          },
          "text": {
           "type": "string",
           "minLength": 1,
           "maxLength": 4000
          },
          "finality": {
           "type": "string",
           "enum": [
            "final",
            "recovered_partial"
           ]
          }
         }
        }
       }
      }
     },
     "decisions": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "ref",
        "statement"
       ],
       "properties": {
        "ref": {
         "type": "string",
         "pattern": "^[A-Za-z0-9._:-]{1,80}$",
         "description": "The producer's stable id of this decision in the meeting."
        },
        "statement": {
         "type": "string",
         "minLength": 1,
         "maxLength": 500
        },
        "rationale": {
         "type": "string",
         "maxLength": 5000
        },
        "decidedBy": {
         "type": "array",
         "maxItems": 10,
         "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
         }
        },
        "alternatives": {
         "type": "array",
         "maxItems": 10,
         "items": {
          "$ref": "#/components/schemas/DecisionAlternative"
         }
        },
        "passageNos": {
         "type": "array",
         "maxItems": 50,
         "items": {
          "type": "integer",
          "minimum": 1
         }
        }
       }
      }
     },
     "actionItems": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "ref",
        "statement"
       ],
       "properties": {
        "ref": {
         "type": "string",
         "pattern": "^[A-Za-z0-9._:-]{1,80}$"
        },
        "statement": {
         "type": "string",
         "minLength": 1,
         "maxLength": 1000
        },
        "assigneeName": {
         "type": "string",
         "minLength": 1,
         "maxLength": 120
        },
        "assigneeEmail": {
         "$ref": "#/components/schemas/EmailAddress"
        },
        "dueDate": {
         "$ref": "#/components/schemas/DateOnly"
        },
        "passageNos": {
         "type": "array",
         "maxItems": 50,
         "items": {
          "type": "integer",
          "minimum": 1
         }
        }
       }
      }
     }
    }
   },
   "MeetingParticipant": {
    "type": "object",
    "required": [
     "displayName",
     "role"
    ],
    "properties": {
     "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Lena Ruiz"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "role": {
      "type": "string",
      "enum": [
       "organiser",
       "participant",
       "bot"
      ]
     }
    }
   },
   "MemberAccessView": {
    "type": "object",
    "required": [
     "member",
     "role",
     "headline",
     "extensions",
     "effective",
     "can"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "role": {
      "$ref": "#/components/schemas/RoleRef"
     },
     "headline": {
      "type": "string",
      "maxLength": 120,
      "example": "Developer + 2 extra permissions"
     },
     "extensions": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/AccessExtensionView"
      }
     },
     "effective": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "type": "object",
       "required": [
        "permission",
        "scope",
        "sources"
       ],
       "properties": {
        "permission": {
         "type": "string",
         "maxLength": 60
        },
        "scope": {
         "type": "string",
         "maxLength": 200
        },
        "sources": {
         "type": "array",
         "maxItems": 21,
         "items": {
          "type": "object",
          "required": [
           "kind"
          ],
          "properties": {
           "kind": {
            "type": "string",
            "enum": [
             "role",
             "extension"
            ]
           },
           "extensionId": {
            "$ref": "#/components/schemas/Uuid"
           },
           "label": {
            "type": "string",
            "maxLength": 200
           }
          }
         }
        }
       }
      }
     },
     "can": {
      "type": "object",
      "required": [
       "grant"
      ],
      "properties": {
       "grant": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "MemberAvatarIndexView": {
    "type": "object",
    "description": "XM-1381 (F-IDN-11.R12) — the members of the tenant with an avatar that the reader sees, and each avatar's version.",
    "required": [
     "members"
    ],
    "properties": {
     "members": {
      "type": "array",
      "maxItems": 100000,
      "items": {
       "type": "object",
       "required": [
        "memberId",
        "version"
       ],
       "properties": {
        "memberId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "version": {
         "type": "integer",
         "minimum": 1
        }
       }
      }
     }
    }
   },
   "MemberBulkRequest": {
    "type": "object",
    "required": [
     "action",
     "targets"
    ],
    "additionalProperties": false,
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "change_role",
       "remove",
       "remind_two_factor"
      ]
     },
     "targets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "params": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "roleId": {
        "$ref": "#/components/schemas/Uuid"
       }
      }
     }
    }
   },
   "MemberBulkResult": {
    "type": "object",
    "required": [
     "action",
     "affected",
     "items"
    ],
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "change_role",
       "remove",
       "remind_two_factor"
      ]
     },
     "affected": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "skipped": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "target",
        "reason"
       ],
       "properties": {
        "target": {
         "$ref": "#/components/schemas/Uuid"
        },
        "reason": {
         "type": "string",
         "enum": [
          "reminder_cooldown",
          "already_enrolled",
          "not_active",
          "client_member",
          "self",
          "unchanged"
         ]
        }
       }
      }
     },
     "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "type": "object",
       "required": [
        "target"
       ],
       "properties": {
        "target": {
         "$ref": "#/components/schemas/Uuid"
        },
        "version": {
         "type": "integer",
         "minimum": 1
        }
       }
      }
     }
    }
   },
   "MemberDetail": {
    "type": "object",
    "required": [
     "id",
     "accountId",
     "name",
     "email",
     "audience",
     "role",
     "status",
     "joinedAt",
     "teams",
     "projects",
     "twoFactor",
     "sessions",
     "capacityMinutesPerWeek",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "accountId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "role": {
      "$ref": "#/components/schemas/RoleRef"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "removed"
      ]
     },
     "jobTitle": {
      "type": "string",
      "maxLength": 80
     },
     "capacityMinutesPerWeek": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10080
     },
     "joinedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "removedAt": {
      "description": "Present exactly when status is removed — \"Removed on 20 Oct 2026\" (F-TEN-06 §13; CG-12).",
      "allOf": [
       {
        "$ref": "#/components/schemas/Instant"
       }
      ]
     },
     "lastActiveAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "teams": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/NamedRef"
      }
     },
     "projects": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/MemberProjectMembership"
      }
     },
     "twoFactor": {
      "type": "object",
      "required": [
       "enrolled",
       "required",
       "requiredReason"
      ],
      "properties": {
       "enrolled": {
        "type": "boolean"
       },
       "required": {
        "type": "boolean"
       },
       "requiredReason": {
        "type": "string",
        "enum": [
         "policy_everyone",
         "policy_admins",
         "invitation",
         "none"
        ]
       },
       "lastResetAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "recoveryOpen": {
        "type": "boolean",
        "description": "An independent account recovery is open for the account."
       }
      }
     },
     "sessions": {
      "type": "object",
      "required": [
       "activeInTenant"
      ],
      "properties": {
       "activeInTenant": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "properties": {
       "changeRole": {
        "type": "boolean"
       },
       "remove": {
        "type": "boolean"
       },
       "editDetails": {
        "type": "boolean"
       },
       "resetTwoFactor": {
        "type": "boolean"
       },
       "revokeSessions": {
        "type": "boolean"
       },
       "requestAccountRecovery": {
        "type": "boolean"
       },
       "manageProjects": {
        "type": "boolean"
       },
       "manageTeams": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "MemberDirectoryCounts": {
    "type": "object",
    "required": [
     "all",
     "members",
     "clients",
     "pending",
     "clientInvitations"
    ],
    "properties": {
     "all": {
      "type": "integer",
      "minimum": 0
     },
     "members": {
      "type": "integer",
      "minimum": 0
     },
     "clients": {
      "type": "integer",
      "minimum": 0
     },
     "pending": {
      "type": "integer",
      "minimum": 0
     },
     "clientInvitations": {
      "description": "XM-1470 (F-TEN-04.R12) — the client-audience invitations in state pending or expired, over the whole tenant; a part of pending, not added to all.",
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "MemberDirectoryRow": {
    "type": "object",
    "required": [
     "kind",
     "id",
     "email",
     "role",
     "teams",
     "projectCount",
     "projectKeys",
     "jobTitle",
     "twoFactor",
     "can"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "invitation"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "initials": {
      "type": "string",
      "maxLength": 2
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "organisations": {
      "description": "The names of a client guest's organisations (its active client memberships) or of a client invitation's organisations (its client grants; XM-1470, F-TEN-04.R12), named with the reader's context; absent when there is none the reader may see.",
      "type": "array",
      "maxItems": 3,
      "items": {
       "type": "string"
      }
     },
     "moreOrganisations": {
      "type": "integer",
      "minimum": 0
     },
     "role": {
      "$ref": "#/components/schemas/RoleRef"
     },
     "isAdmin": {
      "type": "boolean"
     },
     "teams": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/NamedRef"
      }
     },
     "projectCount": {
      "type": "integer",
      "minimum": 0
     },
     "projectKeys": {
      "description": "XM-993 (F-TEN-04.R11) — the keys of the row's first projects (at most 5, project id order); projectCount counts them all.",
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/ProjectKey"
      }
     },
     "jobTitle": {
      "description": "XM-993 (F-TEN-04.R11) — the member's job title; null for an invitation or a member without one.",
      "type": [
       "string",
       "null"
      ],
      "maxLength": 80
     },
     "twoFactor": {
      "type": "string",
      "enum": [
       "on",
       "off",
       "pending"
      ]
     },
     "deliverability": {
      "type": "string",
      "enum": [
       "ok",
       "bouncing"
      ],
      "description": "bouncing when Notifications suppressed the row's address in this tenant — \"E-mail bouncing\" with \"Mark as working\" (F-TEN-09.R11, F-NOT-07.R18; XM-80)."
     },
     "lastActiveAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "invitedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "invitationState": {
      "type": "string",
      "enum": [
       "pending",
       "expired"
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "properties": {
       "manage": {
        "type": "boolean"
       },
       "select": {
        "type": "boolean"
       },
       "resend": {
        "type": "boolean"
       },
       "revoke": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "MemberExportRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "Exactly one of targets or filter; with neither, the current segment and filters of the request apply.",
    "properties": {
     "targets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "filter": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "segment": {
        "type": "string",
        "enum": [
         "all",
         "members",
         "clients",
         "pending"
        ]
       },
       "roleId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "teamId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "twoFactor": {
        "type": "string",
        "enum": [
         "on",
         "off"
        ]
       },
       "q": {
        "type": "string",
        "minLength": 2,
        "maxLength": 100
       }
      }
     }
    }
   },
   "MemberFinanceProfileView": {
    "type": "object",
    "required": [
     "member",
     "roleHistory",
     "roleHistoryTruncated",
     "projectRoles",
     "projectRolesTruncated"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "roleHistory": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/RoleAssignmentView"
      }
     },
     "roleHistoryTruncated": {
      "type": "boolean",
      "description": "True when the reader can see more role history entries than the list holds (KDC-07)."
     },
     "projectRoles": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/RoleAssignmentView"
      }
     },
     "projectRolesTruncated": {
      "type": "boolean",
      "description": "True when the reader can see more project roles than the list holds (KDC-07)."
     },
     "rates": {
      "type": "array",
      "maxItems": 100,
      "description": "Only for a reader with view_rates.",
      "items": {
       "$ref": "#/components/schemas/RateVersionView"
      }
     },
     "ratesTruncated": {
      "type": "boolean",
      "description": "With rates only. True when the reader can see more rate versions than the list holds; GET /rate-versions pages all of them (KDC-07)."
     }
    }
   },
   "MemberPickerItem": {
    "type": "object",
    "required": [
     "member",
     "audience"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "email": {
      "type": "string",
      "maxLength": 254,
      "description": "Internal callers only, for disambiguation."
     },
     "organisationName": {
      "type": "string",
      "maxLength": 200
     },
     "jobTitle": {
      "type": "string",
      "maxLength": 120
     }
    }
   },
   "MemberPickerPage": {
    "type": "object",
    "required": [
     "items"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/MemberPickerItem"
      }
     }
    }
   },
   "MemberProjectMembership": {
    "type": "object",
    "required": [
     "projectId",
     "key",
     "name",
     "kind"
    ],
    "properties": {
     "projectId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "team",
       "client"
      ]
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "current": {
      "type": "boolean",
      "description": "Client kind only — the stamp equals the project's current client (07 §3.6)."
     }
    }
   },
   "MemberRef": {
    "type": "object",
    "required": [
     "id",
     "displayName",
     "initials"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Maya Castillo"
     },
     "initials": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2,
      "example": "MC"
     },
     "former": {
      "type": "boolean",
      "description": "A removed or erased member, shown as \"Former member\"."
     },
     "client": {
      "type": "boolean",
      "description": "Present (true) only for a client account (the client audience) that the read names; absent for an internal member and for a former member. The screens show the client mark on the avatar (OF-4). No other fact of the person comes with it."
     }
    }
   },
   "MemberTokenPolicyView": {
    "type": "object",
    "required": [
     "allowed",
     "maxLifetimeDays",
     "expiryChoices"
    ],
    "additionalProperties": false,
    "description": "XM-1015 (G-ACC-06): the member's own tenant's token policy, for the \"Create API token\" dialog — `identity.tokens.allowed` and `identity.tokens.maxLifetimeDays` only. No other setting of the tenant is exposed. XM-1465 (owner Q73 (b)): `expiryChoices` are the expiries that the maximum gives, in ascending order (F-IDN-26.R03).",
    "properties": {
     "allowed": {
      "type": "boolean"
     },
     "maxLifetimeDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365
     },
     "expiryChoices": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
       "type": "integer",
       "minimum": 1,
       "maximum": 365
      }
     }
    }
   },
   "MemberUpdate": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "roleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "jobTitle": {
      "oneOf": [
       {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
       },
       {
        "type": "null"
       }
      ]
     },
     "capacityMinutesPerWeek": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10080
     }
    }
   },
   "MemoryCan": {
    "type": "object",
    "required": [
     "edit",
     "delete",
     "changeClientVisibility"
    ],
    "properties": {
     "edit": {
      "type": "boolean"
     },
     "delete": {
      "type": "boolean"
     },
     "changeClientVisibility": {
      "type": "boolean",
      "description": "Q46 — the reader may set or clear the mark \"Visible to clients\" (memory_write; a session)."
     }
    }
   },
   "MemoryClientVisibility": {
    "type": "object",
    "description": "F-MEM-14.R10, R11 (Q46) — what a client sees of the entry or directory now. `own` is its own mark; `fromDirectory` the nearest marked directory above it.",
    "required": [
     "visible",
     "own",
     "fromDirectory"
    ],
    "properties": {
     "visible": {
      "type": "boolean"
     },
     "own": {
      "type": "boolean"
     },
     "fromDirectory": {
      "type": [
       "object",
       "null"
      ],
      "required": [
       "id",
       "path",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "path": {
        "$ref": "#/components/schemas/MemoryDirectoryPathValue"
       },
       "name": {
        "type": "string",
        "maxLength": 80
       }
      }
     }
    }
   },
   "MemoryClientVisibilityInput": {
    "type": "object",
    "required": [
     "visible"
    ],
    "properties": {
     "visible": {
      "type": "boolean",
      "description": "true sets the mark \"Visible to clients\"; false clears it."
     }
    }
   },
   "MemoryDirectory": {
    "type": "object",
    "required": [
     "id",
     "path",
     "name",
     "parentId",
     "entryCount",
     "version",
     "createdAt",
     "createdBy",
     "clientVisibility",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "path": {
      "$ref": "#/components/schemas/MemoryDirectoryPathValue"
     },
     "name": {
      "type": "string",
      "maxLength": 80
     },
     "parentId": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid"
     },
     "entryCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The entries below the directory at any depth (owner Q28 b) — the recursive delete's confirmation."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "clientVisibility": {
      "$ref": "#/components/schemas/MemoryClientVisibility"
     },
     "can": {
      "$ref": "#/components/schemas/MemoryCan"
     }
    }
   },
   "MemoryDirectoryInput": {
    "type": "object",
    "required": [
     "path"
    ],
    "properties": {
     "path": {
      "$ref": "#/components/schemas/MemoryDirectoryPathValue"
     }
    }
   },
   "MemoryDirectoryPathValue": {
    "type": "string",
    "minLength": 1,
    "maxLength": 512,
    "example": "meetings/2026"
   },
   "MemoryEntryInput": {
    "type": "object",
    "required": [
     "path",
     "body"
    ],
    "properties": {
     "path": {
      "$ref": "#/components/schemas/MemoryEntryPathValue"
     },
     "body": {
      "$ref": "#/components/schemas/MemoryMarkdownBody"
     },
     "source": {
      "$ref": "#/components/schemas/MemorySourceInput"
     }
    }
   },
   "MemoryEntryPatch": {
    "type": "object",
    "minProperties": 1,
    "properties": {
     "body": {
      "$ref": "#/components/schemas/MemoryMarkdownBody"
     },
     "path": {
      "$ref": "#/components/schemas/MemoryEntryPathValue"
     },
     "source": {
      "$ref": "#/components/schemas/MemorySourceInput"
     }
    }
   },
   "MemoryEntryPathValue": {
    "type": "string",
    "minLength": 1,
    "maxLength": 512,
    "description": "Directory segments and a name, joined by /. The name may omit .md — the API adds it; .markdown becomes .md (F-MEM-14.R01, R02; owner",
    "example": "meetings/2026-11-22 Weekly sync.md"
   },
   "MemoryEntryRow": {
    "type": "object",
    "required": [
     "id",
     "path",
     "directoryId",
     "name",
     "title",
     "sizeBytes",
     "source",
     "lastSource",
     "version",
     "createdAt",
     "createdBy",
     "updatedAt",
     "updatedBy",
     "clientVisibility",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "path": {
      "$ref": "#/components/schemas/MemoryEntryPathValue"
     },
     "directoryId": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 80,
      "example": "2026-11-22 Weekly sync.md"
     },
     "title": {
      "type": "string",
      "maxLength": 77,
      "example": "2026-11-22 Weekly sync"
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 0
     },
     "source": {
      "$ref": "#/components/schemas/MemorySource"
     },
     "lastSource": {
      "$ref": "#/components/schemas/MemorySource"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "clientVisibility": {
      "$ref": "#/components/schemas/MemoryClientVisibility"
     },
     "can": {
      "$ref": "#/components/schemas/MemoryCan"
     }
    }
   },
   "MemoryEntryUpsert": {
    "type": "object",
    "required": [
     "body"
    ],
    "properties": {
     "body": {
      "$ref": "#/components/schemas/MemoryMarkdownBody"
     },
     "source": {
      "$ref": "#/components/schemas/MemorySourceInput"
     }
    }
   },
   "MemoryEntryUpsertResult": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "$ref": "#/components/schemas/MemoryEntryView"
     },
     "meta": {
      "type": "object",
      "required": [
       "outcome"
      ],
      "properties": {
       "outcome": {
        "type": "string",
        "enum": [
         "created",
         "updated",
         "unchanged"
        ]
       }
      }
     }
    }
   },
   "MemoryEntryView": {
    "allOf": [
     {
      "$ref": "#/components/schemas/MemoryEntryRow"
     },
     {
      "type": "object",
      "required": [
       "body"
      ],
      "properties": {
       "body": {
        "type": "string",
        "description": "CommonMark text; raw HTML is text and is never rendered as HTML."
       }
      }
     }
    ]
   },
   "MemoryMarkdownBody": {
    "type": "string",
    "maxLength": 5242880,
    "description": "An entry's CommonMark text, kept byte for byte (never trimmed; \"\" is an empty entry); at most memory.entries.maxBytes bytes (F-MEM-14.R05)."
   },
   "MemorySegmentInput": {
    "type": "object",
    "required": [
     "key",
     "name"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Sales"
     },
     "description": {
      "type": "string",
      "maxLength": 300
     },
     "grants": {
      "type": "array",
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/SegmentGrant"
      }
     },
     "clientShareable": {
      "type": "boolean",
      "default": false
     },
     "meetingIntake": {
      "type": "string",
      "enum": [
       "store",
       "summary_only",
       "do_not_store"
      ],
      "default": "store"
     }
    }
   },
   "MemorySegmentKey": {
    "type": "string",
    "pattern": "^[a-z][a-z0-9_-]{1,39}$",
    "description": "A segment of the tenant (memory §3.12); general is every reader of the project's memory.",
    "example": "sales"
   },
   "MemorySegmentPatch": {
    "type": "object",
    "description": "JSON Merge Patch over MemorySegmentInput except key; grants replace the whole set.",
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "description": {
      "type": "string",
      "maxLength": 300
     },
     "grants": {
      "type": "array",
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/SegmentGrant"
      }
     },
     "clientShareable": {
      "type": "boolean"
     },
     "meetingIntake": {
      "type": "string",
      "enum": [
       "store",
       "summary_only",
       "do_not_store"
      ]
     }
    }
   },
   "MemorySegmentRef": {
    "type": "object",
    "required": [
     "key",
     "name",
     "restricted"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     },
     "name": {
      "type": "string",
      "maxLength": 60,
      "example": "Sales"
     },
     "restricted": {
      "type": "boolean",
      "description": "False for general only."
     }
    }
   },
   "MemorySegmentView": {
    "type": "object",
    "required": [
     "key",
     "name",
     "restricted",
     "clientShareable",
     "meetingIntake",
     "state",
     "version",
     "audienceLabel"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/MemorySegmentKey"
     },
     "name": {
      "type": "string",
      "maxLength": 60
     },
     "description": {
      "type": "string",
      "maxLength": 300
     },
     "restricted": {
      "type": "boolean"
     },
     "grants": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/SegmentGrant"
      },
      "description": "Admins only."
     },
     "audienceLabel": {
      "type": "string",
      "maxLength": 200,
      "example": "Admins, PMs and the team Sales engineering"
     },
     "clientShareable": {
      "type": "boolean"
     },
     "meetingIntake": {
      "type": "string",
      "enum": [
       "store",
       "summary_only",
       "do_not_store"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "MemorySource": {
    "type": "object",
    "required": [
     "kind",
     "name"
    ],
    "properties": {
     "kind": {
      "$ref": "#/components/schemas/MemorySourceKind"
     },
     "name": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 120,
      "description": "The meeting or agent name; null for person."
     }
    }
   },
   "MemorySourceInput": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "$ref": "#/components/schemas/MemorySourceKind"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "Required for meeting and agent; absent for person."
     }
    }
   },
   "MemorySourceKind": {
    "type": "string",
    "enum": [
     "person",
     "meeting",
     "agent"
    ]
   },
   "MergeRequestAuthorView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "description": "XM-1104 (F-WRK-20.R09; F-INT-06.R14): the author as the MATCHED member only. kind member: the member as the reader sees members (a former or erased member shows as a former member). kind external: no member matches the provider account; the panel shows the neutral label \"External author\". No provider login, name or avatar is ever sent.",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "external"
      ]
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     }
    }
   },
   "MergeRequestChip": {
    "type": "object",
    "required": [
     "reference",
     "state"
    ],
    "properties": {
     "reference": {
      "type": "string",
      "maxLength": 12,
      "example": "!212"
     },
     "state": {
      "type": "string",
      "enum": [
       "open",
       "merged",
       "closed"
      ]
     },
     "more": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "MergeRequestCiView": {
    "type": "object",
    "required": [
     "state"
    ],
    "description": "XM-1104 (F-WRK-20.R10; F-INT-06.R16): the latest CI result of the merge request's head commit, from the provider's signed webhooks. unknown: no result is known (no event yet, or a new head commit without a result); the chip shows its unknown state. No history, no log text.",
    "properties": {
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "running",
       "passed",
       "failed",
       "cancelled",
       "unknown"
      ]
     },
     "at": {
      "$ref": "#/components/schemas/Instant",
      "description": "The provider's time of this state. Absent when the state is unknown."
     }
    }
   },
   "MergeRequestLinkView": {
    "type": "object",
    "required": [
     "provider",
     "repository",
     "iid",
     "title",
     "state",
     "url",
     "linkedAt",
     "linksRefused",
     "draft",
     "sourceBranch",
     "updatedAt",
     "author",
     "ci"
    ],
    "properties": {
     "provider": {
      "type": "string",
      "enum": [
       "gitlab",
       "github"
      ]
     },
     "repository": {
      "type": "string",
      "maxLength": 200,
      "example": "northwind/atlas-web"
     },
     "iid": {
      "type": "integer",
      "minimum": 1,
      "example": 208
     },
     "title": {
      "type": "string",
      "maxLength": 255,
      "example": "Approval flow screens"
     },
     "state": {
      "type": "string",
      "enum": [
       "open",
       "merged",
       "closed"
      ]
     },
     "url": {
      "type": "string",
      "maxLength": 2048
     },
     "linkedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "repositoryDisconnected": {
      "type": "boolean",
      "description": "The repository's connection ended; the link keeps its last known state (F-WRK-20.R05)."
     },
     "linksRefused": {
      "type": "integer",
      "minimum": 0,
      "description": "The tickets this merge request names that Integrations could not link: it reached the tenant's link limit (XM-239). Above 0 the panel says \"too many linked tickets — link an epic or release instead\" with the count."
     },
     "draft": {
      "type": "boolean",
      "description": "XM-1104 (F-WRK-20.R08): the merge request is a draft at the provider. The state stays open for a draft."
     },
     "sourceBranch": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 255,
      "example": "feature/approval-summary",
      "description": "XM-1104 (F-WRK-20.R08): the source branch. Null for a link that was projected before the branch was kept."
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "XM-1104 (F-WRK-20.R08): the provider's time of the last change that the projection holds (\"Updated 3 hours ago\")."
     },
     "author": {
      "$ref": "#/components/schemas/MergeRequestAuthorView"
     },
     "ci": {
      "$ref": "#/components/schemas/MergeRequestCiView"
     }
    }
   },
   "MessageAttachmentView": {
    "type": "object",
    "required": [
     "fileId",
     "name",
     "sizeBytes",
     "mimeType",
     "status"
    ],
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 255,
      "example": "approval-flow.pdf"
     },
     "sizeBytes": {
      "$ref": "#/components/schemas/ByteCount"
     },
     "mimeType": {
      "type": "string",
      "maxLength": 127
     },
     "status": {
      "type": "string",
      "enum": [
       "scanning",
       "ready",
       "quarantined",
       "unavailable"
      ]
     },
     "previews": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "type": "string",
       "enum": [
        "thumb",
        "view"
       ]
      }
     }
    }
   },
   "MessageAuthorView": {
    "type": "object",
    "required": [
     "kind",
     "name"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "client",
       "automation"
      ]
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "name": {
      "type": "string",
      "maxLength": 120,
      "example": "Lena Ruiz"
     },
     "organisation": {
      "type": "string",
      "maxLength": 120,
      "description": "The client organisation of a client author",
      "example": "Orbit Retail"
     },
     "automationRule": {
      "type": "string",
      "maxLength": 120
     },
     "onBehalfOf": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "you": {
      "type": "boolean"
     }
    }
   },
   "MessageDeletionView": {
    "type": "object",
    "required": [
     "at",
     "reason"
    ],
    "properties": {
     "at": {
      "$ref": "#/components/schemas/Instant"
     },
     "reason": {
      "type": "string",
      "enum": [
       "author",
       "owner",
       "moderator",
       "member_erasure"
      ]
     }
    }
   },
   "MessagePage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/MessageView"
      }
     },
     "meta": {
      "$ref": "#/components/schemas/MessagePageMeta"
     }
    }
   },
   "MessagePageMeta": {
    "type": "object",
    "required": [
     "size",
     "hasMoreBefore",
     "hasMoreAfter",
     "lastSequence"
    ],
    "properties": {
     "size": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "hasMoreBefore": {
      "type": "boolean"
     },
     "hasMoreAfter": {
      "type": "boolean"
     },
     "lastSequence": {
      "type": "integer",
      "minimum": 0
     },
     "lastReadSequence": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "MessagePatch": {
    "type": "object",
    "required": [
     "body"
    ],
    "additionalProperties": false,
    "properties": {
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     }
    }
   },
   "MessagePostRequest": {
    "type": "object",
    "required": [
     "body"
    ],
    "additionalProperties": false,
    "properties": {
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "fileIds": {
      "type": "array",
      "maxItems": 10,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "MessageSearchHit": {
    "type": "object",
    "required": [
     "messageId",
     "conversation",
     "author",
     "postedAt"
    ],
    "properties": {
     "messageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "sequence": {
      "type": "integer",
      "minimum": 1
     },
     "conversation": {
      "type": "object",
      "required": [
       "id",
       "kind",
       "title"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "kind": {
        "$ref": "#/components/schemas/ConversationKind"
       },
       "title": {
        "type": "string",
        "maxLength": 160
       }
      }
     },
     "author": {
      "$ref": "#/components/schemas/MessageAuthorView"
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "excerpt": {
      "type": "string",
      "maxLength": 160,
      "description": "Messages screen only; ⌘K hits carry none."
     }
    }
   },
   "MessageSearchPage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/MessageSearchHit"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "page"
      ],
      "properties": {
       "page": {
        "$ref": "#/components/schemas/CursorPageMeta"
       }
      }
     },
     "links": {
      "$ref": "#/components/schemas/CursorLinks"
     }
    }
   },
   "MessageView": {
    "type": "object",
    "required": [
     "id",
     "conversationId",
     "sequence",
     "author",
     "postedAt",
     "attachments",
     "mentions",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "conversationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "sequence": {
      "type": "integer",
      "minimum": 1
     },
     "author": {
      "$ref": "#/components/schemas/MessageAuthorView"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "mentions": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "ticketRefs": {
      "type": "array",
      "maxItems": 20,
      "description": "XM-937 (minimal; GAP-MSG-04): the tickets that the body's inline ticketRef nodes reference, each once, in body order. A ticket the reader cannot see (or a gone one) is visible false with the key only; the title is absent also when the reader's field mask hides it. Team readers only.",
      "items": {
       "type": "object",
       "required": [
        "key",
        "visible"
       ],
       "additionalProperties": false,
       "properties": {
        "key": {
         "type": "string",
         "pattern": "^[A-Z][A-Z0-9]{1,9}-[1-9][0-9]{0,8}$"
        },
        "visible": {
         "type": "boolean"
        },
        "title": {
         "type": "string",
         "maxLength": 200
        }
       }
      }
     },
     "attachments": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/MessageAttachmentView"
      }
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deleted": {
      "$ref": "#/components/schemas/MessageDeletionView"
     },
     "clientPeriod": {
      "type": "integer",
      "minimum": 1,
      "description": "Project conversations and internal readers only"
     },
     "sharedIntoCurrent": {
      "type": "boolean"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "delete"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ModuleConsequence": {
    "type": "object",
    "required": [
     "changes"
    ],
    "properties": {
     "changes": {
      "type": "array",
      "maxItems": 13,
      "items": {
       "type": "object",
       "required": [
        "module",
        "to",
        "effects"
       ],
       "properties": {
        "module": {
         "$ref": "#/components/schemas/ProjectModuleKey"
        },
        "to": {
         "type": "boolean"
        },
        "effects": {
         "type": "array",
         "maxItems": 10,
         "items": {
          "type": "object",
          "required": [
           "code",
           "count"
          ],
          "properties": {
           "code": {
            "type": "string",
            "enum": [
             "guests_lose_portal",
             "conversation_hidden_from_clients",
             "docs_sessions_close",
             "worklogs_kept",
             "opportunities_kept",
             "board_shows_all_open",
             "chat_hidden",
             "tab_hidden"
            ]
           },
           "count": {
            "type": "integer",
            "minimum": 0
           }
          }
         }
        }
       }
      }
     },
     "errors": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     }
    }
   },
   "Money": {
    "type": "object",
    "description": "An exact amount in one currency. The amount is a decimal string, never a JSON number, so no client loses precision.",
    "required": [
     "amount",
     "currency"
    ],
    "properties": {
     "amount": {
      "type": "string",
      "pattern": "^-?[0-9]{1,15}(\\.[0-9]{1,4})?$",
      "example": "1840.50"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     }
    }
   },
   "MoneyChange": {
    "type": "object",
    "required": [
     "before",
     "after",
     "change"
    ],
    "properties": {
     "before": {
      "$ref": "#/components/schemas/Money"
     },
     "after": {
      "$ref": "#/components/schemas/Money"
     },
     "change": {
      "$ref": "#/components/schemas/Money"
     }
    }
   },
   "MuteRequest": {
    "type": "object",
    "required": [
     "muted"
    ],
    "additionalProperties": false,
    "properties": {
     "muted": {
      "type": "boolean"
     }
    }
   },
   "MyTicketsPage": {
    "type": "object",
    "required": [
     "items",
     "total",
     "overdueCount",
     "dueThisWeekCount"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/DashboardTicketRow"
      }
     },
     "total": {
      "type": "integer",
      "minimum": 0
     },
     "overdueCount": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1114 (G-MT-02; F-WSP-08.R09): the member's open tickets due before their today, over all pages and whatever the filters; a due date counts only where the mask shows it."
     },
     "dueThisWeekCount": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1114 (G-MT-02b; F-WSP-08.R09): the member's open tickets due in their week (pref.weekStart), over all pages and whatever the filters."
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "MyWorkDetail": {
    "type": "object",
    "description": "XM-1135 (G-H-43; F-WSP-08.R08): My tickets only — the typed reason of the \"My work\" detail line, the first that applies in this order: waits_for (the earliest created open blocker that the reader can view, under the Relations mask), client_approval (the ticket's approval request to the client is pending), due (the due date, under the Due date mask), sprint (a sprint that is not completed). Absent when no reason applies. The UI maps the reason to its words; the API sends no free text.",
    "required": [
     "reason"
    ],
    "properties": {
     "reason": {
      "type": "string",
      "enum": [
       "waits_for",
       "client_approval",
       "due",
       "sprint"
      ]
     },
     "ticketKey": {
      "type": "string",
      "maxLength": 30,
      "example": "ORB-119",
      "description": "The blocker's key (reason waits_for only)."
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "sprintName": {
      "type": "string",
      "maxLength": 60,
      "example": "Sprint 14",
      "description": "The sprint's name (reason sprint only)."
     }
    }
   },
   "NamedRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     }
    }
   },
   "NeedsAttentionItem": {
    "type": "object",
    "required": [
     "kind",
     "ticket"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "over_estimate",
       "approval_pending"
      ]
     },
     "ticket": {
      "$ref": "#/components/schemas/DashboardTicketRow"
     },
     "loggedMinutes": {
      "type": "integer",
      "minimum": 0
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "clientName": {
      "type": "string",
      "maxLength": 200
     },
     "since": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "NeedsAttentionPage": {
    "type": "object",
    "required": [
     "items",
     "total"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/NeedsAttentionItem"
      }
     },
     "total": {
      "type": "integer",
      "minimum": 0
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "NewProjectDefaultsRequest": {
    "type": "object",
    "required": [
     "modules",
     "stages",
     "fieldSet",
     "clientVisibleFields",
     "ai",
     "timeline",
     "approvals"
    ],
    "additionalProperties": false,
    "properties": {
     "modules": {
      "type": "object",
      "additionalProperties": {
       "type": "boolean"
      }
     },
     "stages": {
      "type": "array",
      "minItems": 2,
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/StageTemplate"
      }
     },
     "fieldSet": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ProjectFieldEntry"
      }
     },
     "clientVisibleFields": {
      "type": "array",
      "maxItems": 12,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "maxLength": 40
      }
     },
     "ai": {
      "$ref": "#/components/schemas/AiProjectDefaults"
     },
     "timeline": {
      "$ref": "#/components/schemas/NewProjectTimelineDefaultsInput"
     },
     "approvals": {
      "$ref": "#/components/schemas/ApprovalDefaults"
     },
     "ticketTypes": {
      "type": "array",
      "maxItems": 30,
      "description": "Spec BF-1: the data-only type template that Work copies into a new project's catalogue (F-WRK-30.R01; CFL-413); absent means the built-in template.",
      "items": {
       "$ref": "#/components/schemas/TicketTypeTemplateEntry"
      }
     },
     "helpDesk": {
      "$ref": "#/components/schemas/HelpDeskProjectTemplate",
      "description": "XM-1722 (F-PRJ-07.R11): the help-desk template; absent — the saved template stays."
     }
    }
   },
   "NewProjectDefaultsView": {
    "type": "object",
    "required": [
     "version",
     "modules",
     "stages",
     "fieldSet",
     "clientVisibleFields",
     "ai",
     "timeline",
     "approvals",
     "helpDesk"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "modules": {
      "type": "array",
      "maxItems": 13,
      "items": {
       "$ref": "#/components/schemas/ProjectModuleState"
      }
     },
     "stages": {
      "type": "array",
      "minItems": 2,
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/StageTemplate"
      }
     },
     "fieldSet": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ProjectFieldEntry"
      }
     },
     "clientVisibleFields": {
      "type": "array",
      "maxItems": 12,
      "description": "The non-guarded client fields new projects start with (INV-PRJ-18); Spec BF-1 adds the plain client fields type and hierarchy (F-PRJ-07, CFL-414).",
      "items": {
       "type": "string",
       "enum": [
        "title",
        "status",
        "due_date",
        "description",
        "client_comments",
        "shared_attachments",
        "start_date",
        "type",
        "hierarchy"
       ]
      }
     },
     "ai": {
      "$ref": "#/components/schemas/AiProjectDefaults"
     },
     "timeline": {
      "$ref": "#/components/schemas/NewProjectTimelineDefaults"
     },
     "approvals": {
      "$ref": "#/components/schemas/ApprovalDefaults"
     },
     "ticketTypes": {
      "type": "array",
      "maxItems": 30,
      "description": "Spec BF-1: the data-only type template that Work copies into a new project's catalogue (F-WRK-30.R01; CFL-413); absent means the built-in template.",
      "items": {
       "$ref": "#/components/schemas/TicketTypeTemplateEntry"
      }
     },
     "ticketTypesBuiltIn": {
      "type": "boolean",
      "description": "Owner #47 (F-PRJ-07): true when ticketTypes is Work's built-in template (the tenant has none of its own) — a save that leaves ticketTypes out keeps following it."
     },
     "helpDesk": {
      "$ref": "#/components/schemas/HelpDeskProjectTemplate"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedBy": {
      "$ref": "#/components/schemas/MemberRef"
     }
    }
   },
   "NewProjectTimelineDefaults": {
    "type": "object",
    "description": "F-PRJ-07: the Timeline values (D-025, F-PRJ-12) and, since XM-1722 (R15), the Timeline display a new project starts with.",
    "required": [
     "useStartDates",
     "undatedBars",
     "zoom",
     "showWeekends",
     "showDependencies"
    ],
    "properties": {
     "useStartDates": {
      "type": "boolean"
     },
     "undatedBars": {
      "type": "string",
      "enum": [
       "sprint_start",
       "due_date_only"
      ]
     },
     "zoom": {
      "$ref": "#/components/schemas/TimelineZoomKey"
     },
     "showWeekends": {
      "type": "boolean"
     },
     "showDependencies": {
      "type": "boolean"
     }
    }
   },
   "NewProjectTimelineDefaultsInput": {
    "type": "object",
    "description": "The save's Timeline values; XM-1722 (R15): an absent zoom, showWeekends or showDependencies keeps the saved value.",
    "required": [
     "useStartDates",
     "undatedBars"
    ],
    "additionalProperties": false,
    "properties": {
     "useStartDates": {
      "type": "boolean"
     },
     "undatedBars": {
      "type": "string",
      "enum": [
       "sprint_start",
       "due_date_only"
      ]
     },
     "zoom": {
      "$ref": "#/components/schemas/TimelineZoomKey"
     },
     "showWeekends": {
      "type": "boolean"
     },
     "showDependencies": {
      "type": "boolean"
     }
    }
   },
   "NotificationMandatoryRow": {
    "type": "object",
    "description": "XM-1471 (F-NOT-02.R12): an always-sent notice that can reach the reader. Read-only: it is never a matrix row, and the save refuses its type (`notification_preferences.type_not_configurable`, R05). `inApp` and `email` are the registry's channels.",
    "required": [
     "type",
     "labelKey",
     "group",
     "reason",
     "inApp",
     "email"
    ],
    "properties": {
     "type": {
      "$ref": "#/components/schemas/NotificationTypeKey"
     },
     "labelKey": {
      "type": "string",
      "maxLength": 120
     },
     "group": {
      "type": "string",
      "enum": [
       "security",
       "administration",
       "activity"
      ],
      "x-extensible-enum": true
     },
     "reason": {
      "type": "string",
      "enum": [
       "security",
       "system"
      ],
      "x-extensible-enum": true
     },
     "inApp": {
      "type": "boolean"
     },
     "email": {
      "type": "boolean"
     }
    }
   },
   "NotificationPreferenceRow": {
    "type": "object",
    "required": [
     "type",
     "audience",
     "inApp",
     "email",
     "source",
     "locked"
    ],
    "properties": {
     "type": {
      "$ref": "#/components/schemas/NotificationTypeKey"
     },
     "audience": {
      "type": "string",
      "enum": [
       "member",
       "client"
      ]
     },
     "labelKey": {
      "type": "string",
      "maxLength": 120
     },
     "inApp": {
      "type": "boolean"
     },
     "email": {
      "type": "boolean"
     },
     "source": {
      "type": "string",
      "enum": [
       "account",
       "tenant_default",
       "registry"
      ]
     },
     "locked": {
      "type": "object",
      "required": [
       "inApp",
       "email"
      ],
      "properties": {
       "inApp": {
        "type": "boolean"
       },
       "email": {
        "type": "boolean"
       }
      }
     },
     "area": {
      "type": "string",
      "description": "XM-1016 (F-NOT-02.R02): the tab of the preferences page that shows the row. The registry's group table (`PreferenceGroup`) gives it; the SPA names it.",
      "enum": [
       "work",
       "messages",
       "clients",
       "portal"
      ]
     },
     "group": {
      "type": "string",
      "description": "XM-1016 (F-NOT-02.R02): the group of the row inside its tab, in registry order. A type without an entry in the group table is `other` (member) or `portal_other` (client).",
      "enum": [
       "tickets",
       "time",
       "finance",
       "reports",
       "automation",
       "help_desk",
       "conversations",
       "client_approvals",
       "client_activity",
       "portal_approvals",
       "portal_messages",
       "portal_shared",
       "other",
       "portal_other"
      ]
     },
     "default": {
      "type": "object",
      "description": "XM-1042 (F-NOT-02.R03): the channels that \"Reset to default\" gives the row, and their source — the tenant's member default, else the registry. The person's own choice and their e-mail opt-out do not count; the client master switch does.",
      "required": [
       "inApp",
       "email",
       "source"
      ],
      "properties": {
       "inApp": {
        "type": "boolean"
       },
       "email": {
        "type": "boolean"
       },
       "source": {
        "type": "string",
        "enum": [
         "tenant_default",
         "registry"
        ]
       }
      }
     }
    }
   },
   "NotificationPreferencesUpdate": {
    "type": "object",
    "minProperties": 1,
    "properties": {
     "channels": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "type": "object",
       "required": [
        "type",
        "inApp",
        "email"
       ],
       "properties": {
        "type": {
         "$ref": "#/components/schemas/NotificationTypeKey"
        },
        "inApp": {
         "type": "boolean"
        },
        "email": {
         "type": "boolean"
        }
       }
      }
     },
     "resetToDefaults": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "$ref": "#/components/schemas/NotificationTypeKey"
      }
     },
     "digestSchedule": {
      "type": "string",
      "enum": [
       "off_immediate",
       "daily_at_08",
       "weekly_monday"
      ]
     },
     "digestHour": {
      "type": "integer",
      "minimum": 0,
      "maximum": 23
     },
     "quietHours": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/QuietHoursWindow"
       },
       {
        "type": "null"
       }
      ]
     },
     "clientEmailEnabled": {
      "type": "boolean"
     }
    }
   },
   "NotificationPreferencesView": {
    "type": "object",
    "required": [
     "rows",
     "mandatory",
     "digestSchedule",
     "digestHour",
     "registryVersion",
     "version"
    ],
    "properties": {
     "rows": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "$ref": "#/components/schemas/NotificationPreferenceRow"
      }
     },
     "mandatory": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "$ref": "#/components/schemas/NotificationMandatoryRow"
      }
     },
     "digestSchedule": {
      "type": "string",
      "enum": [
       "off_immediate",
       "daily_at_08",
       "weekly_monday"
      ]
     },
     "digestHour": {
      "type": "integer",
      "minimum": 0,
      "maximum": 23
     },
     "quietHours": {
      "$ref": "#/components/schemas/QuietHoursWindow"
     },
     "clientEmailEnabled": {
      "type": "boolean"
     },
     "timeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "registryVersion": {
      "type": "integer",
      "minimum": 1
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "NotificationRow": {
    "type": "object",
    "required": [
     "id",
     "type",
     "actor",
     "target",
     "createdAt",
     "read",
     "lowPriority"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "type": {
      "$ref": "#/components/schemas/NotificationTypeKey"
     },
     "actor": {
      "type": "object",
      "required": [
       "kind",
       "label"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "member",
         "client",
         "system",
         "automation",
         "operator"
        ]
       },
       "label": {
        "type": "string",
        "maxLength": 120,
        "example": "Daniel Hughes"
       },
       "initials": {
        "type": "string",
        "maxLength": 2,
        "example": "DH"
       },
       "ruleName": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "target": {
      "type": "object",
      "required": [
       "type",
       "id",
       "link"
      ],
      "properties": {
       "type": {
        "type": "string",
        "maxLength": 40,
        "example": "ticket"
       },
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "key": {
        "type": "string",
        "maxLength": 40,
        "example": "ORB-124",
        "description": "The key of the target (a ticket key; a doc page's short title). XM-1831 (27 Nov 2026): a support request target (`support_request`) has the request's case reference (`SUP-XXXX-XXXX`, F-PLT-13.R07), read live in one Platform read per page, and only for a reader whom Access allows `administer` on Support access; absent for any other reader."
       },
       "title": {
        "type": "string",
        "maxLength": 200,
        "example": "Storefront search filters",
        "description": "GAP-NOT-01 (the Inbox connect, 22 Nov 2026): the name of the target after its key. A ticket's title is read live under the reader's mask (absent when the mask hides it); a conversation or a document row gives the title it stored. XM-1831: an account recovery target (`account_recovery`) has the name of the member whose account is recovered (the row's `facts.member`)."
       },
       "link": {
        "$ref": "#/components/schemas/RelativeAppPath"
       }
      }
     },
     "project": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "facts": {
      "type": "object",
      "description": "Typed facts per type and registry version; absent when outside the recipient's mask.",
      "maxProperties": 20,
      "additionalProperties": true
     },
     "excerpt": {
      "type": "string",
      "maxLength": 280,
      "example": "Can the reject step ask for a reason?"
     },
     "coalescedCount": {
      "type": "integer",
      "minimum": 1
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "read": {
      "type": "boolean"
     },
     "snoozedUntil": {
      "$ref": "#/components/schemas/Instant"
     },
     "lowPriority": {
      "type": "boolean"
     }
    }
   },
   "NotificationSnoozeRequest": {
    "type": "object",
    "required": [
     "option"
    ],
    "properties": {
     "option": {
      "type": "string",
      "enum": [
       "later_today",
       "tomorrow",
       "next_week",
       "until"
      ]
     },
     "until": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "NotificationTabCount": {
    "type": "object",
    "required": [
     "count",
     "exact"
    ],
    "properties": {
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "exact": {
      "type": "boolean"
     }
    }
   },
   "NotificationTrayMeta": {
    "type": "object",
    "required": [
     "unreadCount",
     "page",
     "digest"
    ],
    "properties": {
     "unreadCount": {
      "type": "integer",
      "minimum": 0,
      "example": 3
     },
     "unreadCountExact": {
      "type": "boolean",
      "description": "false when the badge's bounded scan (1,000 unread candidates) ended with fewer than ten visible rows and more unread rows remain — the count is then a lower bound (REV-XP21-02)."
     },
     "page": {
      "$ref": "#/components/schemas/CursorPageMeta"
     },
     "digest": {
      "type": "string",
      "enum": [
       "off_immediate",
       "daily_at_08",
       "weekly_monday"
      ]
     },
     "snoozedCount": {
      "type": "integer",
      "minimum": 0
     },
     "counts": {
      "type": "object",
      "description": "GAP-NOT-03 (the Inbox connect, 22 Nov 2026): the numbers of the Notifications page's \"Show\" tabs, sent on the first page when the request asks `include=counts`. Each counts the rows of its tab that the reader can still see, up to 99 and within the badge's scan bound (1,000 candidates); `exact` is false when the count is a lower bound (\"99+\"). The filter text does not change them.",
      "required": [
       "all",
       "unread",
       "snoozed"
      ],
      "properties": {
       "all": {
        "$ref": "#/components/schemas/NotificationTabCount"
       },
       "unread": {
        "$ref": "#/components/schemas/NotificationTabCount"
       },
       "snoozed": {
        "$ref": "#/components/schemas/NotificationTabCount"
       }
      }
     }
    }
   },
   "NotificationTypeKey": {
    "type": "string",
    "pattern": "^[a-z][a-z_]*$",
    "maxLength": 60,
    "x-extensible-enum": true,
    "example": "comment_on_my_ticket"
   },
   "OffsetPageMeta": {
    "type": "object",
    "required": [
     "number",
     "size",
     "total",
     "totalPages"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "size": {
      "type": "integer",
      "enum": [
       10,
       20,
       25,
       30,
       50,
       100
      ]
     },
     "total": {
      "type": "integer",
      "minimum": 0
     },
     "totalPages": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "OidcStartRequest": {
    "type": "object",
    "required": [
     "intent"
    ],
    "additionalProperties": false,
    "properties": {
     "intent": {
      "type": "string",
      "enum": [
       "sign_in",
       "invitation",
       "link",
       "step_up",
       "reauthenticate",
       "exit_export",
       "account_recovery"
      ]
     },
     "invitationToken": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true
     },
     "loginHint": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "tenantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "intended": {
      "$ref": "#/components/schemas/RelativeAppPath"
     }
    }
   },
   "OnBehalfLog": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/OnBehalfLogRow"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "nextCursor"
      ],
      "properties": {
       "nextCursor": {
        "type": [
         "string",
         "null"
        ],
        "maxLength": 512
       }
      }
     }
    }
   },
   "OnBehalfLogRow": {
    "type": "object",
    "description": "F-TIM-14.R07 (XM-959): one worklog that a holder of log_time_on_behalf logged, edited or deleted for another member. No `project` when the reader cannot see the project.",
    "required": [
     "id",
     "action",
     "by",
     "for",
     "worklogId",
     "workedOn",
     "minutes",
     "at"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "action": {
      "type": "string",
      "enum": [
       "logged",
       "edited",
       "deleted"
      ]
     },
     "by": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "for": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "worklogId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "workedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "minutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "OnBehalfPeople": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/OnBehalfPerson"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "nextCursor"
      ],
      "properties": {
       "nextCursor": {
        "type": [
         "string",
         "null"
        ],
        "maxLength": 4
       }
      }
     }
    }
   },
   "OnBehalfPerson": {
    "type": "object",
    "description": "F-TIM-14.R06 (XM-959): a person the \"For\" field offers — an active internal member of the holder's on-behalf reach.",
    "required": [
     "member",
     "teamIds"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "jobTitle": {
      "type": "string",
      "maxLength": 80
     },
     "teamIds": {
      "type": "array",
      "maxItems": 200,
      "description": "The teams of the reach that the person is in (every team of the person for the reach `all`).",
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "Operation": {
    "type": "object",
    "description": "A long-running operation (05-api §10.2) — exports above the synchronous limit, imports, large bulk actions.",
    "required": [
     "id",
     "kind",
     "state",
     "progress",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "maxLength": 40,
      "example": "audit_export"
     },
     "state": {
      "type": "string",
      "enum": [
       "queued",
       "running",
       "succeeded",
       "failed",
       "cancelled",
       "withdrawn"
      ],
      "description": "`withdrawn` (XM-244) — the owning module took the operation back (an export a member erasure invalidated): no `result`, no `links`; `error` is the withdrawal's problem (`export.withdrawn`, status 410), never its cause."
     },
     "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "startedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "result": {
      "type": "object",
      "description": "Kind-specific, typed by the owning specification — for an export, the file id, row count and the file's expiry.",
      "additionalProperties": true,
      "properties": {
       "fileId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "rowCount": {
        "type": "integer",
        "minimum": 0
       },
       "expiresAt": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "error": {
      "$ref": "#/components/schemas/Problem"
     },
     "links": {
      "$ref": "#/components/schemas/OperationLinks"
     }
    }
   },
   "OperationLinks": {
    "type": "object",
    "description": "The authorised download of the operation's result file while it has not expired (XM-16) — a navigation that decides again.",
    "properties": {
     "result": {
      "type": "string",
      "maxLength": 2048,
      "example": "/api/v1/files/0192f1a8-7c3e-7b10-9a2e-5d1f0c4b8e21/download?tenant=0192f1a8-7c3e-7b10-9a2e-5d1f0c4b8e33"
     }
    }
   },
   "OperatorInvitationAcceptRequest": {
    "type": "object",
    "required": [
     "token",
     "password"
    ],
    "additionalProperties": false,
    "description": "Acceptance on the console (F-PLT-17.R04, R12; CG-11) — a new account is created with this password and the invitation's name; an existing account of the invited e-mail is verified with it (the login limiter applies). The name is the one the Owner entered, never asked again.",
    "properties": {
     "token": {
      "type": "string",
      "minLength": 43,
      "maxLength": 43,
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true
     },
     "password": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128,
      "writeOnly": true
     }
    }
   },
   "OperatorInvitationToken": {
    "type": "object",
    "required": [
     "token"
    ],
    "properties": {
     "token": {
      "type": "string",
      "minLength": 43,
      "maxLength": 43,
      "pattern": "^[A-Za-z0-9_-]{43}$"
     }
    }
   },
   "OperatorInvitationView": {
    "type": "object",
    "required": [
     "name",
     "email",
     "role",
     "expiresAt",
     "accountExists",
     "invitedBy"
    ],
    "properties": {
     "invitedBy": {
      "type": "object",
      "required": [
       "displayName"
      ],
      "description": "The inviting Owner — \"Priya Natarajan invited you to the Youniton console\" (console surface only; F-PLT-17.R12, CG-11).",
      "properties": {
       "displayName": {
        "$ref": "#/components/schemas/PersonName"
       }
      }
     },
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "role": {
      "$ref": "#/components/schemas/OperatorRoleKey"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "accountExists": {
      "type": "boolean"
     }
    }
   },
   "OperatorRoleKey": {
    "type": "string",
    "enum": [
     "owner",
     "operator",
     "support"
    ]
   },
   "OpportunityBoard": {
    "type": "object",
    "required": [
     "project",
     "summary",
     "columns",
     "decidedWindow",
     "canManage",
     "canContribute"
    ],
    "properties": {
     "project": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "type": "string",
        "maxLength": 10,
        "example": "ORB"
       },
       "name": {
        "type": "string",
        "maxLength": 120,
        "example": "Atlas client portal"
       },
       "archived": {
        "type": "boolean"
       }
      }
     },
     "summary": {
      "$ref": "#/components/schemas/DiscoverySummary"
     },
     "columns": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "items": {
       "$ref": "#/components/schemas/OpportunityColumn"
      }
     },
     "decidedWindow": {
      "type": "string",
      "enum": [
       "recent",
       "all"
      ]
     },
     "canManage": {
      "type": "boolean",
      "description": "discovery_manage on the project, not archived."
     },
     "canContribute": {
      "type": "boolean",
      "description": "discovery_contribute on the project, not archived."
     }
    }
   },
   "OpportunityCard": {
    "type": "object",
    "required": [
     "id",
     "key",
     "stage",
     "title",
     "interviewCount",
     "voteCount",
     "confidence",
     "owner",
     "rank",
     "version",
     "createdBy",
     "votedByMe",
     "contributors"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "description": "OPP-n (F-DSC-01.R13; XM-928); null only for an opportunity of release n − 1 that the one-off backfill has not numbered yet (until XM-966).",
      "oneOf": [
       {
        "$ref": "#/components/schemas/OpportunityKey"
       },
       {
        "type": "null"
       }
      ]
     },
     "stage": {
      "$ref": "#/components/schemas/OpportunityStage"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Clients want to comment on shared documents"
     },
     "interviewCount": {
      "type": "integer",
      "minimum": 0,
      "example": 3
     },
     "voteCount": {
      "type": "integer",
      "minimum": 0,
      "example": 12
     },
     "requestCount": {
      "type": "integer",
      "minimum": 0,
      "example": 2,
      "description": "Spec BF-2 (F-DSC-06)."
     },
     "note": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "prototype with Orbit Retail next week"
     },
     "confidence": {
      "$ref": "#/components/schemas/ConfidenceLevel"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "outcome": {
      "$ref": "#/components/schemas/DecisionOutcome"
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "linkedTicket": {
      "$ref": "#/components/schemas/OpportunityLinkedTicket"
     },
     "rank": {
      "type": "string",
      "maxLength": 64,
      "description": "Opaque; the SPA sorts by it but never computes one."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "createdBy": {
      "$ref": "#/components/schemas/CreatorMemberId",
      "description": "The member who added the opportunity (F-DSC-01.R12; XM-924); the owner can be another member."
     },
     "votedByMe": {
      "type": "boolean",
      "description": "The reader's own vote on this opportunity (F-DSC-01.R14; XM-928); never another member's."
     },
     "contributors": {
      "$ref": "#/components/schemas/OpportunityContributors"
     }
    }
   },
   "OpportunityColumn": {
    "type": "object",
    "required": [
     "stage",
     "count",
     "items"
    ],
    "properties": {
     "stage": {
      "$ref": "#/components/schemas/OpportunityStage"
     },
     "count": {
      "type": "integer",
      "minimum": 0,
      "description": "Every opportunity in the stage, older decisions included (INV-DSC-06)."
     },
     "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/OpportunityCard"
      }
     },
     "olderHidden": {
      "type": "integer",
      "minimum": 0,
      "description": "Decided only — decisions older than 90 days not shown in the recent window (D-120)."
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "OpportunityColumnPage": {
    "type": "object",
    "required": [
     "stage",
     "items"
    ],
    "properties": {
     "stage": {
      "$ref": "#/components/schemas/OpportunityStage"
     },
     "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/OpportunityCard"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "OpportunityContributors": {
    "type": "object",
    "required": [
     "memberIds",
     "total"
    ],
    "description": "The members other than the owner who wrote evidence on the opportunity (F-DSC-01.R14; XM-928), by member id only, the most recent contribution first. An erased member is in neither memberIds nor total.",
    "properties": {
     "memberIds": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Every such member; memberIds shows the first five."
     }
    }
   },
   "OpportunityCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "title"
    ],
    "properties": {
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "ownerId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "confidence": {
      "$ref": "#/components/schemas/ConfidenceLevel"
     },
     "note": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "stage": {
      "type": "string",
      "enum": [
       "opportunity",
       "validating"
      ],
      "default": "opportunity",
      "description": "The open stage of the new card (F-DSC-02.R11; XM-928); decided or another value is 422 opportunity.stage_invalid."
     }
    }
   },
   "OpportunityDecisionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "outcome"
    ],
    "properties": {
     "outcome": {
      "$ref": "#/components/schemas/DecisionOutcome"
     },
     "note": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
     },
     "ticket": {
      "type": "object",
      "description": "Build only. Exactly one of linkTicketKey, createTicket or unlink; absent keeps the current link.",
      "additionalProperties": false,
      "minProperties": 1,
      "maxProperties": 1,
      "properties": {
       "linkTicketKey": {
        "$ref": "#/components/schemas/TicketKey"
       },
       "createTicket": {
        "$ref": "#/components/schemas/TicketCreateRequest"
       },
       "unlink": {
        "type": "boolean",
        "enum": [
         true
        ]
       }
      }
     }
    }
   },
   "OpportunityDecisionResult": {
    "type": "object",
    "required": [
     "opportunity",
     "decision"
    ],
    "properties": {
     "opportunity": {
      "$ref": "#/components/schemas/OpportunityCard"
     },
     "decision": {
      "$ref": "#/components/schemas/OpportunityDecisionView"
     },
     "createdTicketKey": {
      "$ref": "#/components/schemas/TicketKey"
     }
    }
   },
   "OpportunityDecisionView": {
    "type": "object",
    "required": [
     "outcome",
     "decidedAt",
     "decidedBy"
    ],
    "properties": {
     "outcome": {
      "$ref": "#/components/schemas/DecisionOutcome"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decidedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "linkedTicket": {
      "$ref": "#/components/schemas/OpportunityLinkedTicket"
     }
    }
   },
   "OpportunityDetail": {
    "type": "object",
    "required": [
     "card",
     "interviews",
     "votes",
     "createdBy",
     "createdAt",
     "canManage",
     "canContribute"
    ],
    "properties": {
     "card": {
      "$ref": "#/components/schemas/OpportunityCard"
     },
     "projectKey": {
      "type": "string",
      "maxLength": 10,
      "example": "ORB"
     },
     "description": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "decision": {
      "$ref": "#/components/schemas/OpportunityDecisionView"
     },
     "interviews": {
      "type": "object",
      "required": [
       "items"
      ],
      "properties": {
       "items": {
        "type": "array",
        "maxItems": 20,
        "items": {
         "$ref": "#/components/schemas/InterviewNoteView"
        }
       },
       "nextCursor": {
        "type": "string",
        "maxLength": 512
       }
      }
     },
     "votes": {
      "$ref": "#/components/schemas/OpportunityVotes"
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedBy": {
      "$ref": "#/components/schemas/MemberRef",
      "description": "Who wrote the opportunity last — any write: a field, a move, a decision, a note, a vote (owner, 23 Nov 2026: the conflict sentence names the person)."
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "canManage": {
      "type": "boolean"
     },
     "canContribute": {
      "type": "boolean"
     }
    }
   },
   "OpportunityKey": {
    "type": "string",
    "pattern": "^OPP-[1-9][0-9]{0,8}$",
    "example": "OPP-12",
    "description": "The opportunity's short key in its project (F-DSC-01.R13; XM-928) — unique in the project, stable, never used again."
   },
   "OpportunityLinkedTicket": {
    "type": "object",
    "description": "Present only when the viewer can see the ticket now (INV-DSC-10); the title only when the viewer's field mask holds it (STD-ARCH-011).",
    "required": [
     "key"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "stageName": {
      "type": "string",
      "maxLength": 40
     }
    }
   },
   "OpportunityPatch": {
    "type": "object",
    "description": "JSON Merge Patch (05 §3.2); absent members are unchanged, null clears an optional member.",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "description": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/RichTextDocument"
       },
       {
        "type": "null"
       }
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ],
      "minLength": 1,
      "maxLength": 80
     },
     "ownerId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "confidence": {
      "$ref": "#/components/schemas/ConfidenceLevel"
     }
    }
   },
   "OpportunityPositionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "stage"
    ],
    "properties": {
     "stage": {
      "$ref": "#/components/schemas/OpportunityStage"
     },
     "after": {
      "$ref": "#/components/schemas/Uuid"
     },
     "before": {
      "$ref": "#/components/schemas/Uuid"
     },
     "clearDecision": {
      "type": "boolean",
      "default": false,
      "description": "Required true to move a decided opportunity back (D-091)."
     }
    }
   },
   "OpportunityPositionResult": {
    "type": "object",
    "required": [
     "id",
     "stage",
     "rank",
     "version",
     "decisionCleared"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "stage": {
      "$ref": "#/components/schemas/OpportunityStage"
     },
     "rank": {
      "type": "string",
      "maxLength": 64
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "decisionCleared": {
      "type": "boolean"
     }
    }
   },
   "OpportunityPresenceField": {
    "type": "string",
    "description": "The closed set of an opportunity's fields that a presence signal can name (owner, 23 Nov 2026). `interview` = an interview note in the composer (`discovery_contribute`); every other key needs `discovery_manage`.",
    "enum": [
     "title",
     "note",
     "owner",
     "confidence",
     "description",
     "decision",
     "interview"
    ]
   },
   "OpportunityStage": {
    "type": "string",
    "enum": [
     "opportunity",
     "validating",
     "decided"
    ],
    "description": "Board order Opportunities → Validating → Decided (BR-Discovery-02)."
   },
   "OpportunityVoteResult": {
    "type": "object",
    "required": [
     "opportunityId",
     "votes",
     "version"
    ],
    "properties": {
     "opportunityId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "votes": {
      "$ref": "#/components/schemas/OpportunityVotes"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "OpportunityVotes": {
    "type": "object",
    "required": [
     "count",
     "votedByMe",
     "voters"
    ],
    "properties": {
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "votedByMe": {
      "type": "boolean"
     },
     "voters": {
      "type": "array",
      "maxItems": 50,
      "description": "The most recent voters first; the count holds the rest.",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     }
    }
   },
   "OutboundDeliveryView": {
    "type": "object",
    "required": [
     "id",
     "source",
     "status",
     "attempts",
     "createdAt",
     "payloadAvailable"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "rule": {
      "type": "object",
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "source": {
      "type": "object",
      "required": [
       "kind"
      ],
      "description": "What created the delivery. A rule's delivery has the kind `automation_run` and a `runId`. A delivery of a source outside the rules has its kind and the source's id, and no `rule` and no `runId`.",
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "automation_run",
         "help_desk_connection"
        ]
       },
       "id": {
        "$ref": "#/components/schemas/Uuid"
       }
      }
     },
     "eventType": {
      "type": "string",
      "maxLength": 60
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "delivered",
       "retrying",
       "failed",
       "abandoned",
       "suppressed"
      ]
     },
     "suppressedReason": {
      "type": "string",
      "enum": [
       "binding_revoked",
       "endpoint_disabled",
       "endpoint_deleted",
       "endpoint_paused",
       "endpoint_changed",
       "webhooks_disabled",
       "destination_not_allowed",
       "endpoint_not_available",
       "replay_expired",
       "subject_erased",
       "connection_paused",
       "connection_revoked",
       "event_unsubscribed"
      ]
     },
     "attempts": {
      "type": "integer",
      "minimum": 0
     },
     "lastStatusCode": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
     },
     "nextAttemptAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "payloadAvailable": {
      "type": "boolean"
     },
     "payloadSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deliveredAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "OverviewProjectRow": {
    "type": "object",
    "required": [
     "key",
     "name",
     "team",
     "memberCount",
     "openTickets",
     "clientPortal"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string"
     },
     "team": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "memberCount": {
      "type": "integer",
      "minimum": 0
     },
     "openTickets": {
      "type": "integer",
      "minimum": 0
     },
     "clientPortal": {
      "type": "string",
      "enum": [
       "on",
       "off"
      ]
     }
    }
   },
   "ParentChangeRequest": {
    "type": "object",
    "required": [
     "parentKey"
    ],
    "additionalProperties": false,
    "properties": {
     "parentKey": {
      "description": "The new parent's key, or null to remove the parent.",
      "type": [
       "string",
       "null"
      ],
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}-[1-9][0-9]{0,8}$"
     }
    }
   },
   "ParentRef": {
    "type": "object",
    "required": [
     "key"
    ],
    "description": "Spec BF-1 (SR-BF1-01): present only for a ticket that the reader can view. A parent that the reader cannot view is absent, with no key, type or title, as for a ticket without a parent.",
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200,
      "description": "Absent when Title is masked."
     },
     "type": {
      "description": "Absent when Type is masked (SR-BF1-22).",
      "allOf": [
       {
        "$ref": "#/components/schemas/TicketTypeRef"
       }
      ]
     },
     "trashed": {
      "type": "boolean",
      "description": "The parent is in the trash (F-WRK-31.R10)."
     }
    }
   },
   "ParticipantAddRequest": {
    "type": "object",
    "required": [
     "memberIds"
    ],
    "additionalProperties": false,
    "properties": {
     "memberIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 50,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "ParticipantView": {
    "type": "object",
    "required": [
     "member",
     "role",
     "joinedAt"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "role": {
      "type": "string",
      "enum": [
       "owner",
       "member"
      ]
     },
     "joinedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "caption": {
      "type": "string",
      "maxLength": 80,
      "description": "The participant's job title (XM-1053, GAP-MSG-02). Absent when the member has none, or for a former member."
     }
    }
   },
   "PasswordChangeRequest": {
    "type": "object",
    "required": [
     "newPassword"
    ],
    "additionalProperties": false,
    "properties": {
     "currentPassword": {
      "type": "string",
      "maxLength": 128,
      "writeOnly": true,
      "description": "Required unless the session holds a strict account-level stamp; absent when setting a first password."
     },
     "newPassword": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128,
      "writeOnly": true
     }
    }
   },
   "PasswordResetCompleteRequest": {
    "type": "object",
    "required": [
     "token",
     "password"
    ],
    "additionalProperties": false,
    "properties": {
     "token": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true
     },
     "password": {
      "type": "string",
      "minLength": 12,
      "maxLength": 128,
      "writeOnly": true
     }
    }
   },
   "PasswordResetPolicy": {
    "type": "object",
    "required": [
     "passwordMinLength",
     "passwordMaxLength"
    ],
    "additionalProperties": false,
    "description": "XM-1050 (F-IDN-10.R11): the rules of the new password for an open reset link. `passwordMinLength` is the highest `identity.password.minLength` of the account's active memberships (never below 12). No tenant name and no account member.",
    "properties": {
     "passwordMinLength": {
      "type": "integer",
      "minimum": 12,
      "maximum": 128
     },
     "passwordMaxLength": {
      "type": "integer",
      "minimum": 12,
      "maximum": 128
     }
    }
   },
   "PasswordResetPolicyRequest": {
    "type": "object",
    "required": [
     "token"
    ],
    "additionalProperties": false,
    "properties": {
     "token": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true
     }
    }
   },
   "PasswordResetRequest": {
    "type": "object",
    "required": [
     "email"
    ],
    "additionalProperties": false,
    "properties": {
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     }
    }
   },
   "PasswordSignInRequest": {
    "type": "object",
    "required": [
     "email",
     "password"
    ],
    "additionalProperties": false,
    "properties": {
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "password": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "writeOnly": true
     },
     "intended": {
      "$ref": "#/components/schemas/RelativeAppPath"
     }
    }
   },
   "PendingApprovalRow": {
    "type": "object",
    "description": "`organisation` is absent when the reader may not see the client organisation (REV-POR2-02).",
    "required": [
     "request",
     "ticketTitle",
     "projectKey",
     "projectName",
     "since",
     "can"
    ],
    "properties": {
     "request": {
      "$ref": "#/components/schemas/ApprovalRequestView"
     },
     "ticketTitle": {
      "type": "string",
      "maxLength": 200
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "projectName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "The project's name (F-POR-14.R02; G-HD4)."
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "since": {
      "$ref": "#/components/schemas/Instant"
     },
     "can": {
      "type": "object",
      "description": "The row's choices for this reader, decided as the ticket's approval panel decides them (F-POR-14.R04, R08; F-POR-13.R09; G-HD5): `withdraw` for an open request on a project where the member holds `manage_client_sharing`; `remind` also needs the ticket shared now and the reminder cooldown passed. Operators and previews get false. The command decides again (and may still refuse, for example with no eligible reviewer).",
      "required": [
       "remind",
       "withdraw"
      ],
      "properties": {
       "remind": {
        "type": "boolean"
       },
       "withdraw": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "PendingInvitationRow": {
    "type": "object",
    "required": [
     "id",
     "email",
     "audience",
     "role",
     "projects",
     "state",
     "invitedBy",
     "firstSentAt",
     "sentAt",
     "expiresAt",
     "resendCount",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "role": {
      "$ref": "#/components/schemas/RoleRef"
     },
     "team": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "projects": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "id",
        "key",
        "name"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "key": {
         "$ref": "#/components/schemas/ProjectKey"
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "expired",
       "accepted",
       "revoked"
      ],
      "description": "pending is reported as expired once expiresAt has passed, even before the expiry job ran (INV-TEN-03)."
     },
     "invitedBy": {
      "type": "object",
      "required": [
       "displayName"
      ],
      "properties": {
       "displayName": {
        "$ref": "#/components/schemas/PersonName"
       }
      }
     },
     "firstSentAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "sentAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "resendCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5
     },
     "resendAvailableAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deliverability": {
      "type": "string",
      "enum": [
       "ok",
       "bouncing"
      ],
      "description": "bouncing when Notifications suppressed the address (10-… §3.5)."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "resend",
       "revoke"
      ],
      "properties": {
       "resend": {
        "type": "boolean"
       },
       "revoke": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "PeopleCostView": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "actual",
     "provisional",
     "remaining",
     "forecast",
     "counted"
    ],
    "description": "The people cost from the logged time (owner #50, 22 Nov 2026), in the project's currency: actual = the accepted time of the cost ledger × the cost rate (F-FIN-06); provisional = the logged time not accepted yet × the cost rate in force (F-FIN-07.R04; shown apart until the sheet is accepted); remaining = the remaining estimates of the open tickets × the cost rate (R05, R06; null when the reader's mask hides the estimates or the project has more than 10,000 tickets); forecast = actual + provisional + remaining. counted false: the setting finance.peopleCost.source is lines_only, or the currency is not EUR (R12).",
    "properties": {
     "actual": {
      "$ref": "#/components/schemas/Money"
     },
     "provisional": {
      "$ref": "#/components/schemas/Money"
     },
     "remaining": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ]
     },
     "forecast": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ]
     },
     "counted": {
      "type": "boolean"
     }
    }
   },
   "PersonName": {
    "type": "string",
    "minLength": 1,
    "maxLength": 120,
    "example": "Maya Castillo"
   },
   "PersonRatePart": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "rate"
    ],
    "properties": {
     "rate": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/HourlyRate"
       },
       {
        "type": "null"
       }
      ]
     },
     "corrects": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "PersonRolePart": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "deliveryRoleId"
    ],
    "properties": {
     "deliveryRoleId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "PersonSpendingsView": {
    "type": "object",
    "required": [
     "person",
     "lineIds",
     "totals"
    ],
    "properties": {
     "person": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "lineIds": {
      "type": "array",
      "maxItems": 20000,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "totals": {
      "$ref": "#/components/schemas/SpendingTotalsView"
     }
    }
   },
   "PersonalAccessTokenCreate": {
    "type": "object",
    "required": [
     "name",
     "abilities",
     "expiresInDays"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "abilities": {
      "type": "array",
      "minItems": 1,
      "maxItems": 15,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "enum": [
        "projects:read",
        "tickets:read",
        "tickets:write",
        "comments:write",
        "time:read",
        "time:write",
        "docs:read",
        "search:read",
        "relationships:read",
        "relationships:write",
        "memory:read",
        "memory:write",
        "transcripts:read"
       ]
      }
     },
     "memorySegments": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "description": "Optional; only with a memory ability. Narrows the token to these memory segments (F-IDN-26.R12, register §67 point 6).",
      "items": {
       "type": "string",
       "pattern": "^[a-z][a-z0-9_-]{1,39}$"
      }
     },
     "expiresInDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365,
      "description": "30, 90 or 365 days, or the tenant's maximum when it is not one of them, never above the maximum (F-IDN-26.R03; XM-1465). The choices are `meta.policy.expiryChoices` of `listMyTokens`. Above the maximum → `token.expiry_exceeds_policy`; another value → `token.expiry_not_offered`."
     }
    }
   },
   "PersonalAccessTokenCreated": {
    "type": "object",
    "required": [
     "token",
     "plainTextToken"
    ],
    "properties": {
     "token": {
      "$ref": "#/components/schemas/PersonalAccessTokenView"
     },
     "plainTextToken": {
      "type": "string",
      "description": "Shown once; never stored, logged or retrievable again."
     }
    }
   },
   "PersonalAccessTokenView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "preview",
     "abilities",
     "createdAt",
     "expiresAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 60
     },
     "preview": {
      "type": "string",
      "pattern": "^kanso_pat_([A-Za-z0-9]{4}…[A-Za-z0-9]{4})?$",
      "example": "kanso_pat_7Hq2…x9Lm",
      "description": "XM-1014 (G-ACC-05): the masked token — the fixed prefix, the first 4 characters of the secret, an ellipsis and its last 4, stored at creation; never more of the secret (32 of its 40 characters are never stored). A token created before XM-1014 has no stored ends: the preview is the prefix only (`kanso_pat_`)."
     },
     "abilities": {
      "type": "array",
      "maxItems": 15,
      "items": {
       "type": "string"
      }
     },
     "memorySegments": {
      "type": "array",
      "maxItems": 100,
      "description": "The memory segments that the token is narrowed to (F-IDN-26.R12); absent when it acts in all of its member's segments.",
      "items": {
       "type": "string",
       "maxLength": 40
      }
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastUsedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "PinnedProjectHealth": {
    "type": "object",
    "required": [
     "project",
     "note"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/ProjectShortcut"
     },
     "sprint": {
      "type": "object",
      "required": [
       "name",
       "endsOn"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 60,
        "example": "Sprint 14"
       },
       "endsOn": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "goalPercent": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100
       },
       "goalBasis": {
        "type": "string",
        "enum": [
         "tickets",
         "estimated_work"
        ],
        "description": "XM-1121 (P-H-60): what the goal value counts, for the caption \"of tickets completed\" / \"of estimated work completed\". `tickets` when the method is the ticket count or no ticket of the set is estimated; else `estimated_work`. Absent with goalPercent."
       }
      }
     },
     "note": {
      "type": "object",
      "required": [
       "kind"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "waiting_on_client",
         "over_estimate",
         "on_track",
         "no_sprint"
        ]
       },
       "count": {
        "type": "integer",
        "minimum": 1
       }
      }
     }
    }
   },
   "PlanApproveRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "allowUnpriced": {
      "type": "boolean",
      "default": false
     }
    }
   },
   "PlanExpenseLineChange": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "op"
    ],
    "properties": {
     "op": {
      "type": "string",
      "enum": [
       "upsert",
       "delete"
      ]
     },
     "lineId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "categoryId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "teamId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "amount": {
      "$ref": "#/components/schemas/ExpenseAmountInput"
     },
     "quantity": {
      "$ref": "#/components/schemas/SubcontractorQuantity"
     },
     "bill": {
      "$ref": "#/components/schemas/ExpenseAmountInput"
     },
     "supplier": {
      "type": "string",
      "maxLength": 120
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "PlanExpenseLineChangesRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "changes"
    ],
    "properties": {
     "changes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/PlanExpenseLineChange"
      }
     }
    }
   },
   "PlanExpenseLineView": {
    "type": "object",
    "required": [
     "id",
     "category",
     "month",
     "amount"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "category": {
      "$ref": "#/components/schemas/ExpenseCategoryRef"
     },
     "team": {
      "$ref": "#/components/schemas/PlanTeamRef"
     },
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "amount": {
      "$ref": "#/components/schemas/Money"
     },
     "projectAmount": {
      "$ref": "#/components/schemas/Money"
     },
     "quantity": {
      "$ref": "#/components/schemas/SubcontractorQuantity"
     },
     "bill": {
      "$ref": "#/components/schemas/Money"
     },
     "supplier": {
      "type": "string",
      "maxLength": 120
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "unconverted": {
      "type": "boolean",
      "description": "True when no exchange rate is in force for the month's first day."
     }
    }
   },
   "PlanLineChange": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "op"
    ],
    "properties": {
     "op": {
      "type": "string",
      "enum": [
       "upsert",
       "delete"
      ]
     },
     "lineId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "subject": {
      "$ref": "#/components/schemas/PlanSubjectInput"
     },
     "teamId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "plannedMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 44640
     },
     "costOverride": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/HourlyRate"
       },
       {
        "type": "null"
       }
      ]
     },
     "billOverride": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/HourlyRate"
       },
       {
        "type": "null"
       }
      ]
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "PlanLineChangesRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "changes"
    ],
    "properties": {
     "changes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/PlanLineChange"
      }
     }
    }
   },
   "PlanLineView": {
    "type": "object",
    "required": [
     "id",
     "subject",
     "month",
     "plannedMinutes",
     "costRateSource",
     "figures",
     "onProject"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "subject": {
      "$ref": "#/components/schemas/PlanSubjectView"
     },
     "team": {
      "$ref": "#/components/schemas/PlanTeamRef"
     },
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "plannedMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 44640
     },
     "costRate": {
      "$ref": "#/components/schemas/HourlyRate"
     },
     "billRate": {
      "$ref": "#/components/schemas/HourlyRate"
     },
     "costRateSource": {
      "type": "string",
      "enum": [
       "override",
       "project_member",
       "project_role",
       "member",
       "role",
       "none"
      ]
     },
     "figures": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "onProject": {
      "type": "boolean",
      "description": "False for a member line whose member is not an active project member now."
     }
    }
   },
   "PlanSubjectInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "role"
      ]
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "deliveryRoleId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "PlanSubjectView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "role",
       "former_member"
      ]
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "contributors": {
      "type": "integer",
      "minimum": 1,
      "description": "Only for former_member — the number of erased members in the line."
     }
    }
   },
   "PlanTeamRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 80,
      "description": "Deleted team when the team no longer exists."
     }
    }
   },
   "PlanVersionCan": {
    "type": "object",
    "required": [
     "editLines",
     "approve",
     "discard"
    ],
    "properties": {
     "editLines": {
      "type": "boolean"
     },
     "approve": {
      "type": "boolean"
     },
     "discard": {
      "type": "boolean"
     }
    }
   },
   "PlanVersionCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "from"
    ],
    "properties": {
     "from": {
      "type": "string",
      "enum": [
       "empty",
       "baseline",
       "version"
      ]
     },
     "versionNumber": {
      "type": "integer",
      "minimum": 1,
      "description": "Only with from version."
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "PlanVersionEditor": {
    "type": "object",
    "required": [
     "member",
     "added",
     "changed",
     "deleted",
     "lastChangedAt"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "added": {
      "type": "integer",
      "minimum": 0
     },
     "changed": {
      "type": "integer",
      "minimum": 0
     },
     "deleted": {
      "type": "integer",
      "minimum": 0
     },
     "lastChangedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "PlanVersionPatchRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "note"
    ],
    "properties": {
     "note": {
      "oneOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "PlanVersionSummary": {
    "type": "object",
    "required": [
     "id",
     "number",
     "state",
     "currency",
     "totals",
     "lineCount",
     "createdAt",
     "createdBy"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "state": {
      "type": "string",
      "enum": [
       "draft",
       "approved",
       "superseded",
       "discarded"
      ]
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "totals": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "expenseTotals": {
      "$ref": "#/components/schemas/ExpenseFigures"
     },
     "totalCost": {
      "$ref": "#/components/schemas/CombinedFigures"
     },
     "lineCount": {
      "type": "integer",
      "minimum": 0
     },
     "expenseLineCount": {
      "type": "integer",
      "minimum": 0
     },
     "basedOn": {
      "type": "integer",
      "minimum": 1
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "approvedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "approvedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "PlanVersionView": {
    "type": "object",
    "required": [
     "id",
     "number",
     "state",
     "currency",
     "totals",
     "lineCount",
     "createdAt",
     "createdBy",
     "warnings",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "state": {
      "type": "string",
      "enum": [
       "draft",
       "approved",
       "superseded",
       "discarded"
      ]
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "totals": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "expenseTotals": {
      "$ref": "#/components/schemas/ExpenseFigures"
     },
     "totalCost": {
      "$ref": "#/components/schemas/CombinedFigures"
     },
     "lineCount": {
      "type": "integer",
      "minimum": 0
     },
     "expenseLineCount": {
      "type": "integer",
      "minimum": 0
     },
     "basedOn": {
      "type": "integer",
      "minimum": 1
     },
     "ratesAsOf": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "firstMonth": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "lastMonth": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "approvedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "approvedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "warnings": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/Warning"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "$ref": "#/components/schemas/PlanVersionCan"
     },
     "editors": {
      "type": "array",
      "maxItems": 50,
      "description": "Who changed the lines of this version, newest change first (F-FIN-05.R17).",
      "items": {
       "$ref": "#/components/schemas/PlanVersionEditor"
      }
     }
    }
   },
   "PlatformCredentialKind": {
    "type": "string",
    "enum": [
     "google",
     "microsoft",
     "saml_sp",
     "email",
     "email_webhooks",
     "ai"
    ]
   },
   "PointsTotal": {
    "type": "number",
    "minimum": 0,
    "description": "XM-1112 (F-WRK-42.R04): a sum of story points (unpointed tickets count as zero).",
    "example": 21
   },
   "PortalApprovalPanel": {
    "type": "object",
    "required": [
     "requestId",
     "statement",
     "requestedBy",
     "requestedAt",
     "reviewers",
     "documents",
     "canDecide",
     "noteRequiredOnApprove"
    ],
    "properties": {
     "requestId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "statement": {
      "type": "string",
      "maxLength": 200
     },
     "requestedBy": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "requestedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decideBy": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "reviewers": {
      "$ref": "#/components/schemas/PortalReviewerSelectionView"
     },
     "documents": {
      "type": "array",
      "maxItems": 10,
      "description": "The bound documents that the client reads now (tagged for the current client version, a live publication). A page that the reader cannot read is not in the list (hidden equals missing; XM-1669).",
      "items": {
       "$ref": "#/components/schemas/ApprovalDocumentRef"
      }
     },
     "canDecide": {
      "type": "boolean"
     },
     "noteRequiredOnApprove": {
      "type": "boolean"
     }
    }
   },
   "PortalApprovalRow": {
    "type": "object",
    "required": [
     "requestId",
     "ticketKey",
     "requestedBy",
     "requestedAt",
     "canDecide"
    ],
    "properties": {
     "requestId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "ticketKey": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "ticketTitle": {
      "type": "string",
      "maxLength": 200
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "decideBy": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "requestedBy": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "requestedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "canDecide": {
      "type": "boolean"
     },
     "waitingFor": {
      "type": "array",
      "maxItems": 20,
      "description": "The named reviewers when the reader is not one of them — the row is then under \"Waiting for others\" (register §21, CFL-513).",
      "items": {
       "$ref": "#/components/schemas/PortalPersonRef"
      }
     }
    }
   },
   "PortalApprovalsView": {
    "type": "object",
    "required": [
     "awaiting",
     "decided",
     "organisation"
    ],
    "properties": {
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "awaiting": {
      "type": "array",
      "maxItems": 500,
      "description": "The open requests the reader may decide; never paged (D-120; register §21, CFL-513).",
      "items": {
       "$ref": "#/components/schemas/PortalApprovalRow"
      }
     },
     "waitingForOthers": {
      "type": "array",
      "maxItems": 500,
      "description": "The other open requests on visible tickets, with their reviewers; never paged (register §21, CFL-513).",
      "items": {
       "$ref": "#/components/schemas/PortalApprovalRow"
      }
     },
     "decided": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/PortalDecidedRow"
      }
     },
     "decidedTotal": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "PortalAttachRequest": {
    "type": "object",
    "required": [
     "fileId"
    ],
    "additionalProperties": false,
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "PortalBrandingRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "An absent member keeps what is set; `removeLogo` clears the logo, `accentColour` null clears the colour (portal-2).",
    "properties": {
     "logoFileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "accentColour": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^#[0-9a-f]{6}$"
     },
     "removeLogo": {
      "type": "boolean"
     }
    }
   },
   "PortalBrandingView": {
    "type": "object",
    "required": [
     "version"
    ],
    "properties": {
     "logoUrl": {
      "type": "string",
      "maxLength": 2048,
      "description": "The authorised inline download URL of the logo (`/files/{id}/download?tenant=…&disposition=inline`, Files decides through Portal's read policy); absent without a logo."
     },
     "logoFileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "accentColour": {
      "type": "string",
      "pattern": "^#[0-9a-f]{6}$",
      "example": "#1f5f8b"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "PortalCommentFile": {
    "type": "object",
    "required": [
     "attachmentId",
     "fileId",
     "name",
     "sizeBytes",
     "mimeType",
     "status"
    ],
    "description": "XM-980 (F-WRK-26): a file of a client-thread reply as a client reads it. quarantined: the file failed the scan — shown blocked, never downloaded.",
    "properties": {
     "attachmentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1
     },
     "mimeType": {
      "type": "string",
      "maxLength": 127
     },
     "durationSeconds": {
      "type": "integer",
      "minimum": 0
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "scanning",
       "ready",
       "quarantined"
      ]
     }
    }
   },
   "PortalContact": {
    "type": "object",
    "required": [
     "person",
     "roleName",
     "tenantName",
     "canMessage"
    ],
    "properties": {
     "person": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "roleName": {
      "type": "string",
      "maxLength": 60,
      "example": "Product manager"
     },
     "tenantName": {
      "type": "string",
      "maxLength": 120
     },
     "canMessage": {
      "type": "boolean",
      "description": "The Client messages module is available and the client role holds message (F-POR-18)."
     }
    }
   },
   "PortalConversationEntry": {
    "type": "object",
    "required": [
     "kind",
     "at",
     "author"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "comment",
       "decision"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     },
     "author": {
      "type": "object",
      "required": [
       "displayName",
       "organisation"
      ],
      "properties": {
       "displayName": {
        "type": "string",
        "maxLength": 120
       },
       "organisation": {
        "type": "string",
        "maxLength": 200,
        "description": "The tenant name for members, the client organisation for guests."
       },
       "you": {
        "type": "boolean"
       }
      }
     },
     "body": {
      "type": "string",
      "maxLength": 10000,
      "description": "Plain text of a comment; absent for a deleted comment."
     },
     "files": {
      "type": "array",
      "maxItems": 10,
      "description": "XM-980 (F-WRK-26): the reply's files, oldest first; absent when none. Download each through GET /files/{fileId}/download.",
      "items": {
       "$ref": "#/components/schemas/PortalCommentFile"
      }
     },
     "outcome": {
      "type": "string",
      "enum": [
       "approved",
       "changes_requested"
      ]
     },
     "note": {
      "type": "string",
      "maxLength": 2000
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deleted": {
      "type": "boolean",
      "description": "A comment deleted by its author renders as \"Comment deleted\" with the author and time (F-WRK-21.R09)."
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "The comment's version for If-Match on an edit or deletion of one's own reply (F-POR-09)."
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "delete"
      ],
      "properties": {
       "edit": {
        "type": "boolean",
        "description": "The reader's own reply that is still inside work.commentEditWindowMinutes."
       },
       "delete": {
        "type": "boolean",
        "description": "The reader's own reply that is not deleted yet."
       }
      }
     }
    }
   },
   "PortalConversationFacts": {
    "type": "object",
    "required": [
     "id",
     "title",
     "realtimeChannel",
     "project",
     "can",
     "unreadCount"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "maxLength": 160,
      "example": "Northwind team · Orbit Retail"
     },
     "realtimeChannel": {
      "type": "string",
      "maxLength": 200
     },
     "project": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "unreadCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99
     },
     "readOnly": {
      "type": "boolean"
     },
     "can": {
      "type": "object",
      "required": [
       "post",
       "attach"
      ],
      "properties": {
       "post": {
        "type": "boolean"
       },
       "attach": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "PortalCustomFieldValueMap": {
    "type": "object",
    "description": "The client's custom field values of a ticket, keyed by the stable field key (F-POR-08.R07; F-WRK-27.R04). Each value is `{type, value}` as `CustomFieldValue`, except a `member` value: it is a `PortalPersonRef` in the ticket's scope, never a member id (INV-POR-15).",
    "maxProperties": 50,
    "additionalProperties": {
     "type": "object",
     "required": [
      "type",
      "value"
     ],
     "properties": {
      "type": {
       "type": "string",
       "enum": [
        "short_text",
        "long_text",
        "number",
        "date",
        "single_select",
        "multi_select",
        "member",
        "url",
        "checkbox"
       ]
      },
      "value": {
       "description": "short_text/long_text/url: string; number: decimal string with scale 0–4; date: DateOnly; single_select: {id, label}; multi_select: [{id, label}] (1–20); member: PortalPersonRef; checkbox: boolean."
      }
     }
    }
   },
   "PortalDecidedRow": {
    "type": "object",
    "required": [
     "requestId",
     "ticketKey",
     "requestedBy",
     "requestedAt",
     "outcome",
     "decidedBy",
     "decidedAt",
     "ticketVisible"
    ],
    "properties": {
     "requestId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "ticketKey": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "ticketTitle": {
      "type": "string",
      "maxLength": 200
     },
     "requestedBy": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "requestedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "outcome": {
      "type": "string",
      "enum": [
       "approved",
       "changes_requested"
      ]
     },
     "decidedBy": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "note": {
      "type": "string",
      "maxLength": 2000
     },
     "ticketVisible": {
      "type": "boolean"
     }
    }
   },
   "PortalDocSearchHit": {
    "type": "object",
    "required": [
     "pageId",
     "title",
     "publishedAt"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The revision's frozen title."
     },
     "spaceName": {
      "type": "string",
      "maxLength": 200,
      "description": "Present for a page of a linked tenant or team space."
     },
     "parentPath": {
      "type": "array",
      "maxItems": 49,
      "items": {
       "type": "string",
       "maxLength": 200
      }
     },
     "snippet": {
      "type": "string",
      "maxLength": 300,
      "description": "From the published revision only; absent when docs.search.snippets is off."
     },
     "publishedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "PortalDocSpace": {
    "type": "object",
    "required": [
     "spaceId",
     "name",
     "pageCount"
    ],
    "properties": {
     "spaceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "description": {
      "type": "string",
      "maxLength": 500
     },
     "pageCount": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "PortalDocSpacePage": {
    "type": "object",
    "required": [
     "pageId",
     "spaceId",
     "title",
     "revision",
     "publishedAt",
     "body",
     "commentsOpen"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "spaceId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "revision": {
      "type": "integer",
      "minimum": 1
     },
     "publishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "sharedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "commentsOpen": {
      "type": "boolean",
      "description": "The client may comment (docs.comments.clientComments and the space's clientComments)."
     }
    }
   },
   "PortalDocSpacePageRow": {
    "type": "object",
    "required": [
     "pageId",
     "title",
     "publishedAt"
    ],
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The revision's frozen title."
     },
     "parentPath": {
      "type": "array",
      "maxItems": 49,
      "description": "The titles of the client-visible ancestors only; a hidden ancestor is left out.",
      "items": {
       "type": "string",
       "maxLength": 200
      }
     },
     "publishedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "PortalDocument": {
    "type": "object",
    "required": [
     "docPageId",
     "title",
     "revision",
     "publishedAt",
     "body"
    ],
    "properties": {
     "docPageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "revision": {
      "type": "integer",
      "minimum": 1
     },
     "publishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "sharedBy": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     }
    }
   },
   "PortalDocumentRow": {
    "type": "object",
    "required": [
     "docPageId",
     "title",
     "publishedAt",
     "sharedBy"
    ],
    "properties": {
     "docPageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "maxLength": 200,
      "description": "Shared children carry their parent's title as a prefix (D-006)."
     },
     "parentTitle": {
      "type": "string",
      "maxLength": 200
     },
     "publishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "sharedBy": {
      "$ref": "#/components/schemas/PortalPersonRef"
     }
    }
   },
   "PortalDocumentsView": {
    "type": "object",
    "required": [
     "documentsAvailable",
     "documents",
     "files",
     "documentsTotal",
     "filesTotal"
    ],
    "properties": {
     "documentsAvailable": {
      "type": "boolean",
      "description": "false with the Docs module off or a role without client-tagged pages; the Files panel stays (D-033)."
     },
     "documents": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/PortalDocumentRow"
      }
     },
     "documentsTotal": {
      "type": "integer",
      "minimum": 0
     },
     "documentsNext": {
      "type": "string",
      "maxLength": 512
     },
     "files": {
      "type": "array",
      "maxItems": 25,
      "items": {
       "$ref": "#/components/schemas/PortalFile"
      }
     },
     "filesTotal": {
      "type": "integer",
      "minimum": 0
     },
     "filesNext": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "PortalFile": {
    "type": "object",
    "required": [
     "attachmentId",
     "fileId",
     "name",
     "sizeBytes",
     "mimeType",
     "uploadedAt",
     "uploader",
     "addedByYou",
     "status"
    ],
    "properties": {
     "attachmentId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
     },
     "sizeBytes": {
      "$ref": "#/components/schemas/ByteCount"
     },
     "mimeType": {
      "type": "string",
      "maxLength": 127
     },
     "durationSeconds": {
      "type": "integer",
      "minimum": 0
     },
     "uploadedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "uploader": {
      "type": "object",
      "required": [
       "displayName"
      ],
      "properties": {
       "displayName": {
        "type": "string",
        "maxLength": 120
       },
       "organisation": {
        "type": "string",
        "maxLength": 200
       }
      }
     },
     "addedByYou": {
      "type": "boolean"
     },
     "status": {
      "type": "string",
      "enum": [
       "scanning",
       "ready",
       "quarantined"
      ]
     },
     "ticketKey": {
      "$ref": "#/components/schemas/TicketKey"
     }
    }
   },
   "PortalMessageAuthorView": {
    "type": "object",
    "required": [
     "kind",
     "name"
    ],
    "description": "The author of a message as a client reads them (F-MSG-04.R10; portal INV-POR-15; XM-1061): `person` and `onBehalfOf` are `PortalPersonRef`s in the conversation's scope, never a member id — also not the reader's own; `you` marks the reader's own message.",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "client",
       "automation"
      ]
     },
     "person": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "name": {
      "type": "string",
      "maxLength": 120,
      "example": "Lena Ruiz"
     },
     "organisation": {
      "type": "string",
      "maxLength": 120,
      "description": "The client organisation of a client author",
      "example": "Orbit Retail"
     },
     "automationRule": {
      "type": "string",
      "maxLength": 120
     },
     "onBehalfOf": {
      "$ref": "#/components/schemas/PortalPersonRef"
     },
     "you": {
      "type": "boolean"
     }
    }
   },
   "PortalMessagePage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/PortalMessageView"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "conversation",
       "size",
       "hasMoreBefore",
       "hasMoreAfter"
      ],
      "properties": {
       "conversation": {
        "$ref": "#/components/schemas/PortalConversationFacts"
       },
       "size": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100
       },
       "hasMoreBefore": {
        "type": "boolean"
       },
       "hasMoreAfter": {
        "type": "boolean"
       },
       "lastCursor": {
        "type": "string",
        "maxLength": 256
       }
      }
     }
    }
   },
   "PortalMessageView": {
    "type": "object",
    "required": [
     "id",
     "cursor",
     "author",
     "postedAt",
     "attachments",
     "version",
     "can"
    ],
    "description": "What a client sees — cursors instead of sequences, no mention directory, no period number.",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "cursor": {
      "type": "string",
      "maxLength": 256,
      "description": "An opaque signed token; the client never sees a sequence."
     },
     "author": {
      "$ref": "#/components/schemas/PortalMessageAuthorView"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "attachments": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/MessageAttachmentView"
      }
     },
     "postedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "deleted": {
      "$ref": "#/components/schemas/MessageDeletionView"
     },
     "sharedEarlier": {
      "type": "boolean",
      "description": "True for a message shared into this period from an earlier one."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "delete"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "PortalOverview": {
    "type": "object",
    "required": [
     "project",
     "tenantName",
     "organisation",
     "portalCount",
     "status",
     "waiting",
     "recentlyUpdated"
    ],
    "properties": {
     "project": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "tenantName": {
      "type": "string",
      "maxLength": 120
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "sprint": {
      "type": "object",
      "description": "Absent with no active sprint or the Backlog & sprints module off (D-092).",
      "required": [
       "name",
       "endsOn"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 60
       },
       "endsOn": {
        "$ref": "#/components/schemas/DateOnly"
       }
      }
     },
     "portalCount": {
      "type": "integer",
      "minimum": 1
     },
     "status": {
      "type": "object",
      "required": [
       "inProgress",
       "awaitingApproval",
       "awaitingApprovalCapped",
       "doneThisMonth"
      ],
      "properties": {
       "inProgress": {
        "type": "integer",
        "minimum": 0
       },
       "awaitingApproval": {
        "type": "integer",
        "minimum": 0,
        "maximum": 500,
        "description": "The lines of \"waiting\" (the reader's \"Waiting for you\" queue)."
       },
       "awaitingApprovalCapped": {
        "type": "boolean",
        "description": "True when the project has more open requests of the current client than the never-paged queue reads (500, D-120), all on tickets the reader sees: awaitingApproval is then a lower bound, and the overview shows \"n+\" (XM-1069). A request on a hidden ticket never sets it (XM-1503)."
       },
       "doneThisMonth": {
        "type": "integer",
        "minimum": 0
       },
       "doneThisMonthCapped": {
        "type": "boolean"
       }
      }
     },
     "waiting": {
      "type": "array",
      "maxItems": 500,
      "description": "\"Waiting for you\": the open requests on visible tickets the reader may decide, newest first; never paged (D-120; register §21, CFL-513).",
      "items": {
       "$ref": "#/components/schemas/PortalApprovalRow"
      }
     },
     "waitingForOthers": {
      "type": "array",
      "maxItems": 500,
      "description": "\"Waiting for others\": the other open requests on visible tickets, each with waitingFor (register §21, CFL-513).",
      "items": {
       "$ref": "#/components/schemas/PortalApprovalRow"
      }
     },
     "contact": {
      "$ref": "#/components/schemas/PortalContact"
     },
     "recentlyUpdated": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/PortalTicketRow"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "decide",
       "message"
      ],
      "properties": {
       "decide": {
        "type": "boolean"
       },
       "message": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "PortalPersonRef": {
    "type": "object",
    "description": "A person as a client reads them (INV-POR-15; XM-1061; F-HLP-03.R14): the display data and an opaque `ref`, never a member id. The `ref` is the same for one person in one scope (the ticket; the project for the contact; the document page; the conversation) and different in every other scope and tenant. Use it only as a key inside the response (an avatar tone, a list key). No request takes it. A rotation of the application key changes every `ref` once. The server never stores a `ref` and never reads one back, so nothing breaks: only the avatar tones change. `app.previous_keys` is not used.",
    "required": [
     "ref",
     "displayName",
     "initials",
     "former"
    ],
    "additionalProperties": false,
    "properties": {
     "ref": {
      "type": "string",
      "pattern": "^pp\\.[0-9a-f]{32}$",
      "example": "pp.6f1c0e3b9a4d47e2b8c5d0a1f2e3d4c5"
     },
     "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Lena Ruiz"
     },
     "initials": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2,
      "example": "LR"
     },
     "former": {
      "type": "boolean",
      "description": "True for a removed member, an erased member and a member who is not in the directory: the name is \"Former member\" and the initials are FM. The owner's rule (register §229 item 17, Q17): a removed (not erased) member shows to clients as \"Former member\" everywhere. Every client read applies Tenancy's one rule `MemberRef::summary` (XM-1094)."
     }
    }
   },
   "PortalPriority": {
    "type": "object",
    "required": [
     "key",
     "name",
     "colour",
     "rank"
    ],
    "description": "XM-1092 (owner Q5, register §229 item 7): the ticket's priority, only while the client's mask (role ∩ the project's client-sharing policy) shows the guarded field priority — absent otherwise. The entry of the tenant's vocabulary (F-WRK-40).",
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{0,39}$",
      "example": "high"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "High"
     },
     "colour": {
      "$ref": "#/components/schemas/PriorityColour"
     },
     "rank": {
      "type": "integer",
      "minimum": 0,
      "maximum": 20,
      "description": "The position in the tenant's vocabulary, 0 = the lowest; 20 for a key the vocabulary does not hold."
     }
    }
   },
   "PortalReadMarkRequest": {
    "type": "object",
    "required": [
     "cursor"
    ],
    "additionalProperties": false,
    "properties": {
     "cursor": {
      "type": "string",
      "maxLength": 256
     }
    }
   },
   "PortalRealtimeConnection": {
    "type": "object",
    "description": "The Reverb connection the portal shell opens (the portal reads no workspace session document — INV-WRK-24); the same values as the workspace session's realtime block.",
    "required": [
     "key",
     "host",
     "port",
     "scheme"
    ],
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 64
     },
     "host": {
      "type": "string",
      "maxLength": 200
     },
     "port": {
      "type": "integer",
      "minimum": 1,
      "maximum": 65535
     },
     "scheme": {
      "type": "string",
      "enum": [
       "wss",
       "ws"
      ],
      "description": "`wss` in every deployed environment; `ws` only for the local Reverb (12-operations §10.4); derived from the deployment configuration (CG-15)."
     }
    }
   },
   "PortalRef": {
    "type": "object",
    "required": [
     "tenantId",
     "tenantSlug",
     "tenantName",
     "teamMask",
     "projectId",
     "projectKey",
     "projectName",
     "memberId",
     "organisation",
     "current"
    ],
    "properties": {
     "tenantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "tenantSlug": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
      "example": "northwind"
     },
     "tenantName": {
      "type": "string",
      "maxLength": 120,
      "example": "Northwind Group"
     },
     "teamMask": {
      "description": "The tenant's client-facing team label every portal page uses for masked people and its notices (\"Only tickets the Northwind team has shared…\") — shared kernel ClientTeamLabelPolicy (D-002; CG-07).",
      "allOf": [
       {
        "$ref": "#/components/schemas/ClientTeamLabel"
       }
      ]
     },
     "projectId": {
      "description": "Names the portal's client channel private-tenant.{tenantId}.project.{projectId}.client (08 §6.2; F-POR-01.R09).",
      "allOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       }
      ]
     },
     "memberId": {
      "description": "The guest's own MemberId in this tenant; names their user channel private-tenant.{tenantId}.user.{memberId}. Never another person's id.",
      "allOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       }
      ]
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "projectName": {
      "type": "string",
      "maxLength": 120,
      "example": "Atlas client portal"
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "current": {
      "type": "boolean",
      "description": "The last-used portal."
     },
     "lastVisitedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "PortalReplyRequest": {
    "type": "object",
    "required": [
     "body"
    ],
    "additionalProperties": false,
    "properties": {
     "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000,
      "example": "Can the reject step ask for a reason?"
     },
     "fileIds": {
      "type": "array",
      "maxItems": 10,
      "uniqueItems": true,
      "description": "XM-980 (F-WRK-26): a new reply's files — the guest's own completed uploads for comment_draft(ticket, client). Each other file answers 422 attachment.file_not_attachable at /fileIds/n. An edit takes none.",
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "PortalReviewerSelectionView": {
    "type": "object",
    "required": [
     "mode"
    ],
    "description": "The reviewers of a request as a client reads them (F-POR-11; INV-POR-15) — named guests as `PortalPersonRef`, never their member ids.",
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "any_project_guest",
       "named"
      ]
     },
     "named": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/PortalPersonRef"
      }
     }
    }
   },
   "PortalTicket": {
    "type": "object",
    "required": [
     "id",
     "key",
     "status",
     "assignee",
     "files",
     "conversationCount",
     "regions",
     "notices",
     "can"
    ],
    "properties": {
     "id": {
      "description": "The ticket's id — the `target.id` of the upload intent of \"Add a file\" (`startUpload` with purpose `attachment`, target type `ticket`; F-POR-10 §5; G-PP1). It names only this ticket, which the reader already sees.",
      "allOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       }
      ]
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "status": {
      "$ref": "#/components/schemas/ClientStageView"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "assignee": {
      "type": "object",
      "required": [
       "displayName"
      ],
      "properties": {
       "displayName": {
        "type": "string",
        "maxLength": 120
       },
       "person": {
        "$ref": "#/components/schemas/PortalPersonRef"
       }
      }
     },
     "priority": {
      "$ref": "#/components/schemas/PortalPriority"
     },
     "reporter": {
      "description": "XM-1092 (\"Requested by\"; owner Q5): the reporter — the creator unless another member was named (F-WRK-23.R16) — only while the client's mask shows the guarded field reporter. The portal's person form: never a member id or an e-mail.",
      "allOf": [
       {
        "$ref": "#/components/schemas/PortalPersonRef"
       }
      ]
     },
     "description": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "sharedAt": {
      "description": "XM-975 (\"Opened\"; coordinator, 23 Nov 2026): the instant the ticket was shared with the current client (its client visibility under the current exposure stamp). Never the creation instant or `updatedAt` (F-ACC-04.R10): nothing from before the share.",
      "allOf": [
       {
        "$ref": "#/components/schemas/Instant"
       }
      ]
     },
     "lastUpdate": {
      "description": "XM-975 (\"Updated\"): the last client-visible update of the ticket for this reader (INV-POR-11), as on its list row.",
      "allOf": [
       {
        "$ref": "#/components/schemas/PortalUpdateLine"
       }
      ]
     },
     "updates": {
      "type": "array",
      "maxItems": 10,
      "description": "XM-976 (the Activity frame): the ticket's client-visible updates for this reader, newest first — each row whose required field the reader's mask holds (INV-POR-11). Never the internal history (INV-ACC-03).",
      "items": {
       "$ref": "#/components/schemas/PortalUpdateLine"
      }
     },
     "type": {
      "type": "object",
      "description": "Spec BF-1 (CFL-414, register §63 item 8): the ticket type, while the project's client policy shows `type` (F-POR-08.R12).",
      "required": [
       "name"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 40
       },
       "icon": {
        "type": "string",
        "maxLength": 20
       }
      }
     },
     "hierarchy": {
      "type": "object",
      "description": "Spec BF-1: the parent and the children that are client visible to the reader, while the client policy shows `hierarchy` (F-POR-08.R12; F-WRK-31.R17). `children` holds at most 50 children in rank order. It is an empty list when no child is visible. A hidden parent or child gives no key, no title and no count.",
      "required": [
       "children"
      ],
      "properties": {
       "parent": {
        "type": "object",
        "required": [
         "key"
        ],
        "properties": {
         "key": {
          "$ref": "#/components/schemas/TicketKey"
         },
         "title": {
          "type": "string",
          "maxLength": 200
         }
        }
       },
       "children": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "type": "object",
         "required": [
          "key"
         ],
         "properties": {
          "key": {
           "$ref": "#/components/schemas/TicketKey"
          },
          "title": {
           "type": "string",
           "maxLength": 200
          },
          "status": {
           "$ref": "#/components/schemas/ClientStageView"
          }
         }
        }
       },
       "childrenMore": {
        "type": "boolean",
        "description": "True when more than the 50 listed children are client visible to the reader (KDC-07; BF1-PORTAL); absent otherwise. It counts only visible children."
       }
      }
     },
     "guarded": {
      "type": "object",
      "description": "The guarded client fields an Admin enabled for the project and the role allows (D-002); each absent otherwise.",
      "properties": {
       "relations": {
        "type": "array",
        "maxItems": 100,
        "description": "Spec BF-1 (CFL-414): the relations between this ticket and other tickets that are client visible to the reader, grouped by phrase; never the reason or the owner.",
        "items": {
         "type": "object",
         "required": [
          "phrase",
          "key"
         ],
         "properties": {
          "phrase": {
           "type": "string",
           "maxLength": 40
          },
          "key": {
           "$ref": "#/components/schemas/TicketKey"
          },
          "title": {
           "type": "string",
           "maxLength": 200
          }
         }
        }
       },
       "estimateMinutes": {
        "type": "integer",
        "minimum": 0
       },
       "timeLogged": {
        "type": "object",
        "description": "Time's `ClientTimeQuery` for this reader (INV-TIM-10; F-TIM-07.R07) — absent while the level is hidden. Totals levels carry one period per calendar month or timesheet period, newest first, and their sum; `entries` carries the newest entries (a date, minutes, the person only where the assignee is shown to clients, never a note) — at Time's bound of 100 `entriesCapped` is true and `totalMinutes` is absent, because a sum of the newest entries is not the ticket's time (KDC-07; XP-16).",
        "required": [
         "level"
        ],
        "properties": {
         "level": {
          "type": "string",
          "enum": [
           "monthly_totals",
           "weekly_totals",
           "entries"
          ]
         },
         "totalMinutes": {
          "type": "integer",
          "minimum": 0
         },
         "periods": {
          "type": "array",
          "maxItems": 20000,
          "items": {
           "type": "object",
           "required": [
            "from",
            "to",
            "minutes"
           ],
           "properties": {
            "from": {
             "$ref": "#/components/schemas/DateOnly"
            },
            "to": {
             "$ref": "#/components/schemas/DateOnly"
            },
            "minutes": {
             "type": "integer",
             "minimum": 0
            }
           }
          }
         },
         "entries": {
          "type": "array",
          "maxItems": 100,
          "items": {
           "type": "object",
           "required": [
            "workedOn",
            "minutes"
           ],
           "properties": {
            "workedOn": {
             "$ref": "#/components/schemas/DateOnly"
            },
            "minutes": {
             "type": "integer",
             "minimum": 0
            },
            "person": {
             "$ref": "#/components/schemas/PortalPersonRef"
            }
           }
          }
         },
         "entriesCapped": {
          "type": "boolean"
         }
        }
       },
       "labels": {
        "type": "array",
        "maxItems": 20,
        "description": "The ticket's labels by name (id, name, colour; `archived` for an archived label still on the ticket, shown muted) — present while the reader's mask shows labels, empty when the ticket has none (F-POR-08.R07; XM-153).",
        "items": {
         "$ref": "#/components/schemas/LabelRef"
        }
       },
       "mergeRequests": {
        "type": "array",
        "maxItems": 50,
        "description": "The linked merge requests, most recently changed first — the reference and the state only (never the title, repository, URL or a person) — present while the reader's mask shows merge requests, empty when none are linked (F-POR-08.R07; XM-153). The portal never sends a chip's `more` (the workspace card's \"+n\"): the total beyond the 50 listed is `mergeRequestsMore` (XM-214, REV-SPG-06).",
        "items": {
         "$ref": "#/components/schemas/MergeRequestChip"
        }
       },
       "mergeRequestsMore": {
        "type": "boolean",
        "description": "True when the ticket has more linked merge requests than the 50 listed — Integrations' exact total, kept by Work's projection (KDC-07; XM-213); absent otherwise."
       }
      }
     },
     "customFields": {
      "$ref": "#/components/schemas/PortalCustomFieldValueMap"
     },
     "customFieldLabels": {
      "type": "array",
      "maxItems": 50,
      "description": "The name of each field of `customFields`, in the order of the project's field set (F-POR-08.R07; register §175: the spec's control stays although the design does not show it; G-PP2). Present with `customFields` only, and only for the fields it holds: a field the client may not read is never named.",
      "items": {
       "type": "object",
       "required": [
        "key",
        "name"
       ],
       "properties": {
        "key": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,39}$"
        },
        "name": {
         "type": "string",
         "minLength": 1,
         "maxLength": 60
        }
       }
      }
     },
     "files": {
      "type": "object",
      "description": "The ticket's attachments Shared with client under the current client version while the reader's mask shows shared attachments (F-POR-08.R04) — otherwise zero counts and no items. The counts are exact; the items are the newest 100, `more` when older ones exist (they stay listed in Documents › Files; KDC-07).",
      "required": [
       "sharedByTeam",
       "addedByYou",
       "addedByOthers",
       "items"
      ],
      "properties": {
       "sharedByTeam": {
        "type": "integer",
        "minimum": 0
       },
       "addedByYou": {
        "type": "integer",
        "minimum": 0
       },
       "addedByOthers": {
        "type": "integer",
        "minimum": 0,
        "description": "Client uploads by anyone but the reader — the reader's colleague guests (in a preview, every client upload). The three counts partition the shared files the reader may see; `items` is the newest 100 of them as Files still holds them (XM-153; REV-XP16-10). Always sent (XM-214, REV-SPG-03); the SPA renders it with UI part 2."
       },
       "items": {
        "type": "array",
        "maxItems": 100,
        "items": {
         "$ref": "#/components/schemas/PortalFile"
        }
       },
       "more": {
        "type": "boolean"
       }
      }
     },
     "conversationCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The exact total of the conversation: the client-thread comments and the decision entries the reader sees (F-POR-08.R06). It is 0 while `regions.conversation` is false: the region is absent and nothing of it is counted (F-POR-08.R05; REV-BHP-02)."
     },
     "regions": {
      "type": "object",
      "description": "Whether the Files and the Conversation regions exist for this reader (F-POR-08.R04, R05, S02; XM-749). The reader's mask decides: the client role ∩ the project's client policy (in View as client the previewed role ∩ the member) shows shared attachments (`files`) and client comments (`conversation`). A false region is absent, not empty: the SPA does not render it, its counts are zero and its lists are empty. The flag tells nothing more about what the mask hides (KDC-04).",
      "required": [
       "files",
       "conversation"
      ],
      "properties": {
       "files": {
        "type": "boolean"
       },
       "conversation": {
        "type": "boolean"
       }
      }
     },
     "approval": {
      "$ref": "#/components/schemas/PortalApprovalPanel"
     },
     "notices": {
      "type": "array",
      "maxItems": 3,
      "items": {
       "type": "string",
       "enum": [
        "internal_notes_withheld"
       ]
      }
     },
     "can": {
      "type": "object",
      "required": [
       "reply",
       "attach",
       "decide"
      ],
      "properties": {
       "reply": {
        "type": "boolean"
       },
       "attach": {
        "type": "boolean",
        "description": "F-POR-10.R01: the ticket passes the client rule, the role holds attach_shared and the mask shows shared attachments; never in a preview."
       },
       "decide": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "PortalTicketListMeta": {
    "type": "object",
    "required": [
     "page",
     "total",
     "organisation",
     "segments",
     "awaitingApproval",
     "awaitingApprovalCapped"
    ],
    "properties": {
     "page": {
      "$ref": "#/components/schemas/CursorPageMeta"
     },
     "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Rows under All for the acting subject (BR-ClientTickets-04)."
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "sprintName": {
      "type": "string",
      "maxLength": 60
     },
     "dueDateVisible": {
      "type": "boolean"
     },
     "priorityVisible": {
      "type": "boolean",
      "description": "XM-1092: whether the client's mask shows the guarded field priority (the Priority column)."
     },
     "searchable": {
      "type": "boolean",
      "description": "true once the list exceeds 25 rows (D-120)."
     },
     "segments": {
      "type": "array",
      "maxItems": 21,
      "items": {
       "type": "object",
       "required": [
        "id",
        "label",
        "count"
       ],
       "properties": {
        "id": {
         "type": "string",
         "maxLength": 40,
         "description": "all, or a shown stage id."
        },
        "label": {
         "type": "string",
         "maxLength": 40
        },
        "count": {
         "type": "integer",
         "minimum": 0,
         "description": "XM-978 (F-POR-07.R03): the tickets of the segment for the reader. all = total; a stage = the visible tickets presented as it (a merged stage counts as its target); 0 when the mask hides Status."
        }
       }
      }
     },
     "awaitingApproval": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500,
      "description": "The tickets of the reader's whole list that carry \"awaiting your approval\" (F-POR-07.R04, R11; CFL-513): the \"Waiting for you\" queue, the same number as PortalOverview.status.awaitingApproval. It does not change with the page, the segment or the search (XM-1069)."
     },
     "awaitingApprovalCapped": {
      "type": "boolean",
      "description": "True when the project has more open requests of the current client than the never-paged queue reads (500, D-120), all on tickets the reader sees: awaitingApproval is then a lower bound, and the header shows \"n+\" (XM-1069). A request on a hidden ticket never sets it (XM-1503)."
     }
    }
   },
   "PortalTicketRow": {
    "type": "object",
    "required": [
     "key",
     "status",
     "awaitingApproval",
     "assignee"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "status": {
      "$ref": "#/components/schemas/ClientStageView"
     },
     "priority": {
      "$ref": "#/components/schemas/PortalPriority"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "assignee": {
      "type": "object",
      "required": [
       "displayName"
      ],
      "description": "The person where the project and role allow the assignee, else the tenant team mask (D-002).",
      "properties": {
       "displayName": {
        "type": "string",
        "maxLength": 120,
        "example": "Northwind team"
       },
       "person": {
        "$ref": "#/components/schemas/PortalPersonRef"
       }
      }
     },
     "awaitingApproval": {
      "type": "boolean"
     },
     "lastUpdate": {
      "$ref": "#/components/schemas/PortalUpdateLine"
     }
    }
   },
   "PortalUpdateLine": {
    "type": "object",
    "required": [
     "kind",
     "at"
    ],
    "properties": {
     "kind": {
      "$ref": "#/components/schemas/ClientActivityKindKey"
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     },
     "actorName": {
      "type": "string",
      "maxLength": 120,
      "description": "For commented only."
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "PortalVisitRequest": {
    "type": "object",
    "required": [
     "projectKey"
    ],
    "additionalProperties": false,
    "properties": {
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     }
    }
   },
   "PortfolioRow": {
    "type": "object",
    "required": [
     "project",
     "currency",
     "actual",
     "alert"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "planned": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "actual": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "forecast": {
      "$ref": "#/components/schemas/FinanceFigures"
     },
     "variance": {
      "$ref": "#/components/schemas/FinanceSignedFigures"
     },
     "burnPercent": {
      "type": "number",
      "minimum": 0,
      "maximum": 100000
     },
     "expense": {
      "$ref": "#/components/schemas/ExpenseComparisonFigures"
     },
     "totalCost": {
      "$ref": "#/components/schemas/CombinedFigures"
     },
     "alert": {
      "type": "string",
      "enum": [
       "none",
       "warning",
       "exceeded"
      ]
     },
     "forecastNotice": {
      "type": "string",
      "enum": [
       "too_many_tickets"
      ],
      "description": "With include=forecast: the project has more than 10,000 tickets, so only its forecast is not shown (F-FIN-07.R11; coordinator 14 Nov 2026)."
     }
    }
   },
   "PreferencesUpdate": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "weekStart": {
      "type": "string",
      "enum": [
       "monday",
       "sunday"
      ]
     },
     "timeFormat": {
      "type": "string",
      "enum": [
       "h24",
       "h12"
      ]
     },
     "theme": {
      "type": "string",
      "enum": [
       "light",
       "system"
      ],
      "description": "dark is refused while no dark palette ships (D-114)."
     },
     "defaultProjectKey": {
      "description": "Membership preference; needs X-Kanso-Tenant; null clears it.",
      "oneOf": [
       {
        "type": "string",
        "pattern": "^[A-Z][A-Z0-9]{1,9}$"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "PresenceChannelName": {
    "type": "string",
    "description": "A presence channel at the project's current team audience epoch (F-WRK-37.R03) — the project's (`….here.v{n}`), or a ticket's or a doc page's, which also carry the record's presence epoch (`….v{n}.a{m}`, R03a); or a company or team space page's (`presence-tenant.{t}.space.{s}.doc.{d}.v{n}.a{m}.m{audience}`, F-DOC-11, owner #45 follow-up 23 Nov 2026). Read it from the server; the SPA builds no name.",
    "maxLength": 190,
    "pattern": "^presence-tenant\\.[0-9a-f-]{36}\\.(project\\.[0-9a-f-]{36}\\.(here\\.v[1-9][0-9]{0,17}|(ticket|doc)\\.[0-9a-f-]{36}\\.v[1-9][0-9]{0,17}\\.a[1-9][0-9]{0,9})|space\\.[0-9a-f-]{36}\\.doc\\.[0-9a-f-]{36}\\.v[1-9][0-9]{0,17}\\.a[1-9][0-9]{0,9}\\.m(all|[0-9a-f]{16}))$"
   },
   "PresenceFieldKey": {
    "type": "string",
    "description": "F-WRK-37.R10 — a field of the ticket edit (F-WRK-22) or `customFields.{key}` of a custom field the reader sees (F-WRK-26). A key outside the set, or a field the reader's mask hides, is `presence.field_unknown`.",
    "maxLength": 53,
    "pattern": "^(title|description|priority|assigneeId|startDate|dueDate|estimateMinutes|labelIds|customFields\\.[a-z][a-z0-9_]{1,39})$"
   },
   "PresenceTimings": {
    "type": "object",
    "description": "The presence timings the SPA keeps, in whole seconds (F-WRK-37.R11, R14, R15; REV-PRES1-03): the platform's relay window and receiver end (the registry's `work.presence.relayWindowSeconds`, `work.presence.receiverEndSeconds`) and the fixed heartbeat, typing end and away time.",
    "required": [
     "relayWindowSeconds",
     "receiverEndSeconds",
     "heartbeatSeconds",
     "typingEndSeconds",
     "awaySeconds"
    ],
    "additionalProperties": false,
    "properties": {
     "relayWindowSeconds": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2
     },
     "receiverEndSeconds": {
      "type": "integer",
      "minimum": 6,
      "maximum": 10
     },
     "heartbeatSeconds": {
      "type": "integer",
      "const": 3
     },
     "typingEndSeconds": {
      "type": "integer",
      "const": 5
     },
     "awaySeconds": {
      "type": "integer",
      "const": 60
     }
    }
   },
   "PresenceUpdate": {
    "type": "object",
    "required": [
     "presence"
    ],
    "additionalProperties": false,
    "properties": {
     "presence": {
      "type": "string",
      "enum": [
       "available",
       "focus",
       "away"
      ]
     }
    }
   },
   "PreviewOptions": {
    "type": "object",
    "required": [
     "available",
     "roles"
    ],
    "properties": {
     "available": {
      "type": "boolean"
     },
     "unavailableReason": {
      "type": "string",
      "enum": [
       "portal_off",
       "no_client",
       "archived",
       "not_permitted"
      ]
     },
     "roles": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/RoleRef"
      }
     },
     "defaultRoleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "selectorShown": {
      "type": "boolean",
      "description": "true only when the project's guests hold different client roles (D-012)."
     }
    }
   },
   "PreviewResult": {
    "type": "object",
    "required": [
     "subject",
     "visibleFields",
     "hiddenFields",
     "boardColumns"
    ],
    "properties": {
     "subject": {
      "type": "object",
      "required": [
       "kind",
       "label"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "role",
         "member",
         "client_role"
        ]
       },
       "label": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "sampleTicket": {
      "type": "object",
      "description": "Absent when the subject can see no ticket (empty preview).",
      "required": [
       "key",
       "title",
       "fields"
      ],
      "properties": {
       "key": {
        "type": "string"
       },
       "title": {
        "type": "string",
        "maxLength": 200
       },
       "clientVisible": {
        "type": "boolean"
       },
       "fields": {
        "type": "array",
        "maxItems": 66,
        "description": "The sixteen built-in fields of TicketField registry version 2 and the project's custom fields (at most 50).",
        "items": {
         "type": "object",
         "required": [
          "field",
          "label",
          "value"
         ],
         "properties": {
          "field": {
           "type": "string",
           "maxLength": 44
          },
          "label": {
           "type": "string",
           "maxLength": 60
          },
          "value": {
           "type": "string",
           "maxLength": 500
          }
         }
        }
       }
      }
     },
     "visibleFields": {
      "type": "array",
      "maxItems": 66,
      "description": "Built-in field keys, and `cf.<key>` for the project's custom fields the subject sees (F-ACC-13.R12).",
      "items": {
       "type": "string",
       "maxLength": 44
      }
     },
     "hiddenFields": {
      "type": "array",
      "maxItems": 66,
      "items": {
       "type": "object",
       "required": [
        "field",
        "reasons",
        "sentence"
       ],
       "properties": {
        "field": {
         "type": "string",
         "maxLength": 44,
         "description": "A built-in key, or `cf.<key>` for a custom field (reasons custom_field_never_client, custom_field_not_enabled_for_clients, custom_field_hidden_by_role, custom_field_not_in_project)."
        },
        "reasons": {
         "type": "array",
         "maxItems": 4,
         "items": {
          "type": "string",
          "maxLength": 60
         }
        },
        "sentence": {
         "type": "string",
         "maxLength": 200
        }
       }
      }
     },
     "boardColumns": {
      "type": "array",
      "maxItems": 30,
      "items": {
       "type": "object",
       "required": [
        "stage",
        "presentedAs"
       ],
       "properties": {
        "stage": {
         "type": "string",
         "maxLength": 60
        },
        "presentedAs": {
         "type": "string",
         "maxLength": 60,
         "description": "The presented stage, or hidden."
        }
       }
      }
     },
     "ticketCounts": {
      "type": "object",
      "required": [
       "visible",
       "total"
      ],
      "properties": {
       "visible": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "reasonIfEmpty": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "PreviewSessionView": {
    "type": "object",
    "required": [
     "previewSessionId",
     "token",
     "expiresAt",
     "role",
     "project",
     "organisation",
     "teamMask"
    ],
    "properties": {
     "teamMask": {
      "description": "The label the previewed portal shows for masked people (as PortalRef.teamMask; CG-07).",
      "allOf": [
       {
        "$ref": "#/components/schemas/ClientTeamLabel"
       }
      ]
     },
     "previewSessionId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "token": {
      "type": "string",
      "minLength": 32,
      "maxLength": 1024,
      "description": "The read-only X-Kanso-Preview credential; held in memory only, never logged."
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "role": {
      "$ref": "#/components/schemas/RoleRef"
     },
     "project": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     }
    }
   },
   "PreviewStartRequest": {
    "type": "object",
    "required": [
     "projectKey"
    ],
    "additionalProperties": false,
    "properties": {
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
     },
     "roleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "previewSessionId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "PreviewSubjectRef": {
    "type": "object",
    "required": [
     "kind"
    ],
    "additionalProperties": false,
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "role",
       "member"
      ]
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "PriorityColour": {
    "type": "string",
    "enum": [
     "grey",
     "blue",
     "green",
     "amber",
     "orange",
     "red",
     "purple",
     "teal",
     "pink"
    ]
   },
   "PriorityEntryInput": {
    "type": "object",
    "required": [
     "key",
     "name",
     "colour"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "colour": {
      "$ref": "#/components/schemas/PriorityColour"
     },
     "isDefault": {
      "type": "boolean",
      "default": false
     },
     "archived": {
      "type": "boolean",
      "default": false
     }
    }
   },
   "PriorityEntryView": {
    "type": "object",
    "required": [
     "key",
     "name",
     "colour",
     "isDefault",
     "archived"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "colour": {
      "$ref": "#/components/schemas/PriorityColour"
     },
     "isDefault": {
      "type": "boolean",
      "description": "The priority of a create that names none (F-WRK-40.R04). Exactly one entry."
     },
     "archived": {
      "type": "boolean",
      "description": "Kept for the tickets that hold the key; not offered for a new value (F-WRK-40.R05)."
     }
    }
   },
   "PriorityVocabularyRequest": {
    "type": "object",
    "required": [
     "entries"
    ],
    "properties": {
     "entries": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "description": "Every entry, lowest first. Keep every key of the current list (F-WRK-40.R03); archive a key to stop its use.",
      "items": {
       "$ref": "#/components/schemas/PriorityEntryInput"
      }
     }
    }
   },
   "PriorityVocabularyView": {
    "type": "object",
    "required": [
     "version",
     "entries",
     "can"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "The list version; 1 is the built-in list. The If-Match of a save."
     },
     "entries": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "description": "Lowest first. The board's priority order shows the last entry first (F-WRK-40.R06).",
      "items": {
       "$ref": "#/components/schemas/PriorityEntryView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "edit"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "Problem": {
    "type": "object",
    "description": "RFC 9457 problem details (05-api §6.1); clients branch on code, never on title or detail.",
    "required": [
     "type",
     "title",
     "status",
     "code",
     "instance"
    ],
    "properties": {
     "type": {
      "type": "string",
      "format": "uri",
      "example": "https://youniton.example/problems/validation.failed"
     },
     "title": {
      "type": "string"
     },
     "status": {
      "type": "integer"
     },
     "detail": {
      "type": "string"
     },
     "instance": {
      "type": "string",
      "example": "urn:kanso:request:0192f1b2-55aa-7c21-8d0e-1f3a9b6c2d40"
     },
     "code": {
      "type": "string",
      "example": "validation.failed"
     },
     "traceId": {
      "type": "string"
     },
     "reason": {
      "type": "string",
      "maxLength": 60,
      "description": "Per code (05-api §6.2). For 401 auth.unauthenticated (XM-647): session.expired (the idle timeout or the absolute lifetime) or session.revoked (every other end of a browser session); absent when the request had no session.",
      "example": "session.expired"
     },
     "operation": {
      "type": "string",
      "maxLength": 80,
      "description": "403 proposal.required to an operator in a support window only (07-authorization §7.4; F-PLT-13.R08): the catalogue operation that the console drafts the exact-change proposal of (for example projects.edit_project, projects.save_stages, projects.save_configuration, access.grant_extension). A tenant answer never has it. The draft request nests these members: operation {key, version}, target {type, id}, expectedVersion."
     },
     "operationVersion": {
      "type": "integer",
      "minimum": 1,
      "description": "403 proposal.required (operator only) — the version of the catalogue operation."
     },
     "targetType": {
      "type": "string",
      "maxLength": 40,
      "description": "403 proposal.required (operator only) — the type of the proposal target (project for the Projects operations; member for access.grant_extension)."
     },
     "targetId": {
      "type": "string",
      "maxLength": 36,
      "description": "403 proposal.required (operator only) — the id of the proposal target (for a project, its id — never its key)."
     },
     "expectedVersion": {
      "type": "integer",
      "minimum": 1,
      "description": "403 proposal.required (operator only) — the target's current version, the draft's expectedVersion: the project version (projects.edit_project, projects.save_configuration), the stage list version (projects.save_stages) or the member's access version plus 1 (access.grant_extension)."
     },
     "errors": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     }
    }
   },
   "ProblemFieldError": {
    "type": "object",
    "required": [
     "code",
     "detail"
    ],
    "properties": {
     "pointer": {
      "type": "string",
      "example": "/addresses/2"
     },
     "parameter": {
      "type": "string"
     },
     "header": {
      "type": "string"
     },
     "code": {
      "type": "string",
      "example": "invitation.address_malformed"
     },
     "detail": {
      "type": "string"
     },
     "params": {
      "type": "object",
      "additionalProperties": true
     }
    }
   },
   "ProfileUpdate": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "timeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "language": {
      "$ref": "#/components/schemas/Locale"
     },
     "jobTitle": {
      "description": "Membership field; needs X-Kanso-Tenant; null clears it.",
      "oneOf": [
       {
        "type": "string",
        "maxLength": 80
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "ProjectAssigneeList": {
    "type": "object",
    "description": "XM-1603 (F-WRK-23.R08, F-WRK-22.R22): the people whom the assignee and reporter pickers of a project offer — the project's people (the owning team's and the team-kind members) and the caller, each an active internal member who may see the project, in name order.",
    "required": [
     "items",
     "truncated"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 501,
      "items": {
       "type": "object",
       "required": [
        "member"
       ],
       "properties": {
        "member": {
         "$ref": "#/components/schemas/MemberRef"
        }
       }
      }
     },
     "truncated": {
      "type": "boolean",
      "description": "The project has more than 500 people; the picker searches the rest with searchMembers (F-SRC-05.R05)."
     }
    }
   },
   "ProjectBudgetRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "amount"
    ],
    "description": "The one budget amount of a project (F-FIN-16.R20; XM-1638). null removes the budget.",
    "properties": {
     "amount": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 15,
      "pattern": "^(0|[1-9][0-9]{0,9})(\\.[0-9]{1,4})?$",
      "description": "EUR above 0 and at most 1000000000."
     }
    }
   },
   "ProjectBudgetView": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "budget",
     "spent",
     "actuals",
     "actualsCounted",
     "spendings",
     "left",
     "usedPercent",
     "status",
     "can",
     "version",
     "people"
    ],
    "description": "The budget of a project's Finance page (F-FIN-16.R20, R21), EUR. spent = the actual costs of the cost ledger (only when the project's currency is EUR) + the project's spending lines up to this month; left = budget - spent; usedPercent = spent / budget in whole percent, half up. version is the ETag.",
    "properties": {
     "budget": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ]
     },
     "spent": {
      "$ref": "#/components/schemas/Money"
     },
     "actuals": {
      "$ref": "#/components/schemas/Money"
     },
     "actualsCounted": {
      "type": "boolean",
      "description": "false: the project's currency is not EUR; its actual costs are shown and not added (R12)."
     },
     "spendings": {
      "$ref": "#/components/schemas/Money"
     },
     "left": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ]
     },
     "usedPercent": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 0
     },
     "status": {
      "type": "string",
      "enum": [
       "on_track",
       "near_limit",
       "over",
       "no_budget"
      ]
     },
     "can": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "change"
      ],
      "properties": {
       "change": {
        "type": "boolean",
        "description": "The caller may set the budget (the project's manage_finance, or the cashflow write right; R19)."
       }
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "people": {
      "$ref": "#/components/schemas/PeopleCostView"
     }
    }
   },
   "ProjectCapabilitiesView": {
    "type": "object",
    "description": "ProjectCapabilitiesQuery's answer for the caller (§8) — the typed form of the project document's capabilities (P2 round 2, CG-02).",
    "required": [
     "can",
     "ticketFieldMask",
     "customFieldCan"
    ],
    "additionalProperties": false,
    "properties": {
     "can": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/ProjectCapabilityKey"
      }
     },
     "ticketFieldMask": {
      "type": "array",
      "maxItems": 18,
      "uniqueItems": true,
      "description": "The built-in ticket fields the caller sees in this project (role mask, ∩ the client-sharing policy for a client); up to all 18 for an internal caller, at most 16 for a client.",
      "items": {
       "$ref": "#/components/schemas/TicketFieldKey"
      }
     },
     "customFieldCan": {
      "type": "array",
      "maxItems": 50,
      "description": "Per custom field of the project's field set, whether the caller may see and edit it (ADR-028); fields the caller cannot see are absent.",
      "items": {
       "type": "object",
       "required": [
        "key",
        "edit"
       ],
       "additionalProperties": false,
       "properties": {
        "key": {
         "$ref": "#/components/schemas/CustomFieldKey"
        },
        "edit": {
         "type": "boolean"
        }
       }
      }
     }
    }
   },
   "ProjectCapabilityKey": {
    "type": "string",
    "description": "The project-level capabilities a project document names (11 §3.2); the SPA drops a value it does not know. The last four are the project navigation facts of the owners (§8 `ProjectNavigationSource`; XM-554), each the gate of one project sidebar page: `finance.view` — Finance available ∧ (`view_finance` on the project ∨ `manage_rates`); `requests.triage` — Help desk available for the project ∧ `triage_requests` on it; `memory.read` — memory available ∧ the Memory scope `all`; `portal.preview` — `manage_client_sharing` on the project (the rule of `StartClientView`); `automation.manage` — `manage_automation` on the project (Project › Automations: New automation, the switches, Archive, editing; owner, 22 Nov 2026, A8). The `settings.<section>` facts (OF-11; owner, 27 Nov 2026, register §230 add. 103) name the project settings sections that the reader may edit, each with the decision of the section's own write: `settings.fields` — F-PRJ-14.R01 (Projects); `settings.help-desk` — F-HLP-09.R09 and `settings.request-form` — F-HLP-01.R02 (Help desk); `settings.ticket-types` — F-WRK-30.R02 and `settings.labels` — F-WRK-22.R14 (Work).",
    "enum": [
     "ticket.create",
     "sprint.plan",
     "sharing.manage",
     "docs.edit",
     "chat.use",
     "time.approve",
     "finance.view",
     "requests.triage",
     "memory.read",
     "portal.preview",
     "automation.manage",
     "settings.fields",
     "settings.help-desk",
     "settings.request-form",
     "settings.ticket-types",
     "settings.labels"
    ],
    "x-extensible-enum": true
   },
   "ProjectCatalogueMeta": {
    "type": "object",
    "required": [
     "page",
     "counts",
     "teamCount",
     "facets"
    ],
    "properties": {
     "page": {
      "$ref": "#/components/schemas/ProjectCataloguePageMeta"
     },
     "viewPreference": {
      "$ref": "#/components/schemas/ViewPreference",
      "description": "F-WRK-41.R10 (XM-943): the display preference of the Projects view, on page 1 only."
     },
     "counts": {
      "type": "object",
      "required": [
       "all",
       "pinned",
       "mine",
       "archived"
      ],
      "properties": {
       "all": {
        "type": "integer",
        "minimum": 0
       },
       "pinned": {
        "type": "integer",
        "minimum": 0
       },
       "mine": {
        "type": "integer",
        "minimum": 0
       },
       "archived": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "teamCount": {
      "type": "integer",
      "minimum": 0
     },
     "facets": {
      "type": "object",
      "required": [
       "teams",
       "clients"
      ],
      "properties": {
       "teams": {
        "type": "array",
        "maxItems": 200,
        "items": {
         "$ref": "#/components/schemas/NamedRef"
        }
       },
       "clients": {
        "type": "array",
        "maxItems": 200,
        "items": {
         "$ref": "#/components/schemas/NamedRef"
        }
       },
       "clientGroups": {
        "type": "array",
        "maxItems": 2,
        "description": "XM-1118 (P-H-32): the clients of the facet in two groups, active first and then new. A client is new when its earliest visible project started with it less than projects.newClientDays days ago. A group without clients is not in the list.",
        "items": {
         "type": "object",
         "required": [
          "group",
          "clients"
         ],
         "properties": {
          "group": {
           "type": "string",
           "enum": [
            "active",
            "new"
           ]
          },
          "clients": {
           "type": "array",
           "maxItems": 200,
           "items": {
            "$ref": "#/components/schemas/NamedRef"
           }
          }
         }
        }
       },
       "members": {
        "type": "array",
        "maxItems": 200,
        "description": "XM-1118 (G-H-31): the people of the visible projects (the members of the owning teams and the explicit team memberships, active internal members only), by name. These are the options of filter[memberId].",
        "items": {
         "$ref": "#/components/schemas/NamedRef"
        }
       }
      }
     }
    }
   },
   "ProjectCataloguePageMeta": {
    "description": "OffsetPageMeta of the project catalogue. XM-1473 (F-PRJ-01.R09): the size can also be 5, the compact page of the designed list.",
    "type": "object",
    "required": [
     "number",
     "size",
     "total",
     "totalPages"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "size": {
      "type": "integer",
      "enum": [
       5,
       10,
       20,
       25,
       30,
       50,
       100
      ]
     },
     "total": {
      "type": "integer",
      "minimum": 0
     },
     "totalPages": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "ProjectCatalogueRow": {
    "type": "object",
    "required": [
     "id",
     "key",
     "name",
     "team",
     "members",
     "openTickets",
     "updatedAt",
     "status",
     "pinned"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "team": {
      "description": "The owning team, or null for \"No team\" (F-PRJ-09.R15; XM-1010).",
      "oneOf": [
       {
        "$ref": "#/components/schemas/NamedRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "members": {
      "type": "object",
      "required": [
       "preview",
       "total"
      ],
      "properties": {
       "preview": {
        "type": "array",
        "maxItems": 3,
        "items": {
         "$ref": "#/components/schemas/MemberRef"
        }
       },
       "total": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "openTickets": {
      "type": "integer",
      "minimum": 0
     },
     "sprint": {
      "type": "object",
      "description": "Absent when the project has no active sprint or the Backlog & sprints module is off (\"No sprint\").",
      "required": [
       "name",
       "goalProgress"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 60,
        "example": "Sprint 14"
       },
       "goalProgress": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100
       },
       "endsOn": {
        "type": "string",
        "format": "date",
        "description": "XM-1118 (G-H-30): the end date of the active sprint (\"ends 21 Nov\")."
       }
      }
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "pinned": {
      "type": "boolean"
     },
     "can": {
      "type": "object",
      "required": [
       "archive",
       "pin",
       "settings"
      ],
      "properties": {
       "archive": {
        "type": "boolean"
       },
       "restore": {
        "type": "boolean"
       },
       "pin": {
        "type": "boolean"
       },
       "settings": {
        "type": "boolean",
        "description": "XM-1002 (F-PRJ-01.R12; G-C-26): the reader may open and change the project's settings. It is the decision of every project settings write (administer on Projects & boards, tenant level), so it is the same on every row of one answer."
       },
       "createTickets": {
        "type": "boolean",
        "description": "#51 (owner, 23 Nov 2026; F-PRJ-01.R12a): the reader may create tickets in the project (`create`, team access included; false on an archived project). It is the right that a ticket move or a duplicate into the project needs (F-WRK-16.R17): the ticket panel's \"Move to project\" offers only the rows where it is true."
       }
      }
     }
    }
   },
   "ProjectClientView": {
    "type": "object",
    "required": [
     "clientVersion"
    ],
    "properties": {
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "since": {
      "description": "\"Client since …\" (F-PRJ-04.R13; XM-1120): when the current client version began — the recorded client change, or the project's creation for version 1. Only with an organisation the reader may see.",
      "allOf": [
       {
        "$ref": "#/components/schemas/Instant"
       }
      ]
     },
     "shared": {
      "type": "boolean",
      "description": "The \"Shared\" mark (F-PRJ-04.R13; XM-1120) — true while a client guest can see the project now, that is the Client portal module is available on the project AND at least one active client guest holds an active client membership of its current client. Only with an organisation the reader may see."
     }
    }
   },
   "ProjectConfigurationSave": {
    "type": "object",
    "description": "The one \"Save changes\" of Projects & boards (F-PRJ-06.R17) — the project's members and its stage list, all or nothing; at least one of project and stageList.",
    "required": [
     "expectedStagesVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "expectedStagesVersion": {
      "type": "integer",
      "minimum": 1,
      "description": "The stagesVersion the draft was made from; If-Match carries the project's version."
     },
     "project": {
      "$ref": "#/components/schemas/ProjectPatch"
     },
     "stageList": {
      "$ref": "#/components/schemas/StageListRequest"
     }
    }
   },
   "ProjectCreationOptions": {
    "type": "object",
    "required": [
     "teams",
     "canSetClient",
     "limit",
     "defaultsVersion"
    ],
    "properties": {
     "teams": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/NamedRef"
      }
     },
     "canSetClient": {
      "type": "boolean"
     },
     "limit": {
      "type": "object",
      "required": [
       "used"
      ],
      "properties": {
       "used": {
        "type": "integer",
        "minimum": 0
       },
       "max": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "defaultsVersion": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "ProjectDocument": {
    "type": "object",
    "required": [
     "id",
     "key",
     "name",
     "team",
     "client",
     "status",
     "modules",
     "stages",
     "stagesVersion",
     "timeline",
     "fieldSetVersion",
     "defaultsVersion",
     "updatedAt",
     "capabilities",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Atlas client portal"
     },
     "team": {
      "description": "The owning team, or null for \"No team\" (F-PRJ-09.R15; XM-1010).",
      "oneOf": [
       {
        "$ref": "#/components/schemas/NamedRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "client": {
      "$ref": "#/components/schemas/ProjectClientView"
     },
     "clientLead": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "archivedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "keyEditable": {
      "type": "boolean",
      "description": "true until the first ticket exists (D-046)."
     },
     "modules": {
      "type": "array",
      "maxItems": 13,
      "items": {
       "$ref": "#/components/schemas/ProjectModuleState"
      }
     },
     "stages": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/BoardStageView"
      }
     },
     "stagesVersion": {
      "type": "integer",
      "minimum": 1
     },
     "timeline": {
      "$ref": "#/components/schemas/TimelineSettingsView"
     },
     "fieldSetVersion": {
      "type": "integer",
      "minimum": 1
     },
     "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "description": "The Overview's \"Project brief\" — plain text with line breaks (F-PRJ-09.R14); absent when the project has none and in an operator's configuration read."
     },
     "briefUpdated": {
      "type": "object",
      "description": "The brief's \"Updated 3 Nov by Mira Novak\" (F-PRJ-04.R13; XM-1120): with the description only; absent for a brief that was not changed since this field exists. `by` is absent when no member changed it; a removed member is \"Former member\" (`former`).",
      "required": [
       "at"
      ],
      "properties": {
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "by": {
        "$ref": "#/components/schemas/MemberRef"
       }
      }
     },
     "clientLeadJobTitle": {
      "type": "string",
      "maxLength": 80,
      "description": "The project lead's line on the Project lead card (F-PRJ-04.R13; XM-1120) — the lead's job title, else the name of the lead's role, as on the Team panel (F-PRJ-04.R06; one rule). Absent without a shown lead."
     },
     "defaultsVersion": {
      "type": "integer",
      "minimum": 1,
      "description": "The new-project defaults version the project was created from (createdFrom; F-PRJ-04.R11)."
     },
     "updatedAt": {
      "description": "The project's last activity, else its creation — the value of ProjectCatalogueRow.updatedAt (F-PRJ-04.R11).",
      "allOf": [
       {
        "$ref": "#/components/schemas/Instant"
       }
      ]
     },
     "capabilities": {
      "description": "Access's ProjectCapabilities for the caller — the project-level capabilities, the ticket field mask and the custom fields' edit rights (11 §3.2; typed in P2 round 2, CG-02).",
      "allOf": [
       {
        "$ref": "#/components/schemas/ProjectCapabilitiesView"
       }
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "ProjectDraft": {
    "type": "object",
    "required": [
     "name",
     "teamId"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Atlas client portal"
     },
     "key": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
     },
     "teamId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "clientOrganisationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "description": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 20000,
      "description": "The brief of the New project dialog (F-PRJ-02.R02; XM-1119) — the first project description (F-PRJ-09.R14), at most 2,000 characters after trimming; null or a blank text is none."
     }
    }
   },
   "ProjectDraftValidation": {
    "type": "object",
    "required": [
     "suggestedKey",
     "keyAvailable",
     "limit",
     "valid"
    ],
    "properties": {
     "suggestedKey": {
      "description": "The typed key when it is free, else the key that the server suggests from the name. Null when no key is typed and all suggested keys are taken; then `valid` is false and `errors` has `project.key_required` at `/key` (F-PRJ-02.R09; G433).",
      "oneOf": [
       {
        "$ref": "#/components/schemas/ProjectKey"
       },
       {
        "type": "null"
       }
      ]
     },
     "keyAvailable": {
      "type": "boolean"
     },
     "limit": {
      "type": "object",
      "required": [
       "used"
      ],
      "properties": {
       "used": {
        "type": "integer",
        "minimum": 0
       },
       "max": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "valid": {
      "type": "boolean"
     },
     "errors": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     }
    }
   },
   "ProjectFieldEntry": {
    "type": "object",
    "required": [
     "fieldId",
     "required",
     "placement"
    ],
    "properties": {
     "fieldId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/CustomFieldKey"
     },
     "name": {
      "type": "string",
      "maxLength": 60
     },
     "type": {
      "$ref": "#/components/schemas/CustomFieldTypeKey"
     },
     "required": {
      "type": "boolean"
     },
     "default": {
      "$ref": "#/components/schemas/CustomFieldValue"
     },
     "placement": {
      "type": "object",
      "required": [
       "inCreateDialog",
       "onCard",
       "panelSection"
      ],
      "properties": {
       "inCreateDialog": {
        "type": "boolean"
       },
       "onCard": {
        "type": "boolean"
       },
       "panelSection": {
        "type": "string",
        "enum": [
         "details",
         "more"
        ]
       }
      }
     },
     "accessSensitive": {
      "type": "boolean",
      "description": "The field is a protected operand (RV-SEC-04); a default needs manage_client_sharing."
     }
    }
   },
   "ProjectFieldSetRequest": {
    "type": "object",
    "required": [
     "fields"
    ],
    "additionalProperties": false,
    "properties": {
     "fields": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "fieldId",
        "required",
        "placement"
       ],
       "additionalProperties": false,
       "properties": {
        "fieldId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "required": {
         "type": "boolean"
        },
        "default": {
         "$ref": "#/components/schemas/CustomFieldValue"
        },
        "placement": {
         "type": "object",
         "required": [
          "inCreateDialog",
          "onCard",
          "panelSection"
         ],
         "properties": {
          "inCreateDialog": {
           "type": "boolean"
          },
          "onCard": {
           "type": "boolean"
          },
          "panelSection": {
           "type": "string",
           "enum": [
            "details",
            "more"
           ]
          }
         }
        }
       }
      }
     }
    }
   },
   "ProjectFieldSetView": {
    "type": "object",
    "required": [
     "version",
     "fields",
     "editable"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "fields": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ProjectFieldEntry"
      }
     },
     "editable": {
      "type": "boolean"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ProjectFinanceCan": {
    "type": "object",
    "required": [
     "viewAmounts",
     "manage",
     "setProjectRates",
     "viewRates",
     "manageRates",
     "recordExpenses"
    ],
    "properties": {
     "viewAmounts": {
      "type": "boolean"
     },
     "manage": {
      "type": "boolean"
     },
     "setProjectRates": {
      "type": "boolean",
      "description": "True for a holder of set_project_rates or manage_rates."
     },
     "viewRates": {
      "type": "boolean"
     },
     "manageRates": {
      "type": "boolean"
     },
     "recordExpenses": {
      "type": "boolean"
     }
    }
   },
   "ProjectFinancePatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "billable": {
      "type": "boolean"
     }
    }
   },
   "ProjectFinanceView": {
    "type": "object",
    "required": [
     "project",
     "currency",
     "billable",
     "currencyLocked",
     "version",
     "can"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "billable": {
      "type": "boolean"
     },
     "currencyLocked": {
      "type": "boolean"
     },
     "baseline": {
      "$ref": "#/components/schemas/PlanVersionSummary"
     },
     "draft": {
      "$ref": "#/components/schemas/PlanVersionSummary"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "$ref": "#/components/schemas/ProjectFinanceCan"
     }
    }
   },
   "ProjectFinderItem": {
    "type": "object",
    "required": [
     "id",
     "key",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "example": "ORB"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Atlas client portal"
     },
     "teamName": {
      "type": "string",
      "maxLength": 120
     },
     "clientName": {
      "type": "string",
      "maxLength": 200
     },
     "pinned": {
      "type": "boolean"
     }
    }
   },
   "ProjectFinderPage": {
    "type": "object",
    "required": [
     "items",
     "recent"
    ],
    "properties": {
     "items": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ProjectFinderItem"
      }
     },
     "recent": {
      "type": "boolean",
      "description": "True when the query was empty and the items are the member's recent projects."
     }
    }
   },
   "ProjectKey": {
    "type": "string",
    "pattern": "^[A-Z][A-Z0-9]{1,9}$",
    "example": "ORB"
   },
   "ProjectLabelPage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/ProjectLabelView"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "page",
       "activeCount",
       "canCreate"
      ],
      "properties": {
       "page": {
        "$ref": "#/components/schemas/CursorPageMeta"
       },
       "activeCount": {
        "type": "integer",
        "minimum": 0,
        "maximum": 200
       },
       "canCreate": {
        "type": "boolean"
       }
      }
     },
     "links": {
      "$ref": "#/components/schemas/CursorLinks"
     }
    }
   },
   "ProjectLabelView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "colour",
     "state",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "billing"
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "ticketCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Only for readers who may manage labels (F-WRK-22.R14)."
     },
     "accessSensitive": {
      "type": "boolean",
      "description": "True when an active role version references the label (07 §2.11); archive and merge-away are refused."
     },
     "roleNames": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "type": "string",
       "minLength": 1
      },
      "description": "XM-1007 (F-WRK-22.R17): the names of the roles whose active version references the label, in role-name order; empty when none does. A draft or a superseded version never counts. Only for a reader who administers roles (F-ACC-01.R01); for any other reader the field is absent on every label, so the answer tells neither the names nor their number."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "archive",
       "merge"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "archive": {
        "type": "boolean"
       },
       "merge": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ProjectMemberAdd": {
    "type": "object",
    "required": [
     "memberId"
    ],
    "additionalProperties": false,
    "properties": {
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ProjectMemberRateRow": {
    "type": "object",
    "required": [
     "member",
     "cost"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "cost": {
      "$ref": "#/components/schemas/ResolvedRateView"
     },
     "bill": {
      "$ref": "#/components/schemas/ResolvedRateView",
      "description": "Only while bill rates are on."
     }
    }
   },
   "ProjectModuleKey": {
    "type": "string",
    "enum": [
     "work_board",
     "time_tracking",
     "backlog_sprints",
     "product_discovery",
     "epics",
     "docs",
     "timeline",
     "project_chat",
     "calendar",
     "client_portal",
     "client_messages",
     "help_desk",
     "memory"
    ],
    "x-extensible-enum": true
   },
   "ProjectModuleState": {
    "type": "object",
    "required": [
     "key",
     "on",
     "available"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ProjectModuleKey"
     },
     "on": {
      "type": "boolean",
      "description": "The stored choice."
     },
     "available": {
      "type": "boolean",
      "description": "on and its flag and plan gates hold."
     },
     "unavailableReason": {
      "type": "string",
      "enum": [
       "flag",
       "plan",
       "module",
       "requires_client_portal"
      ]
     }
    }
   },
   "ProjectOverview": {
    "type": "object",
    "required": [
     "header",
     "metrics",
     "team"
    ],
    "properties": {
     "header": {
      "type": "object",
      "required": [
       "repositories"
      ],
      "properties": {
       "repositories": {
        "type": "array",
        "maxItems": 2,
        "items": {
         "type": "object",
         "required": [
          "provider",
          "count"
         ],
         "properties": {
          "provider": {
           "type": "string",
           "enum": [
            "gitlab",
            "github"
           ]
          },
          "count": {
           "type": "integer",
           "minimum": 1
          }
         }
        }
       },
       "repositoriesLink": {
        "type": "boolean",
        "description": "true for Admins (D-067)."
       }
      }
     },
     "metrics": {
      "type": "object",
      "required": [
       "openTickets",
       "totalTickets"
      ],
      "properties": {
       "sprintGoal": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100,
        "description": "Absent without an active sprint."
       },
       "openTickets": {
        "type": "integer",
        "minimum": 0
       },
       "loggedThisSprintMinutes": {
        "type": "integer",
        "minimum": 0,
        "description": "Absent without an active sprint or with Time tracking off."
       },
       "clientVisible": {
        "type": "integer",
        "minimum": 0,
        "description": "Absent with the Client portal module off or no client."
       },
       "totalTickets": {
        "type": "integer",
        "minimum": 0,
        "description": "The Delivery panel — every live ticket of the project the caller may see (F-PRJ-04.R12)."
       },
       "completedTickets": {
        "type": "integer",
        "minimum": 0,
        "description": "The Delivery panel — those of totalTickets in a done stage; absent while the caller's plan hides the status (F-PRJ-04.R12)."
       }
      }
     },
     "sprint": {
      "type": "object",
      "description": "Work's sprint panel (F-WRK-09); absent without an active sprint.",
      "additionalProperties": true
     },
     "delivery": {
      "type": "object",
      "description": "The Delivery card (F-PRJ-04.R14, XM-1121): every range at once, in the card's order, so the range picker needs no new read.",
      "required": [
       "ranges"
      ],
      "properties": {
       "ranges": {
        "type": "array",
        "maxItems": 4,
        "items": {
         "type": "object",
         "required": [
          "range",
          "total"
         ],
         "properties": {
          "range": {
           "type": "string",
           "enum": [
            "sprint",
            "last_sprint",
            "month",
            "all"
           ],
           "description": "sprint — absent without an active sprint or with Backlog & sprints off; last_sprint — absent without a completed sprint or with Backlog & sprints off; month — absent while the caller's plan hides the status; all — always."
          },
          "total": {
           "type": "integer",
           "minimum": 0,
           "description": "The range's live tickets the caller may see."
          },
          "done": {
           "type": "integer",
           "minimum": 0,
           "description": "Those done (for the last sprint, done in it); absent while the status is masked."
          },
          "todo": {
           "type": "integer",
           "minimum": 0,
           "description": "Those in a To do stage; absent while the status is masked."
          },
          "doing": {
           "type": "integer",
           "minimum": 0,
           "description": "Those in an In progress stage; absent while the status is masked."
          },
          "review": {
           "type": "integer",
           "minimum": 0,
           "description": "Those in an In review stage; absent while the status is masked."
          }
         }
        }
       }
      }
     },
     "team": {
      "type": "object",
      "required": [
       "members",
       "total",
       "clients"
      ],
      "properties": {
       "members": {
        "type": "array",
        "maxItems": 6,
        "items": {
         "type": "object",
         "required": [
          "person",
          "role",
          "minutesThisWeek"
         ],
         "properties": {
          "person": {
           "$ref": "#/components/schemas/MemberRef"
          },
          "role": {
           "type": "string",
           "maxLength": 60
          },
          "minutesThisWeek": {
           "type": "integer",
           "minimum": 0
          }
         }
        }
       },
       "total": {
        "type": "integer",
        "minimum": 0
       },
       "clients": {
        "type": "integer",
        "minimum": 0
       },
       "order": {
        "type": "string",
        "enum": [
         "hours_this_week",
         "name"
        ]
       }
      }
     }
    }
   },
   "ProjectPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "key": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
     },
     "teamId": {
      "description": "The owning team, or null for \"No team\" (F-PRJ-09.R15; XM-1010); absent is unchanged (JSON Merge Patch).",
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "modules": {
      "type": "object",
      "description": "Module key to on/off; absent modules are unchanged (JSON Merge Patch).",
      "additionalProperties": {
       "type": "boolean"
      }
     },
     "timeline": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "useStartDates": {
        "type": "boolean"
       },
       "undatedBars": {
        "type": "string",
        "enum": [
         "sprint_start",
         "due_date_only"
        ]
       }
      }
     },
     "description": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 20000,
      "description": "The project brief (F-PRJ-09.R14) — at most 2,000 characters after trimming; null or a blank text clears it."
     }
    }
   },
   "ProjectPeopleRow": {
    "type": "object",
    "required": [
     "memberId",
     "name",
     "email",
     "role",
     "capacityMinutesPerWeek"
    ],
    "properties": {
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "initials": {
      "type": "string",
      "maxLength": 2
     },
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "role": {
      "$ref": "#/components/schemas/RoleRef"
     },
     "team": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "presence": {
      "type": "string",
      "enum": [
       "available",
       "focus",
       "away"
      ]
     },
     "capacityMinutesPerWeek": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10080
     },
     "loggedThisWeekMinutes": {
      "type": "integer",
      "minimum": 0,
      "description": "Minutes the member logged on this project in the current week as Time defines it (D-067, F-TIM-07); absent when Time's query cannot answer, shown as a dash."
     },
     "assignable": {
      "type": "boolean",
      "description": "XM-1101: true when the member can take tickets in this project — an active internal member who sees the project, the assignee rule of F-WRK-03.R08. Access decides it for the page in one set read (`CapabilityHolders::seeProjectAmong`)."
     },
     "can": {
      "type": "object",
      "properties": {
       "manageInAdministration": {
        "type": "boolean"
       },
       "removeFromProject": {
        "type": "boolean"
       },
       "message": {
        "type": "string",
        "enum": [
         "none",
         "direct"
        ],
        "description": "F-TEN-12.R10 — direct opens Messaging's direct conversation with this member; none for the reader's own row or without messaging."
       }
      }
     }
    }
   },
   "ProjectPeopleSummary": {
    "type": "object",
    "required": [
     "memberCount",
     "capacityMinutesPerWeek",
     "clientGuestCount"
    ],
    "properties": {
     "memberCount": {
      "type": "integer",
      "minimum": 0
     },
     "capacityMinutesPerWeek": {
      "type": "integer",
      "minimum": 0
     },
     "clientGuestCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Active client guests and pending client invitations of the project — the rows of the client-contacts panel."
     },
     "clientOrganisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "can": {
      "type": "object",
      "properties": {
       "invite": {
        "type": "boolean"
       },
       "addMember": {
        "type": "boolean"
       },
       "sharingPolicy": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ProjectPersonChangePreview": {
    "type": "object",
    "description": "The time facts (months, totals, timesheets, postings, reportSources, repricesPast) are present exactly when timeHidden is false (F-FIN-03.R20; REV-BEFIN-03).",
    "required": [
     "member",
     "mode",
     "effectiveFrom",
     "today",
     "currency",
     "cost",
     "baselines",
     "timeHidden",
     "amountsHidden"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "mode": {
      "type": "string",
      "enum": [
       "from_date",
       "correction"
      ]
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "today": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/RoleChangeSide"
     },
     "cost": {
      "$ref": "#/components/schemas/RateChangeSide"
     },
     "bill": {
      "$ref": "#/components/schemas/RateChangeSide"
     },
     "months": {
      "type": "array",
      "maxItems": 36,
      "items": {
       "$ref": "#/components/schemas/RepricedPeriod"
      }
     },
     "totals": {
      "$ref": "#/components/schemas/RepricedPeriod"
     },
     "timesheets": {
      "type": "integer",
      "minimum": 0,
      "description": "The accepted timesheets with an entry in scope; their hours do not change."
     },
     "postings": {
      "type": "object",
      "required": [
       "reversals",
       "postings"
      ],
      "properties": {
       "reversals": {
        "type": "integer",
        "minimum": 0
       },
       "postings": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "baselines": {
      "type": "object",
      "required": [
       "frozen",
       "changed"
      ],
      "properties": {
       "frozen": {
        "type": "integer",
        "minimum": 0
       },
       "changed": {
        "type": "integer",
        "minimum": 0,
        "maximum": 0,
        "description": "Always 0 — a baseline is frozen (F-FIN-05.R10)."
       }
      }
     },
     "reportSources": {
      "type": "array",
      "maxItems": 1,
      "items": {
       "type": "string",
       "enum": [
        "costs"
       ]
      }
     },
     "repricesPast": {
      "type": "boolean"
     },
     "timeHidden": {
      "type": "boolean",
      "description": "True for a reader who does not read the person's worklog entries on the project (INV-TIM-09; F-FIN-04.R07); the time facts are then absent."
     },
     "amountsHidden": {
      "type": "boolean",
      "description": "True for a reader without view_finance on the project; the cost and bill money members are then absent."
     }
    }
   },
   "ProjectPersonChangeRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "mode",
     "effectiveFrom"
    ],
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "from_date",
       "correction"
      ],
      "description": "from_date is \"From <date>\" (today or later); correction is \"Correct the past\" (F-FIN-03.R19)."
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/PersonRolePart"
     },
     "cost": {
      "$ref": "#/components/schemas/PersonRatePart"
     },
     "bill": {
      "$ref": "#/components/schemas/PersonRatePart"
     }
    }
   },
   "ProjectPersonRateHistoryView": {
    "type": "object",
    "required": [
     "member",
     "onProject",
     "version",
     "source",
     "cost",
     "rates",
     "ratesTruncated",
     "roles",
     "rolesTruncated"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "onProject": {
      "type": "boolean",
      "description": "True while the member is an active internal member of the project."
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "The person's version on the project (F-FIN-03.R21), the If-Match of a change."
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "source": {
      "type": "string",
      "enum": [
       "project",
       "member",
       "none"
      ]
     },
     "since": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "cost": {
      "$ref": "#/components/schemas/ResolvedRateView"
     },
     "bill": {
      "$ref": "#/components/schemas/ResolvedRateView"
     },
     "rates": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/RateVersionView"
      }
     },
     "ratesTruncated": {
      "type": "boolean"
     },
     "roles": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/RoleAssignmentView"
      }
     },
     "rolesTruncated": {
      "type": "boolean"
     }
    }
   },
   "ProjectPersonRoleView": {
    "type": "object",
    "required": [
     "member",
     "onProject",
     "source",
     "overrides"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "onProject": {
      "type": "boolean",
      "description": "True while the member is an active internal member of the project."
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "source": {
      "type": "string",
      "enum": [
       "project",
       "member",
       "none"
      ],
      "description": "Where the role in force today comes from (INV-FIN-05)."
     },
     "since": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "overrides": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ProjectRoleOverrideView"
      }
     }
    }
   },
   "ProjectRoleOverrideRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "memberId",
     "deliveryRoleId",
     "effectiveFrom"
    ],
    "properties": {
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "deliveryRoleId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     }
    }
   },
   "ProjectRoleOverrideView": {
    "type": "object",
    "required": [
     "member",
     "effectiveFrom",
     "recordedAt",
     "recordedBy",
     "inForce"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "recordedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "recordedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     },
     "inForce": {
      "type": "boolean"
     }
    }
   },
   "ProjectShortcut": {
    "type": "object",
    "required": [
     "key",
     "name",
     "monogram"
    ],
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "example": "ORB"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Atlas client portal"
     },
     "monogram": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2,
      "example": "A"
     },
     "teamName": {
      "type": "string",
      "maxLength": 120
     },
     "archived": {
      "type": "boolean"
     },
     "pinnedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "openedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ProjectShortcuts": {
    "type": "object",
    "required": [
     "pinned",
     "recent",
     "accessibleProjects",
     "pinLimit"
    ],
    "properties": {
     "pinned": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ProjectShortcut"
      }
     },
     "recent": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/ProjectShortcut"
      }
     },
     "accessibleProjects": {
      "type": "integer",
      "minimum": 0,
      "example": 1240
     },
     "pinLimit": {
      "type": "integer",
      "minimum": 1,
      "example": 20
     }
    }
   },
   "ProjectTotal": {
    "type": "object",
    "required": [
     "project",
     "visibility"
    ],
    "description": "F-TIM-12.R09: one project of the reader. `minutes` and `billableMinutes` are absent when the level is a totals level and the period is not whole calendar months (`monthly_totals`) or whole timesheet periods (`weekly_totals`).",
    "properties": {
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "visibility": {
      "type": "string",
      "enum": [
       "monthly_totals",
       "weekly_totals",
       "own_entries",
       "all_entries"
      ]
     },
     "minutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "billableMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     }
    }
   },
   "ProjectTotals": {
    "type": "object",
    "required": [
     "period",
     "projects"
    ],
    "properties": {
     "period": {
      "type": "object",
      "required": [
       "from",
       "to"
      ],
      "properties": {
       "from": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "to": {
        "$ref": "#/components/schemas/DateOnly"
       }
      }
     },
     "projects": {
      "type": "array",
      "maxItems": 20000,
      "description": "The projects the reader can see where the reader's time level is not `none`, by name.",
      "items": {
       "$ref": "#/components/schemas/ProjectTotal"
      }
     }
    }
   },
   "ProjectVisitRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "projectKey"
    ],
    "properties": {
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
     }
    }
   },
   "ProviderSettingsInput": {
    "type": "object",
    "required": [
     "allowedProviders",
     "instances",
     "defaultTokenRotationDays",
     "tokenWarningLeadDays",
     "linkByBranchKey"
    ],
    "additionalProperties": false,
    "properties": {
     "allowedProviders": {
      "type": "array",
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/AllowedProviderKey"
      }
     },
     "instances": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "object",
       "required": [
        "url",
        "label"
       ],
       "additionalProperties": false,
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "url": {
         "$ref": "#/components/schemas/InstanceUrl"
        },
        "label": {
         "type": "string",
         "minLength": 1,
         "maxLength": 80
        }
       }
      }
     },
     "defaultTokenRotationDays": {
      "type": "integer",
      "minimum": 7,
      "maximum": 365
     },
     "tokenWarningLeadDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 60
     },
     "linkByBranchKey": {
      "type": "boolean"
     },
     "mergeRequestLinkLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000,
      "description": "Optional. Left out, the current value stays (XM-239)."
     }
    }
   },
   "ProviderSettingsView": {
    "type": "object",
    "required": [
     "allowedProviders",
     "instances",
     "defaultTokenRotationDays",
     "tokenWarningLeadDays",
     "linkByBranchKey",
     "mergeRequestLinkLimit",
     "inUse",
     "version"
    ],
    "properties": {
     "allowedProviders": {
      "type": "array",
      "maxItems": 3,
      "items": {
       "$ref": "#/components/schemas/AllowedProviderKey"
      }
     },
     "instances": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/GitLabInstance"
      }
     },
     "defaultTokenRotationDays": {
      "type": "integer",
      "minimum": 7,
      "maximum": 365,
      "example": 90
     },
     "tokenWarningLeadDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 60,
      "example": 14
     },
     "linkByBranchKey": {
      "type": "boolean",
      "example": true
     },
     "mergeRequestLinkLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000,
      "example": 1000,
      "description": "The most tickets one merge request links (XM-239)."
     },
     "inUse": {
      "type": "object",
      "description": "Live connections per allowed provider.",
      "additionalProperties": {
       "type": "integer",
       "minimum": 0
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "QuietHoursWindow": {
    "type": "object",
    "required": [
     "start",
     "end"
    ],
    "properties": {
     "start": {
      "type": "integer",
      "minimum": 0,
      "maximum": 23,
      "example": 19
     },
     "end": {
      "type": "integer",
      "minimum": 0,
      "maximum": 23,
      "example": 8
     }
    }
   },
   "RateCardRow": {
    "type": "object",
    "required": [
     "subject"
    ],
    "properties": {
     "subject": {
      "$ref": "#/components/schemas/RateSubjectView"
     },
     "cost": {
      "$ref": "#/components/schemas/RateVersionView"
     },
     "bill": {
      "$ref": "#/components/schemas/RateVersionView"
     },
     "nextChange": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "RateChangeSide": {
    "type": "object",
    "required": [
     "before",
     "after"
    ],
    "properties": {
     "before": {
      "$ref": "#/components/schemas/ResolvedRateView"
     },
     "after": {
      "$ref": "#/components/schemas/ResolvedRateView"
     }
    }
   },
   "RateSubjectInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "role",
       "member",
       "project_role",
       "project_member"
      ]
     },
     "deliveryRoleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
     }
    }
   },
   "RateSubjectView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "role",
       "member",
       "project_role",
       "project_member"
      ]
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     }
    }
   },
   "RateVersionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "subject",
     "rateKind",
     "effectiveFrom",
     "rate"
    ],
    "properties": {
     "subject": {
      "$ref": "#/components/schemas/RateSubjectInput"
     },
     "rateKind": {
      "type": "string",
      "enum": [
       "cost",
       "bill"
      ]
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "rate": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/HourlyRate"
       },
       {
        "type": "null"
       }
      ]
     },
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     },
     "corrects": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "RateVersionView": {
    "type": "object",
    "required": [
     "id",
     "subject",
     "rateKind",
     "effectiveFrom",
     "ended",
     "recordedAt",
     "recordedBy",
     "status"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "subject": {
      "$ref": "#/components/schemas/RateSubjectView"
     },
     "rateKind": {
      "type": "string",
      "enum": [
       "cost",
       "bill"
      ]
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "rate": {
      "$ref": "#/components/schemas/HourlyRate"
     },
     "ended": {
      "type": "boolean",
      "description": "True for a version that ends the rate from its date."
     },
     "erased": {
      "type": "boolean",
      "description": "True when a member erasure removed the amount."
     },
     "recordedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "recordedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     },
     "corrects": {
      "$ref": "#/components/schemas/Uuid"
     },
     "status": {
      "type": "string",
      "enum": [
       "in_force",
       "scheduled",
       "past",
       "superseded"
      ]
     }
    }
   },
   "ReactionEmojiSettingsRequest": {
    "type": "object",
    "required": [
     "mode"
    ],
    "additionalProperties": false,
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "all",
       "only",
       "off"
      ]
     },
     "emoji": {
      "type": "array",
      "maxItems": 200,
      "description": "For only, 1–200 different emoji (any accepted form; stored fully qualified); ignored for all and off.",
      "items": {
       "type": "string",
       "minLength": 1,
       "maxLength": 64
      }
     }
    }
   },
   "ReactionEmojiSettingsView": {
    "type": "object",
    "description": "The tenant's allowed reaction emoji (F-WRK-38.R03, R10, R11) — what every person who may react reads (internal members and client guests; a client gets can.edit false and no ETag); the picker offers only these.",
    "required": [
     "mode",
     "emoji",
     "catalogue",
     "maxPerComment",
     "can"
    ],
    "additionalProperties": false,
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "all",
       "only",
       "off"
      ]
     },
     "emoji": {
      "type": "array",
      "maxItems": 200,
      "description": "The list for only (fully-qualified catalogue entries); empty for all and off.",
      "items": {
       "type": "string",
       "minLength": 1,
       "maxLength": 16
      }
     },
     "catalogue": {
      "type": "object",
      "required": [
       "version",
       "dataVersion"
      ],
      "additionalProperties": false,
      "properties": {
       "version": {
        "type": "integer",
        "minimum": 1,
        "description": "The ReactionEmojiCatalogue version."
       },
       "dataVersion": {
        "type": "string",
        "pattern": "^\\d+\\.\\d+\\.\\d+$",
        "description": "The emojibase-data version of the catalogue; the SPA picker data must not be newer."
       }
      }
     },
     "maxPerComment": {
      "type": "integer",
      "minimum": 1,
      "description": "The most distinct emoji on one comment (R10)."
     },
     "can": {
      "type": "object",
      "required": [
       "edit"
      ],
      "additionalProperties": false,
      "properties": {
       "edit": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "ReactionSummaryView": {
    "type": "object",
    "description": "One emoji on one comment (F-WRK-38.R06, R08) — all the people in count (erased members too); people names at most 10 of the earliest reactors under the rule of mentions (a removed member is \"Former member\", former true) and never an erased member.",
    "required": [
     "emoji",
     "count",
     "reactedByMe",
     "people"
    ],
    "additionalProperties": false,
    "properties": {
     "emoji": {
      "type": "string",
      "minLength": 1,
      "maxLength": 16,
      "description": "A ReactionEmojiCatalogue entry, fully qualified (F-WRK-38.R02)."
     },
     "count": {
      "type": "integer",
      "minimum": 1
     },
     "reactedByMe": {
      "type": "boolean"
     },
     "people": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     }
    }
   },
   "ReadMarkRequest": {
    "type": "object",
    "required": [
     "sequence"
    ],
    "additionalProperties": false,
    "properties": {
     "sequence": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "ReadStateView": {
    "type": "object",
    "required": [
     "conversationId",
     "lastReadSequence",
     "muted",
     "unreadCount"
    ],
    "properties": {
     "conversationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "lastReadSequence": {
      "type": "integer",
      "minimum": 0
     },
     "muted": {
      "type": "boolean"
     },
     "unreadCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99
     }
    }
   },
   "ReauthenticateRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "Exactly one of password, code or provider.",
    "properties": {
     "password": {
      "type": "string",
      "maxLength": 128,
      "writeOnly": true
     },
     "code": {
      "type": "string",
      "pattern": "^[0-9]{6}$",
      "writeOnly": true
     },
     "provider": {
      "type": "string",
      "enum": [
       "google",
       "microsoft",
       "saml"
      ]
     },
     "tenantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "window": {
      "type": "string",
      "enum": [
       "strict_account",
       "standard_account",
       "strict_tenant",
       "standard_tenant"
      ]
     }
    }
   },
   "ReauthenticationResult": {
    "type": "object",
    "properties": {
     "reauthenticatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "window": {
      "type": "string",
      "enum": [
       "strict_account",
       "standard_account",
       "strict_tenant",
       "standard_tenant"
      ]
     },
     "validUntil": {
      "$ref": "#/components/schemas/Instant"
     },
     "redirectUrl": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "RecoveryCodeStatus": {
    "type": "object",
    "required": [
     "remaining",
     "total",
     "generatedAt",
     "slots"
    ],
    "properties": {
     "remaining": {
      "type": "integer",
      "minimum": 0,
      "maximum": 8
     },
     "total": {
      "type": "integer",
      "enum": [
       8
      ]
     },
     "generatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "slots": {
      "type": "array",
      "maxItems": 8,
      "items": {
       "type": "object",
       "required": [
        "position",
        "used"
       ],
       "properties": {
        "position": {
         "type": "integer",
         "minimum": 1,
         "maximum": 8
        },
        "used": {
         "type": "boolean"
        },
        "usedAt": {
         "$ref": "#/components/schemas/Instant"
        }
       }
      }
     }
    }
   },
   "RecoveryCodesIssued": {
    "type": "object",
    "required": [
     "codes",
     "generatedAt"
    ],
    "description": "Shown once; never retrievable again (register §14).",
    "properties": {
     "codes": {
      "type": "array",
      "minItems": 8,
      "maxItems": 8,
      "items": {
       "type": "string",
       "pattern": "^[A-Za-z0-9]{10}-[A-Za-z0-9]{10}$"
      }
     },
     "generatedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "RedirectInstruction": {
    "type": "object",
    "required": [
     "redirectUrl"
    ],
    "properties": {
     "redirectUrl": {
      "type": "string",
      "format": "uri",
      "description": "Top-level navigation target at the provider or IdP; never an SPA URL."
     },
     "tenantName": {
      "type": "string"
     }
    }
   },
   "RelationKindCreateRequest": {
    "type": "object",
    "required": [
     "key",
     "outwardPhrase",
     "inwardPhrase",
     "symmetric",
     "dependency"
    ],
    "additionalProperties": false,
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "outwardPhrase": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "inwardPhrase": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "symmetric": {
      "type": "boolean"
     },
     "dependency": {
      "type": "string",
      "enum": [
       "none",
       "finish_to_start",
       "finish_to_finish"
      ]
     },
     "dependentEnd": {
      "type": "string",
      "enum": [
       "source",
       "target"
      ]
     }
    }
   },
   "RelationKindPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "outwardPhrase": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "inwardPhrase": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 29
     }
    }
   },
   "RelationKindView": {
    "type": "object",
    "required": [
     "key",
     "outwardPhrase",
     "inwardPhrase",
     "symmetric",
     "dependency",
     "builtIn",
     "state",
     "position",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "outwardPhrase": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "blocks"
     },
     "inwardPhrase": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "is blocked by"
     },
     "symmetric": {
      "type": "boolean"
     },
     "dependency": {
      "type": "string",
      "enum": [
       "none",
       "finish_to_start",
       "finish_to_finish"
      ]
     },
     "dependentEnd": {
      "type": "string",
      "enum": [
       "source",
       "target"
      ]
     },
     "builtIn": {
      "type": "boolean"
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 29
     },
     "relationCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Only for Admins."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "RelativeAppPath": {
    "type": "string",
    "minLength": 1,
    "maxLength": 2048,
    "pattern": "^/(?!/)[^\\\\\\s]*$",
    "example": "/northwind/p/ORB/work/board"
   },
   "ReportCadence": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "frequency",
     "at"
    ],
    "properties": {
     "frequency": {
      "type": "string",
      "enum": [
       "daily",
       "weekly",
       "monthly"
      ]
     },
     "at": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):(00|15|30|45)$",
      "example": "08:00",
      "description": "Local time in the tenant's accounting time zone."
     },
     "weekday": {
      "type": "integer",
      "minimum": 1,
      "maximum": 7,
      "description": "ISO weekday; only with weekly."
     },
     "monthDay": {
      "type": "integer",
      "minimum": 1,
      "maximum": 28,
      "description": "Only with monthly."
     }
    }
   },
   "ReportCatalogue": {
    "type": "object",
    "required": [
     "version",
     "sources"
    ],
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "sources": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ReportSourceDescriptor"
      }
     }
    }
   },
   "ReportColumn": {
    "type": "object",
    "required": [
     "key",
     "label",
     "role"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ReportKey"
     },
     "label": {
      "type": "string",
      "maxLength": 80
     },
     "role": {
      "type": "string",
      "enum": [
       "dimension",
       "measure"
      ]
     },
     "unit": {
      "type": "string",
      "enum": [
       "minutes",
       "count",
       "money"
      ]
     }
    }
   },
   "ReportDefinition": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "source",
     "dimensions",
     "measures"
    ],
    "properties": {
     "source": {
      "$ref": "#/components/schemas/ReportSourceKey"
     },
     "sourceVersion": {
      "type": "integer",
      "minimum": 1,
      "description": "The catalogue version; absent means the current one."
     },
     "dimensions": {
      "type": "array",
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/ReportKey"
      }
     },
     "measures": {
      "type": "array",
      "minItems": 1,
      "maxItems": 6,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/ReportKey"
      }
     },
     "filters": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/ReportFilter"
      }
     },
     "period": {
      "$ref": "#/components/schemas/ReportPeriod"
     },
     "sort": {
      "$ref": "#/components/schemas/ReportSort"
     },
     "includeTotals": {
      "type": "boolean",
      "default": true
     }
    }
   },
   "ReportDeliveryView": {
    "type": "object",
    "required": [
     "id",
     "reportScheduleId",
     "savedReportId",
     "occurrenceAt",
     "recipient",
     "state"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "reportScheduleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "savedReportId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "savedReportName": {
      "type": "string",
      "maxLength": 120,
      "description": "Absent when the reader can no longer open the report."
     },
     "occurrenceAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "recipient": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "delivered",
       "skipped_no_access",
       "failed"
      ]
     },
     "reportRunId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "fileExpiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ReportDimensionDescriptor": {
    "type": "object",
    "required": [
     "key",
     "label",
     "kind",
     "filterable"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ReportKey"
     },
     "label": {
      "type": "string",
      "maxLength": 80,
      "example": "Month"
     },
     "kind": {
      "type": "string",
      "enum": [
       "entity",
       "enumeration",
       "time_grain"
      ]
     },
     "filterable": {
      "type": "boolean"
     },
     "moneyRestricted": {
      "type": "boolean",
      "description": "True when this reader cannot use this dimension (or filter by it) with a money measure: the member dimension of expenses without view_rates (F-FIN-11.R10)."
     },
     "values": {
      "type": "array",
      "maxItems": 20,
      "description": "The allowed values of an enumeration dimension.",
      "items": {
       "type": "string",
       "maxLength": 40
      }
     }
    }
   },
   "ReportDimensionValue": {
    "type": "object",
    "required": [
     "kind",
     "label"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "value",
       "none",
       "hidden",
       "former",
       "small"
      ],
      "description": "`small`: the one row of the groups with fewer than k people at a totals level, with the next smallest group when the notice `small_groups_combined` says so (F-RPT-02.R17)."
     },
     "id": {
      "type": "string",
      "maxLength": 80,
      "description": "The id, key, enumeration value or date of the group; absent for hidden, none and small."
     },
     "label": {
      "type": "string",
      "maxLength": 200,
      "example": "Atlas client portal"
     }
    }
   },
   "ReportEstimate": {
    "type": "object",
    "required": [
     "factRows",
     "capped",
     "runMode"
    ],
    "properties": {
     "factRows": {
      "type": "integer",
      "minimum": 0
     },
     "capped": {
      "type": "boolean",
      "description": "True when the count stopped at its cap."
     },
     "runMode": {
      "type": "string",
      "enum": [
       "sync",
       "async",
       "refused"
      ]
     }
    }
   },
   "ReportFilter": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "dimension",
     "operator",
     "values"
    ],
    "properties": {
     "dimension": {
      "$ref": "#/components/schemas/ReportKey"
     },
     "operator": {
      "type": "string",
      "enum": [
       "in",
       "not_in"
      ]
     },
     "values": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "minLength": 1,
       "maxLength": 80
      }
     }
    }
   },
   "ReportKey": {
    "type": "string",
    "pattern": "^[a-z][a-z_]{1,39}$",
    "description": "A dimension or measure key that the source's descriptor names.",
    "example": "month"
   },
   "ReportLimitsView": {
    "type": "object",
    "required": [
     "syncFactRows",
     "maxFactRows",
     "maxResultRows",
     "maxPeriodDays",
     "savedPerMember",
     "savedUsed",
     "sharedPerTenant",
     "sharedUsed",
     "schedulesPerTenant",
     "schedulesUsed",
     "maxRecipients",
     "schedulesEnabled",
     "exportsPerHour"
    ],
    "properties": {
     "syncFactRows": {
      "type": "integer",
      "minimum": 0
     },
     "maxFactRows": {
      "type": "integer",
      "minimum": 0
     },
     "maxResultRows": {
      "type": "integer",
      "minimum": 0
     },
     "maxPeriodDays": {
      "type": "integer",
      "minimum": 0
     },
     "savedPerMember": {
      "type": "integer",
      "minimum": 0
     },
     "savedUsed": {
      "type": "integer",
      "minimum": 0
     },
     "sharedPerTenant": {
      "type": "integer",
      "minimum": 0
     },
     "sharedUsed": {
      "type": "integer",
      "minimum": 0
     },
     "schedulesPerTenant": {
      "type": "integer",
      "minimum": 0
     },
     "schedulesUsed": {
      "type": "integer",
      "minimum": 0
     },
     "maxRecipients": {
      "type": "integer",
      "minimum": 0
     },
     "schedulesEnabled": {
      "type": "boolean"
     },
     "exportsPerHour": {
      "type": "integer",
      "minimum": 1,
      "description": "The budget of the shared exports limiter per account and clock hour (F-RPT-04.R10; XM-1270); the CSV exports of every area count."
     }
    }
   },
   "ReportMeasureDescriptor": {
    "type": "object",
    "required": [
     "key",
     "label",
     "unit"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ReportKey"
     },
     "label": {
      "type": "string",
      "maxLength": 80,
      "example": "Logged time"
     },
     "unit": {
      "type": "string",
      "enum": [
       "minutes",
       "count",
       "money"
      ]
     },
     "available": {
      "type": "boolean",
      "description": "False when the reader can use this measure on no project."
     }
    }
   },
   "ReportMeasureValue": {
    "type": "object",
    "minProperties": 1,
    "maxProperties": 1,
    "properties": {
     "minutes": {
      "type": "integer",
      "minimum": 0
     },
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "money": {
      "$ref": "#/components/schemas/Money"
     },
     "withheld": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "A cell with no figure for this reader: the ticket count of the row of tickets the reader cannot see (F-RPT-02.R06; CFL-664), or every total of a result whose totals-level facts hold fewer than k people (F-RPT-02.R17)."
     }
    }
   },
   "ReportNotice": {
    "type": "object",
    "required": [
     "code"
    ],
    "properties": {
     "code": {
      "type": "string",
      "enum": [
       "projects_left_out_time_level",
       "projects_left_out_no_time",
       "projects_left_out_finance",
       "projects_left_out_estimate_field",
       "amounts_unconverted",
       "minutes_unrated",
       "tickets_hidden",
       "small_groups_withheld",
       "small_groups_combined",
       "subtotals_withheld"
      ]
     },
     "count": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "ReportPeriod": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "absolute",
       "this_week",
       "previous_week",
       "this_month",
       "previous_month",
       "this_quarter",
       "previous_quarter",
       "this_year",
       "previous_year",
       "year_to_date",
       "last_n_days"
      ]
     },
     "from": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "to": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 366,
      "description": "Only with last_n_days."
     }
    }
   },
   "ReportResolvedPeriod": {
    "type": "object",
    "required": [
     "from",
     "to",
     "timeZone"
    ],
    "properties": {
     "from": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "to": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "timeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     }
    }
   },
   "ReportRow": {
    "type": "object",
    "required": [
     "dimensions",
     "measures"
    ],
    "properties": {
     "dimensions": {
      "type": "array",
      "maxItems": 3,
      "description": "The value of each dimension of the definition. A subtotal row has the values of its first one or two dimensions only (F-RPT-02.R17a).",
      "items": {
       "$ref": "#/components/schemas/ReportDimensionValue"
      }
     },
     "measures": {
      "type": "array",
      "minItems": 1,
      "maxItems": 6,
      "items": {
       "$ref": "#/components/schemas/ReportMeasureValue"
      }
     },
     "subtotal": {
      "type": "boolean",
      "enum": [
       true
      ],
      "description": "The row is the subtotal of the group that its dimensions name. It comes after the rows of that group, and its figures are the source's own answer for that group (F-RPT-02.R17a; owner, 29 November 2026). Absent on the other rows."
     }
    }
   },
   "ReportRunRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "definition"
    ],
    "properties": {
     "definition": {
      "$ref": "#/components/schemas/ReportDefinition"
     }
    }
   },
   "ReportRunView": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "state",
     "definition",
     "createdAt",
     "expiresAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kind": {
      "type": "string",
      "enum": [
       "adhoc",
       "saved",
       "delivery"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "running",
       "succeeded",
       "failed"
      ]
     },
     "savedReport": {
      "type": "object",
      "required": [
       "id",
       "version"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "version": {
        "type": "integer",
        "minimum": 1
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "definition": {
      "$ref": "#/components/schemas/ReportDefinition"
     },
     "resolvedPeriod": {
      "$ref": "#/components/schemas/ReportResolvedPeriod"
     },
     "columns": {
      "type": "array",
      "maxItems": 9,
      "items": {
       "$ref": "#/components/schemas/ReportColumn"
      }
     },
     "rowCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
     },
     "totals": {
      "description": "The exact totals over every fact the reader may read (F-RPT-02.R09). Every measure is `{withheld: true}` when the result's totals-level facts hold fewer than k people; the result then has no row and the notice `small_groups_withheld` (F-RPT-02.R17).",
      "allOf": [
       {
        "$ref": "#/components/schemas/ReportRow"
       }
      ]
     },
     "notices": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "$ref": "#/components/schemas/ReportNotice"
      }
     },
     "moneyCurrency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "error": {
      "$ref": "#/components/schemas/Problem"
     },
     "operationId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "finishedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ReportScheduleCan": {
    "type": "object",
    "required": [
     "edit",
     "pause",
     "resume",
     "delete"
    ],
    "properties": {
     "edit": {
      "type": "boolean"
     },
     "pause": {
      "type": "boolean"
     },
     "resume": {
      "type": "boolean"
     },
     "delete": {
      "type": "boolean"
     }
    }
   },
   "ReportSchedulePatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "cadence": {
      "$ref": "#/components/schemas/ReportCadence"
     },
     "period": {
      "$ref": "#/components/schemas/ReportPeriod"
     },
     "recipientIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "ReportScheduleRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "cadence",
     "period",
     "recipientIds"
    ],
    "properties": {
     "cadence": {
      "$ref": "#/components/schemas/ReportCadence"
     },
     "period": {
      "$ref": "#/components/schemas/ReportPeriod"
     },
     "recipientIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "ReportScheduleView": {
    "type": "object",
    "required": [
     "id",
     "savedReportId",
     "owner",
     "cadence",
     "period",
     "recipients",
     "state",
     "timeZone",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "savedReportId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "cadence": {
      "$ref": "#/components/schemas/ReportCadence"
     },
     "period": {
      "$ref": "#/components/schemas/ReportPeriod"
     },
     "recipients": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "paused",
       "suspended"
      ]
     },
     "suspendedReason": {
      "type": "string",
      "enum": [
       "owner_lost_access",
       "report_archived",
       "repeated_failure",
       "no_recipients"
      ]
     },
     "timeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "nextRunAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastRunAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "$ref": "#/components/schemas/ReportScheduleCan"
     }
    }
   },
   "ReportSharingRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "level"
    ],
    "properties": {
     "level": {
      "type": "string",
      "enum": [
       "personal",
       "team",
       "tenant"
      ]
     },
     "teamId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ReportSharingView": {
    "type": "object",
    "required": [
     "level"
    ],
    "properties": {
     "level": {
      "type": "string",
      "enum": [
       "personal",
       "team",
       "tenant"
      ]
     },
     "team": {
      "type": "object",
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 80
       }
      }
     }
    }
   },
   "ReportSort": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "by",
     "direction"
    ],
    "properties": {
     "by": {
      "$ref": "#/components/schemas/ReportKey"
     },
     "direction": {
      "type": "string",
      "enum": [
       "asc",
       "desc"
      ]
     }
    }
   },
   "ReportSourceDescriptor": {
    "type": "object",
    "required": [
     "key",
     "version",
     "label",
     "periodMode",
     "dimensions",
     "measures",
     "available"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ReportSourceKey"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "label": {
      "type": "string",
      "maxLength": 80,
      "example": "Time entries"
     },
     "periodMode": {
      "type": "string",
      "enum": [
       "dated",
       "snapshot"
      ]
     },
     "dimensions": {
      "type": "array",
      "maxItems": 40,
      "items": {
       "$ref": "#/components/schemas/ReportDimensionDescriptor"
      }
     },
     "measures": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/ReportMeasureDescriptor"
      }
     },
     "available": {
      "type": "boolean",
      "description": "False when the reader can use the source on no project."
     }
    }
   },
   "ReportSourceKey": {
    "type": "string",
    "enum": [
     "worklogs",
     "costs",
     "plans",
     "expenses",
     "estimates"
    ]
   },
   "ReportThisWeek": {
    "description": "XM-929 (F-RPT-02.R18) — the Reports sidebar's \"This week\" card.",
    "type": "object",
    "required": [
     "available",
     "thisWeek",
     "previousWeek"
    ],
    "properties": {
     "available": {
      "type": "boolean"
     },
     "thisWeek": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/ReportWeekFigure"
       },
       {
        "type": "null"
       }
      ]
     },
     "previousWeek": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/ReportWeekFigure"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "ReportTransferRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "memberId"
    ],
    "properties": {
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ReportValidation": {
    "type": "object",
    "required": [
     "valid",
     "errors",
     "warnings"
    ],
    "properties": {
     "valid": {
      "type": "boolean"
     },
     "errors": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     },
     "warnings": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/Warning"
      }
     },
     "estimate": {
      "$ref": "#/components/schemas/ReportEstimate"
     },
     "resolvedPeriod": {
      "$ref": "#/components/schemas/ReportResolvedPeriod"
     }
    }
   },
   "ReportWeekFigure": {
    "description": "XM-929 (F-RPT-02.R18) — one timesheet week of \"This week\"; a measure the source withholds is null.",
    "type": "object",
    "required": [
     "from",
     "to",
     "minutes",
     "members"
    ],
    "properties": {
     "from": {
      "type": "string",
      "format": "date",
      "example": "2026-10-19"
     },
     "to": {
      "type": "string",
      "format": "date",
      "example": "2026-10-25"
     },
     "minutes": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 0,
      "example": 18720
     },
     "members": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 0,
      "example": 9
     }
    }
   },
   "RepositoryChoice": {
    "type": "object",
    "required": [
     "providerRepoId",
     "path",
     "defaultBranch",
     "alreadyConnected"
    ],
    "properties": {
     "providerRepoId": {
      "type": "string",
      "maxLength": 64,
      "example": "48121"
     },
     "path": {
      "$ref": "#/components/schemas/RepositoryPath"
     },
     "defaultBranch": {
      "type": "string",
      "maxLength": 255,
      "example": "main"
     },
     "alreadyConnected": {
      "type": "boolean",
      "description": "True when this project already has a live connection to it."
     }
    }
   },
   "RepositoryConnectionRow": {
    "type": "object",
    "required": [
     "project",
     "connection"
    ],
    "description": "One project-centric row; connection is null for a \"No repository\" row.",
    "properties": {
     "project": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "connection": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/RepositoryConnectionView"
       },
       {
        "type": "null"
       }
      ]
     },
     "canConnect": {
      "type": "boolean"
     }
    }
   },
   "RepositoryConnectionView": {
    "type": "object",
    "required": [
     "id",
     "project",
     "provider",
     "repositoryPath",
     "status",
     "owner",
     "tokenKind",
     "webhookMode",
     "dueAt",
     "linkedTickets",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "project": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "name": {
        "type": "string",
        "maxLength": 120,
        "example": "Atlas client portal"
       }
      }
     },
     "provider": {
      "$ref": "#/components/schemas/GitProviderKey"
     },
     "instanceHost": {
      "type": "string",
      "maxLength": 253
     },
     "repositoryPath": {
      "$ref": "#/components/schemas/RepositoryPath"
     },
     "webUrl": {
      "type": "string",
      "maxLength": 2048
     },
     "status": {
      "$ref": "#/components/schemas/ConnectionStatusKey"
     },
     "pauseReason": {
      "type": "string",
      "enum": [
       "token_rejected",
       "owner_needed"
      ]
     },
     "webhookFailingCause": {
      "type": "string",
      "enum": [
       "hook_disabled",
       "verification_failures",
       "missed_changes"
      ]
     },
     "awaitingFirstDelivery": {
      "type": "boolean"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "tokenKind": {
      "$ref": "#/components/schemas/TokenKindKey"
     },
     "tokenAccountLogin": {
      "type": "string",
      "maxLength": 100
     },
     "tokenExpiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "rotationPeriodDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365,
      "description": "Absent when the tenant default applies."
     },
     "dueAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "webhookMode": {
      "$ref": "#/components/schemas/WebhookModeKey"
     },
     "lastSyncAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "linkedTickets": {
      "type": "integer",
      "minimum": 0,
      "example": 9
     },
     "can": {
      "type": "object",
      "properties": {
       "replaceToken": {
        "type": "boolean"
       },
       "transferOwner": {
        "type": "boolean"
       },
       "changeRotation": {
        "type": "boolean"
       },
       "disconnect": {
        "type": "boolean"
       }
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "RepositoryPath": {
    "type": "string",
    "minLength": 3,
    "maxLength": 255,
    "pattern": "^[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)+$",
    "example": "northwind/atlas-api"
   },
   "RepricedPeriod": {
    "type": "object",
    "required": [
     "minutes",
     "worklogs",
     "repriced",
     "unconverted"
    ],
    "properties": {
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "minutes": {
      "type": "integer",
      "minimum": 0
     },
     "worklogs": {
      "type": "integer",
      "minimum": 0
     },
     "repriced": {
      "type": "integer",
      "minimum": 0,
      "description": "The worklogs whose price changes."
     },
     "unconverted": {
      "type": "integer",
      "minimum": 0,
      "description": "The worklogs without an exchange rate in force (F-FIN-01.R08); their amounts are not in the sums."
     },
     "cost": {
      "$ref": "#/components/schemas/MoneyChange"
     },
     "bill": {
      "$ref": "#/components/schemas/MoneyChange"
     }
    }
   },
   "RequestEvidenceDraft": {
    "type": "object",
    "required": [
     "requestKey",
     "summary"
    ],
    "properties": {
     "requestKey": {
      "$ref": "#/components/schemas/HelpDeskRequestKey"
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
     }
    }
   },
   "RequestEvidenceView": {
    "type": "object",
    "description": "Spec BF-2 (F-DSC-06). The request part appears only when the reader can see the request.",
    "required": [
     "id",
     "summary",
     "author",
     "createdAt",
     "requestVisible"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "example": "Third client asking for gift-card support at checkout."
     },
     "author": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "editedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "requestVisible": {
      "type": "boolean"
     },
     "requestDeleted": {
      "type": "boolean"
     },
     "requestKey": {
      "$ref": "#/components/schemas/HelpDeskRequestKey"
     },
     "requestSummary": {
      "type": "string",
      "maxLength": 200
     },
     "requestState": {
      "$ref": "#/components/schemas/HelpDeskRequestState"
     },
     "organisationName": {
      "type": "string",
      "maxLength": 120
     }
    }
   },
   "ReshareAttachmentsRequest": {
    "type": "object",
    "required": [
     "attachmentIds",
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "attachmentIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "ReshareConsequence": {
    "type": "object",
    "required": [
     "clientVersion",
     "count",
     "sample"
    ],
    "properties": {
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "count": {
      "type": "integer",
      "minimum": 0
     },
     "sample": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/TypedRef"
      }
     },
     "staysHidden": {
      "type": "integer",
      "minimum": 0,
      "description": "Comments whose ticket is not shared with the current client and stays hidden."
     },
     "invalid": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     }
    }
   },
   "ReshareResult": {
    "type": "object",
    "required": [
     "affected",
     "items"
    ],
    "properties": {
     "affected": {
      "type": "integer",
      "minimum": 0
     },
     "items": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "type": "object",
       "required": [
        "id",
        "version"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "version": {
         "type": "integer",
         "minimum": 1
        }
       }
      }
     }
    }
   },
   "ReshareTicketsRequest": {
    "type": "object",
    "required": [
     "ticketKeys",
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "ticketKeys": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/TicketKey"
      }
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "ResolvedRateView": {
    "type": "object",
    "description": "The rate that prices a person's work on a project on a date (INV-FIN-04, F-FIN-03.R15). Source none has no rate.",
    "required": [
     "source"
    ],
    "properties": {
     "source": {
      "type": "string",
      "enum": [
       "project_member",
       "project_role",
       "member",
       "role",
       "none"
      ]
     },
     "rate": {
      "$ref": "#/components/schemas/HourlyRate"
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "versionId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "ReviewQueueRow": {
    "type": "object",
    "required": [
     "itemKey",
     "type",
     "title",
     "kind",
     "identity",
     "createdAt"
    ],
    "properties": {
     "itemKey": {
      "$ref": "#/components/schemas/KnowledgeItemKey"
     },
     "type": {
      "$ref": "#/components/schemas/KnowledgeItemTypeKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "kind": {
      "type": "string",
      "enum": [
       "proposed_item",
       "pending_revision"
      ]
     },
     "identity": {
      "type": "object",
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 80
       },
       "kind": {
        "$ref": "#/components/schemas/AgentIdentityKind"
       }
      }
     },
     "onBehalfOf": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "screening": {
      "type": "string",
      "enum": [
       "clean",
       "suspected"
      ]
     }
    }
   },
   "ReviewerSelection": {
    "type": "object",
    "required": [
     "mode"
    ],
    "additionalProperties": false,
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "any_project_guest",
       "named"
      ]
     },
     "memberIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "ReviewerSelectionView": {
    "type": "object",
    "required": [
     "mode"
    ],
    "description": "For a workspace reader who may not see the client organisation, `named` is absent and `count` says how many guests are named (REV-POR2-02; SEC-WSP2-01).",
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "any_project_guest",
       "named"
      ]
     },
     "named": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "count": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20
     }
    }
   },
   "RichTextDocument": {
    "type": "object",
    "description": "A ProseMirror document of packages/rich-text-schema (05 §2.1); inline images reference a fileId; never HTML.",
    "required": [
     "type",
     "content"
    ],
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "doc"
      ]
     },
     "schemaVersion": {
      "type": "integer",
      "minimum": 1
     },
     "content": {
      "type": "array",
      "maxItems": 2000,
      "items": {
       "type": "object",
       "required": [
        "type"
       ],
       "additionalProperties": true,
       "properties": {
        "type": {
         "type": "string",
         "enum": [
          "paragraph",
          "heading",
          "bulletList",
          "orderedList",
          "listItem",
          "taskList",
          "taskItem",
          "blockquote",
          "codeBlock",
          "table",
          "tableRow",
          "tableHeader",
          "tableCell",
          "horizontalRule",
          "image",
          "text",
          "hardBreak",
          "mention",
          "ticketRef"
         ],
         "description": "The node types of every preset (packages/rich-text-schema presets.json). Schema version 2 (XM-936) adds taskList to horizontalRule, for the description preset only. XM-937 (minimal) adds the inline ticketRef {attrs: {key: <TicketKey>}} to the comment preset only (messages and comments; the key only, the title is resolved at read; no schema version raise, as the comment preset does not check it)."
        }
       }
      }
     }
    }
   },
   "RichTextPageLink": {
    "type": "object",
    "description": "Q30 (22 Nov 2026): one doc page that a rich-text body's inline pageLink node names, as the reader may see it. A page the reader cannot see (hidden, trashed, gone) is visible false with the id only — no title and no project; the UI shows it muted as \"[[hidden page]]\".",
    "required": [
     "pageId",
     "visible"
    ],
    "additionalProperties": false,
    "properties": {
     "pageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "visible": {
      "type": "boolean"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     }
    }
   },
   "RichTextTicketRef": {
    "type": "object",
    "description": "Q30 (22 Nov 2026; the item of XM-937): one ticket that a rich-text body's inline ticketRef node names, as the reader may see it. A ticket the reader cannot see (hidden, trashed, gone, or a key of no ticket of the tenant) is visible false with the key only; the title is absent also when the reader's field mask hides it.",
    "required": [
     "key",
     "visible"
    ],
    "additionalProperties": false,
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "visible": {
      "type": "boolean"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "RoleActivateRequest": {
    "type": "object",
    "required": [
     "draftVersion",
     "operandMaintenance"
    ],
    "additionalProperties": false,
    "properties": {
     "draftVersion": {
      "type": "integer",
      "minimum": 1
     },
     "operandMaintenance": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "type": "object",
       "required": [
        "attribute",
        "maintenance"
       ],
       "additionalProperties": false,
       "properties": {
        "attribute": {
         "type": "string",
         "enum": [
          "ticket.priority",
          "ticket.labels",
          "ticket.assignee",
          "ticket.custom_field"
         ]
        },
        "field": {
         "type": "string",
         "pattern": "^[a-z][a-z0-9_]{1,39}$"
        },
        "labelId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "maintenance": {
         "type": "string",
         "enum": [
          "maintainers_only",
          "consequence_checked"
         ]
        }
       }
      }
     }
    }
   },
   "RoleAssignmentRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "deliveryRoleId",
     "effectiveFrom"
    ],
    "properties": {
     "deliveryRoleId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "reason": {
      "$ref": "#/components/schemas/FinanceReason"
     }
    }
   },
   "RoleAssignmentView": {
    "type": "object",
    "required": [
     "effectiveFrom",
     "recordedAt",
     "recordedBy",
     "inForce",
     "superseded"
    ],
    "properties": {
     "effectiveFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "deliveryRole": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "recordedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "recordedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     },
     "inForce": {
      "type": "boolean"
     },
     "superseded": {
      "type": "boolean",
      "description": "True when a later correction for the same date replaced it."
     }
    }
   },
   "RoleChangeSide": {
    "type": "object",
    "properties": {
     "before": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     },
     "after": {
      "$ref": "#/components/schemas/DeliveryRoleRef"
     }
    }
   },
   "RoleCondition": {
    "type": "object",
    "required": [
     "attribute",
     "operator",
     "operand"
    ],
    "additionalProperties": false,
    "properties": {
     "attribute": {
      "type": "string",
      "enum": [
       "ticket.client_visible",
       "ticket.priority",
       "ticket.assignee",
       "ticket.created_by",
       "ticket.project",
       "ticket.labels",
       "ticket.custom_field"
      ]
     },
     "field": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,39}$",
      "description": "The custom field key; required exactly when attribute is ticket.custom_field (grammar 2)."
     },
     "operator": {
      "type": "string",
      "enum": [
       "is",
       "is_not",
       "in"
      ]
     },
     "operand": {
      "description": "true or false, me, an enum value, or 1–100 ids of the tenant.",
      "oneOf": [
       {
        "type": "boolean"
       },
       {
        "type": "string",
        "maxLength": 40
       },
       {
        "type": "array",
        "minItems": 1,
        "maxItems": 100,
        "uniqueItems": true,
        "items": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      ]
     }
    }
   },
   "RoleCreateRequest": {
    "type": "object",
    "required": [
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "PM and developer"
     },
     "templateKey": {
      "type": "string",
      "enum": [
       "agency_client",
       "internal_stakeholder",
       "contractor",
       "read_only_auditor",
       "blank"
      ]
     },
     "copyOf": {
      "$ref": "#/components/schemas/Uuid"
     },
     "projectIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "description": "Required with the contractor template (its \"Only <set>\" scope), refused otherwise.",
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "RoleDetailView": {
    "type": "object",
    "required": [
     "role",
     "active",
     "activeVersion"
    ],
    "properties": {
     "role": {
      "$ref": "#/components/schemas/RoleSummaryView"
     },
     "active": {
      "$ref": "#/components/schemas/RoleRulesDocument"
     },
     "activeVersion": {
      "type": "integer",
      "minimum": 1
     },
     "draft": {
      "$ref": "#/components/schemas/RoleDraftView"
     },
     "draftByOther": {
      "type": "object",
      "required": [
       "author",
       "savedAt",
       "draftVersion"
      ],
      "properties": {
       "author": {
        "type": "object",
        "description": "A member author by id and name. An operator's draft (F-ACC-01.R14) has the name \"Youniton support\" and no id — never the operator's own name or the platform's OperatorId (F-PLT-13.R16; register §230 add. 2, Q19 (a); D-038; XM-997).",
        "required": [
         "name"
        ],
        "properties": {
         "id": {
          "$ref": "#/components/schemas/Uuid"
         },
         "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
         }
        }
       },
       "savedAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "draftVersion": {
        "type": "integer",
        "minimum": 1,
        "description": "The other author's draft version — the If-Match of DELETE /roles/{roleId}/draft (\"Discard their draft\", F-ACC-01.R10; G-C-34, REV-GA-03). A number only; it never names the author."
       }
      }
     },
     "operands": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/AccessOperandView"
      }
     }
    }
   },
   "RoleDraftRequest": {
    "type": "object",
    "required": [
     "rules"
    ],
    "additionalProperties": false,
    "properties": {
     "rules": {
      "$ref": "#/components/schemas/RoleRulesDocument"
     }
    }
   },
   "RoleDraftView": {
    "type": "object",
    "required": [
     "rules",
     "draftVersion",
     "savedAt",
     "warnings"
    ],
    "properties": {
     "rules": {
      "$ref": "#/components/schemas/RoleRulesDocument"
     },
     "draftVersion": {
      "type": "integer",
      "minimum": 1
     },
     "savedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "warnings": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/Warning"
      }
     }
    }
   },
   "RoleImpactLine": {
    "type": "object",
    "required": [
     "permission",
     "members"
    ],
    "properties": {
     "permission": {
      "type": "string",
      "maxLength": 60
     },
     "members": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "RoleImpactView": {
    "type": "object",
    "required": [
     "holders",
     "gains",
     "losses",
     "classification",
     "widerClauses",
     "operandsBecomingProtected"
    ],
    "properties": {
     "holders": {
      "type": "integer",
      "minimum": 0
     },
     "gains": {
      "type": "array",
      "maxItems": 40,
      "items": {
       "$ref": "#/components/schemas/RoleImpactLine"
      }
     },
     "losses": {
      "type": "array",
      "maxItems": 40,
      "items": {
       "$ref": "#/components/schemas/RoleImpactLine"
      }
     },
     "classification": {
      "type": "string",
      "enum": [
       "restrictive",
       "unchanged",
       "not_provably_narrower"
      ]
     },
     "widerClauses": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 60
      }
     },
     "operandsBecomingProtected": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "type": "object",
       "required": [
        "operand",
        "matchingTickets",
        "losingDirectEdit"
       ],
       "properties": {
        "operand": {
         "$ref": "#/components/schemas/AccessOperandView"
        },
        "matchingTickets": {
         "type": "integer",
         "minimum": 0
        },
        "losingDirectEdit": {
         "type": "integer",
         "minimum": 0
        }
       }
      }
     }
    }
   },
   "RolePreviewRequest": {
    "type": "object",
    "required": [
     "subject",
     "rules"
    ],
    "additionalProperties": false,
    "properties": {
     "subject": {
      "$ref": "#/components/schemas/PreviewSubjectRef"
     },
     "rules": {
      "type": "string",
      "enum": [
       "draft",
       "active"
      ]
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$"
     },
     "ticketKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}-[0-9]{1,7}$"
     }
    }
   },
   "RoleRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     }
    }
   },
   "RoleRenameRequest": {
    "type": "object",
    "required": [
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     }
    }
   },
   "RoleRulesDocument": {
    "type": "object",
    "required": [
     "schema",
     "audience",
     "projects",
     "tickets",
     "capabilities",
     "time",
     "docs",
     "chat"
    ],
    "additionalProperties": false,
    "description": "A role's rule document (07 §2.3); members camelCase, values snake_case; unknown members are rejected.",
    "properties": {
     "schema": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "description": "The grammar version of the document (07 §2.4): 1–6 now. The bound is the registry cap (GrammarVersion::MAX), not the current version, so an older client reads a newer grammar (XM-1576; the XM-1542 lesson). A version the server does not know is refused on write (role.grammar_unsupported)."
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "projects": {
      "type": "object",
      "required": [
       "scope"
      ],
      "additionalProperties": false,
      "properties": {
       "scope": {
        "type": "string",
        "enum": [
         "all",
         "own_teams",
         "only"
        ]
       },
       "projectIds": {
        "type": "array",
        "minItems": 1,
        "maxItems": 100,
        "uniqueItems": true,
        "items": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      }
     },
     "tickets": {
      "type": "object",
      "required": [
       "view",
       "fields"
      ],
      "additionalProperties": false,
      "properties": {
       "view": {
        "type": "object",
        "required": [
         "all"
        ],
        "additionalProperties": false,
        "properties": {
         "all": {
          "type": "array",
          "maxItems": 5,
          "items": {
           "$ref": "#/components/schemas/RoleCondition"
          }
         }
        }
       },
       "fields": {
        "type": "array",
        "maxItems": 18,
        "uniqueItems": true,
        "description": "The role's built-in field mask — up to all 18 fields of TicketField registry version 3 for an internal role; a client role's floor leaves at most 16.",
        "items": {
         "$ref": "#/components/schemas/TicketFieldKey"
        }
       }
      }
     },
     "capabilities": {
      "type": "array",
      "maxItems": 40,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/CapabilityKey"
      }
     },
     "time": {
      "type": "string",
      "enum": [
       "none",
       "monthly_totals",
       "weekly_totals",
       "own_entries",
       "all_entries"
      ]
     },
     "docs": {
      "type": "string",
      "enum": [
       "all",
       "client_tagged",
       "none"
      ]
     },
     "chat": {
      "type": "boolean"
     },
     "relationships": {
      "type": "string",
      "enum": [
       "none",
       "view",
       "manage"
      ]
     },
     "customFields": {
      "type": "object",
      "required": [
       "view",
       "edit"
      ],
      "additionalProperties": false,
      "properties": {
       "view": {
        "$ref": "#/components/schemas/CustomFieldSelection"
       },
       "edit": {
        "$ref": "#/components/schemas/CustomFieldSelection"
       }
      }
     },
     "timesheets": {
      "type": "object",
      "required": [
       "view",
       "onBehalf"
      ],
      "additionalProperties": false,
      "description": "Grammar 5, internal documents only (XM-946, XM-959, XM-995; register §225): whose time the tenant time rights reach. `view` is the scope of `view_team_timesheets` and `close_logging_periods`; `onBehalf` is the scope of `log_time_on_behalf`. A scope without its capability gives nothing. `teamIds` (1–100) exist exactly when a scope is `selected_teams`. Absent = own teams for both.",
      "properties": {
       "view": {
        "$ref": "#/components/schemas/TimesheetScopeKey"
       },
       "onBehalf": {
        "$ref": "#/components/schemas/TimesheetScopeKey"
       },
       "teamIds": {
        "type": "array",
        "minItems": 1,
        "maxItems": 100,
        "uniqueItems": true,
        "items": {
         "$ref": "#/components/schemas/Uuid"
        }
       }
      }
     }
    },
    "example": {
     "schema": 2,
     "audience": "client",
     "projects": {
      "scope": "only",
      "projectIds": [
       "0192f1a8-7c3e-7b10-9a2e-5d1f0c4b8e50"
      ]
     },
     "tickets": {
      "view": {
       "all": [
        {
         "attribute": "ticket.client_visible",
         "operator": "is",
         "operand": true
        }
       ]
      },
      "fields": [
       "title",
       "status",
       "due_date",
       "description",
       "client_comments",
       "shared_attachments"
      ]
     },
     "capabilities": [
      "comment",
      "attach_shared",
      "approve",
      "message"
     ],
     "time": "monthly_totals",
     "docs": "client_tagged",
     "chat": true,
     "relationships": "none",
     "customFields": {
      "view": "none",
      "edit": "none"
     }
    }
   },
   "RoleSummaryView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "description",
     "kind",
     "audience",
     "memberCount",
     "memberInitials",
     "usedIn",
     "version",
     "can",
     "createdBy"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "What the role is for, in one line (F-ACC-01.R16; XM-994): the sentence of the system role or of the template; else \"A custom role.\""
     },
     "kind": {
      "type": "string",
      "enum": [
       "admin",
       "default",
       "custom"
      ]
     },
     "audience": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     },
     "memberCount": {
      "type": "integer",
      "minimum": 0
     },
     "memberInitials": {
      "description": "Owner #44 (register §230 add. 97) — the initials of the role's first active members, by the time they joined (at most four): the role card's member stack. Empty when the role has no active member.",
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "maxLength": 2
      }
     },
     "usedIn": {
      "type": "object",
      "required": [
       "projects",
       "more"
      ],
      "properties": {
       "projects": {
        "type": "array",
        "maxItems": 3,
        "items": {
         "$ref": "#/components/schemas/NamedRef"
        }
       },
       "more": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "hasDraft": {
      "type": "boolean"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "rename",
       "delete",
       "discardOtherDraft"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "rename": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       },
       "discardOtherDraft": {
        "type": "boolean",
        "description": "The reader may discard a draft that another author holds (F-ACC-01.R10; G-C-33): true for an Admin on every role but the Admin role; false for an operator in a support window (an operator discards only their own draft)."
       }
      }
     },
     "createdBy": {
      "$ref": "#/components/schemas/CreatorMemberId",
      "description": "The member who created the custom role (F-ACC-01.R15; XM-924); null for a system role."
     },
     "template": {
      "description": "A template role's \"Template updated · Re-apply\" state (F-ACC-06.R09; XM-276); absent for system roles and copies.",
      "type": "object",
      "required": [
       "key",
       "revision",
       "latestRevision",
       "updated"
      ],
      "properties": {
       "key": {
        "type": "string",
        "enum": [
         "agency_client",
         "internal_stakeholder",
         "contractor",
         "read_only_auditor",
         "blank"
        ]
       },
       "revision": {
        "type": "integer",
        "minimum": 1,
        "description": "The template revision the role's active document adopted."
       },
       "latestRevision": {
        "type": "integer",
        "minimum": 1,
        "description": "The revision this release ships."
       },
       "updated": {
        "type": "boolean",
        "description": "True when latestRevision is newer — the editor offers Re-apply."
       }
      }
     }
    }
   },
   "RowLabelIds": {
    "type": "array",
    "maxItems": 20,
    "uniqueItems": true,
    "items": {
     "$ref": "#/components/schemas/Uuid"
    },
    "description": "XM-1100: the ids of the row's labels, sorted by id; [] for none. Absent when the reader's mask hides Labels (and on the timeline rows). The names and colours come from listProjectLabels."
   },
   "RowSprintRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "description": "XM-1110 (F-WRK-14.R13, F-WRK-06.R14): the sprint of a ticket row — its id and name.",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Sprint 14"
     }
    }
   },
   "SamlConfigurationView": {
    "type": "object",
    "required": [
     "spEntityId",
     "acsUrl",
     "slsUrl",
     "metadataUploadedAt",
     "enforcedForTeams",
     "testCurrent"
    ],
    "properties": {
     "spEntityId": {
      "type": "string",
      "format": "uri"
     },
     "acsUrl": {
      "type": "string",
      "format": "uri"
     },
     "slsUrl": {
      "type": "string",
      "format": "uri"
     },
     "idpEntityId": {
      "type": "string"
     },
     "ssoUrl": {
      "type": "string",
      "format": "uri"
     },
     "certificates": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "object",
       "required": [
        "thumbprint",
        "notAfter",
        "role"
       ],
       "properties": {
        "thumbprint": {
         "type": "string",
         "maxLength": 64
        },
        "notAfter": {
         "$ref": "#/components/schemas/Instant"
        },
        "role": {
         "type": "string",
         "enum": [
          "primary",
          "secondary"
         ]
        }
       }
      }
     },
     "metadataUploadedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "metadataUrl": {
      "type": "string",
      "format": "uri"
     },
     "attributeMap": {
      "type": "object",
      "properties": {
       "email": {
        "type": "string",
        "maxLength": 256
       },
       "givenName": {
        "type": "string",
        "maxLength": 256
       },
       "familyName": {
        "type": "string",
        "maxLength": 256
       }
      }
     },
     "mfaSource": {
      "type": "string",
      "enum": [
       "idp",
       "kanso_totp"
      ]
     },
     "authnContextMapping": {
      "type": "object",
      "properties": {
       "classRefs": {
        "type": "array",
        "maxItems": 10,
        "items": {
         "type": "string",
         "maxLength": 256
        }
       },
       "maxAgeMinutes": {
        "type": "integer",
        "minimum": 1,
        "maximum": 1440
       }
      }
     },
     "signOutAtIdp": {
      "type": "boolean"
     },
     "enforcedForTeams": {
      "type": "integer",
      "minimum": 0
     },
     "lastTestAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "testCurrent": {
      "type": "boolean",
      "description": "The last passing test ran on the current configuration digest."
     }
    }
   },
   "SamlMetadataPreview": {
    "type": "object",
    "required": [
     "entities"
    ],
    "properties": {
     "entities": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "entityId",
        "ssoUrl",
        "binding",
        "certificates"
       ],
       "properties": {
        "entityId": {
         "type": "string"
        },
        "ssoUrl": {
         "type": "string",
         "format": "uri"
        },
        "binding": {
         "type": "string",
         "enum": [
          "redirect",
          "post"
         ],
         "description": "The binding of the entity's single sign-on endpoint (XM-1128; G-C-31)."
        },
        "certificates": {
         "type": "array",
         "maxItems": 4,
         "items": {
          "type": "object",
          "required": [
           "thumbprint",
           "notAfter",
           "role",
           "use"
          ],
          "properties": {
           "thumbprint": {
            "type": "string",
            "maxLength": 64
           },
           "notBefore": {
            "$ref": "#/components/schemas/Instant"
           },
           "notAfter": {
            "$ref": "#/components/schemas/Instant"
           },
           "role": {
            "type": "string",
            "enum": [
             "primary",
             "secondary"
            ],
            "description": "The role a save of this entity stores (F-IDN-22.R05a; XM-1128): a saved answer gives the stored role; a dry run gives the role that a save would give."
           },
           "use": {
            "type": "string",
            "enum": [
             "signing"
            ],
            "description": "The certificate's use in the metadata. Only signing certificates are read; an encryption certificate is not used."
           }
          }
         }
        }
       }
      }
     },
     "saved": {
      "type": "boolean"
     },
     "digestChanged": {
      "type": "boolean"
     }
    }
   },
   "SamlMetadataSubmission": {
    "type": "object",
    "additionalProperties": false,
    "description": "Exactly one of metadataXml or metadataUrl.",
    "properties": {
     "metadataXml": {
      "type": "string",
      "maxLength": 1000000
     },
     "metadataUrl": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048
     },
     "entityId": {
      "type": "string",
      "maxLength": 1024,
      "description": "Chooses one entity descriptor when the document holds several."
     },
     "dryRun": {
      "type": "boolean",
      "description": "Parse and show without saving."
     },
     "testId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "A passed test of exactly this submission; required to change the trust digest while SAML is enabled."
     }
    }
   },
   "SamlTestResult": {
    "type": "object",
    "required": [
     "id",
     "state"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "passed",
       "failed",
       "expired"
      ]
     },
     "nameId": {
      "type": "string",
      "maxLength": 512
     },
     "attributes": {
      "type": "object",
      "additionalProperties": {
       "type": "string",
       "maxLength": 1024
      }
     },
     "matchedAccount": {
      "type": "object",
      "properties": {
       "name": {
        "$ref": "#/components/schemas/PersonName"
       },
       "email": {
        "$ref": "#/components/schemas/EmailAddress"
       },
       "reason": {
        "type": "string",
        "enum": [
         "linked_identity",
         "pending_invitation",
         "verified_domain_member",
         "none"
        ]
       }
      }
     },
     "failure": {
      "type": "string",
      "maxLength": 64
     },
     "redirectUrl": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "SamlTestStart": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "candidate": {
      "$ref": "#/components/schemas/SamlMetadataSubmission",
      "description": "Test a submitted, unsaved configuration instead of the stored one."
     }
    }
   },
   "SavedReportCan": {
    "type": "object",
    "required": [
     "run",
     "edit",
     "share",
     "transfer",
     "archive",
     "delete",
     "schedule"
    ],
    "properties": {
     "run": {
      "type": "boolean"
     },
     "edit": {
      "type": "boolean"
     },
     "share": {
      "type": "boolean"
     },
     "transfer": {
      "type": "boolean"
     },
     "archive": {
      "type": "boolean"
     },
     "delete": {
      "type": "boolean"
     },
     "schedule": {
      "type": "boolean"
     }
    }
   },
   "SavedReportCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name",
     "definition"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "description": {
      "type": "string",
      "maxLength": 1000
     },
     "definition": {
      "$ref": "#/components/schemas/ReportDefinition"
     },
     "sharing": {
      "$ref": "#/components/schemas/ReportSharingRequest"
     },
     "note": {
      "type": "string",
      "maxLength": 500,
      "description": "The note of version 1, as a revision's note (F-RPT-03.R03; the designed Version note — register §165)."
     }
    }
   },
   "SavedReportDuplicateRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     }
    }
   },
   "SavedReportLastRun": {
    "type": "object",
    "description": "The reader's OWN latest run of the saved report that still lives (XM-1268; F-RPT-02 §13): the report view opens with this result. It names the run only; getReportRun reads the result and decides again (another reader's run is never named; 409 report.access_changed when the access moved). Absent when no run lives, and in the answers of a transfer.",
    "required": [
     "id",
     "state",
     "createdAt",
     "expiresAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "state": {
      "type": "string",
      "enum": [
       "running",
       "succeeded",
       "failed"
      ]
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "SavedReportPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "description": {
      "oneOf": [
       {
        "type": "string",
        "maxLength": 1000
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "SavedReportRevisionRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "definition"
    ],
    "properties": {
     "definition": {
      "$ref": "#/components/schemas/ReportDefinition"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "SavedReportRunRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "An earlier version; absent means the current one."
     },
     "period": {
      "$ref": "#/components/schemas/ReportPeriod"
     }
    }
   },
   "SavedReportSummary": {
    "type": "object",
    "required": [
     "id",
     "name",
     "owner",
     "sharing",
     "state",
     "source",
     "currentVersion",
     "updatedAt",
     "scheduleCount"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Atlas time by month"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "sharing": {
      "$ref": "#/components/schemas/ReportSharingView"
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "source": {
      "$ref": "#/components/schemas/ReportSourceKey"
     },
     "currentVersion": {
      "type": "integer",
      "minimum": 1
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "scheduleCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 20
     }
    }
   },
   "SavedReportVersionView": {
    "type": "object",
    "required": [
     "number",
     "definition",
     "catalogueVersion",
     "author",
     "createdAt"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "definition": {
      "$ref": "#/components/schemas/ReportDefinition"
     },
     "catalogueVersion": {
      "type": "integer",
      "minimum": 1
     },
     "author": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "SavedReportView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "owner",
     "sharing",
     "state",
     "currentVersion",
     "definition",
     "createdAt",
     "updatedAt",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "description": {
      "type": "string",
      "maxLength": 1000
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "sharing": {
      "$ref": "#/components/schemas/ReportSharingView"
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "currentVersion": {
      "type": "integer",
      "minimum": 1
     },
     "definition": {
      "$ref": "#/components/schemas/ReportDefinition"
     },
     "outdated": {
      "type": "boolean",
      "description": "True when the current definition names a retired catalogue entry (INV-RPT-02)."
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "archivedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "$ref": "#/components/schemas/SavedReportCan"
     },
     "lastRun": {
      "$ref": "#/components/schemas/SavedReportLastRun"
     }
    }
   },
   "SearchGroup": {
    "type": "object",
    "required": [
     "group",
     "hits"
    ],
    "properties": {
     "group": {
      "$ref": "#/components/schemas/SearchGroupKey"
     },
     "hits": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/SearchHit"
      }
     }
    }
   },
   "SearchGroupKey": {
    "type": "string",
    "enum": [
     "tickets",
     "docs",
     "people",
     "projects",
     "clients",
     "messages",
     "knowledge",
     "sections",
     "members",
     "teams"
    ]
   },
   "SearchHit": {
    "type": "object",
    "required": [
     "group",
     "ref",
     "title",
     "destination"
    ],
    "properties": {
     "group": {
      "$ref": "#/components/schemas/SearchGroupKey"
     },
     "ref": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Design the approval experience"
     },
     "subtitle": {
      "type": "string",
      "maxLength": 200,
      "example": "ORB-124 · Atlas client portal · In review"
     },
     "key": {
      "type": "string",
      "maxLength": 30,
      "description": "The human key of a ticket or project, when the hit has one.",
      "example": "ORB-124"
     },
     "destination": {
      "type": "object",
      "required": [
       "kind"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "ticket",
         "doc_page",
         "member",
         "project",
         "client",
         "message",
         "knowledge_item",
         "admin_section",
         "team"
        ]
       },
       "ticketKey": {
        "type": "string",
        "maxLength": 30
       },
       "projectKey": {
        "type": "string",
        "pattern": "^[A-Z][A-Z0-9]{1,9}$"
       },
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "conversationId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "spaceId": {
        "$ref": "#/components/schemas/Uuid",
        "description": "Spec DS-1 — the space of a doc_page hit (a tenant or team space has no projectKey)."
       },
       "section": {
        "type": "string",
        "maxLength": 40
       }
      }
     },
     "exact": {
      "type": "boolean",
      "description": "True for an exact key match, which the palette selects first."
     }
    }
   },
   "SearchResults": {
    "type": "object",
    "required": [
     "scope",
     "kind",
     "groups"
    ],
    "properties": {
     "scope": {
      "type": "string",
      "enum": [
       "workspace",
       "admin"
      ]
     },
     "kind": {
      "type": "string",
      "enum": [
       "key_lookup",
       "text"
      ]
     },
     "groups": {
      "type": "array",
      "maxItems": 6,
      "items": {
       "$ref": "#/components/schemas/SearchGroup"
      }
     }
    }
   },
   "SeatUsage": {
    "type": "object",
    "required": [
     "active",
     "reserved",
     "reservationOn"
    ],
    "properties": {
     "active": {
      "type": "integer",
      "minimum": 0
     },
     "reserved": {
      "type": "integer",
      "minimum": 0
     },
     "max": {
      "type": "integer",
      "minimum": 0,
      "description": "Absent when the plan sets no user limit."
     },
     "reservationOn": {
      "type": "boolean"
     }
    }
   },
   "SecondFactorRequest": {
    "type": "object",
    "required": [
     "code"
    ],
    "additionalProperties": false,
    "properties": {
     "code": {
      "type": "string",
      "minLength": 6,
      "maxLength": 32,
      "writeOnly": true,
      "description": "A 6-digit TOTP code, or a recovery code xxxxxxxxxx-xxxxxxxxxx on the recovery-code step."
     },
     "trustDevice": {
      "type": "boolean"
     }
    }
   },
   "SegmentGrant": {
    "type": "object",
    "required": [
     "kind",
     "id"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "role",
       "team",
       "member"
      ]
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 120,
      "description": "The role's, team's or member's name, in views only."
     }
    }
   },
   "SelectOptionView": {
    "type": "object",
    "required": [
     "id",
     "label",
     "position",
     "active"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "label": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "EU"
     },
     "colour": {
      "$ref": "#/components/schemas/StageColourKey"
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 199
     },
     "active": {
      "type": "boolean"
     }
    }
   },
   "SessionPolicyUpdate": {
    "type": "object",
    "required": [
     "maxLifetimeMinutes",
     "idleTimeoutMinutes"
    ],
    "additionalProperties": false,
    "properties": {
     "maxLifetimeMinutes": {
      "type": "integer",
      "minimum": 60,
      "maximum": 129600
     },
     "idleTimeoutMinutes": {
      "type": "integer",
      "minimum": 15,
      "maximum": 10080
     }
    }
   },
   "SettingBoundsView": {
    "type": "object",
    "properties": {
     "min": {
      "type": "number"
     },
     "max": {
      "type": "number"
     },
     "unit": {
      "type": "string",
      "enum": [
       "seconds",
       "minutes",
       "hours",
       "days",
       "bytes",
       "percent",
       "count",
       "people",
       "hops",
       "runs"
      ],
      "x-extensible-enum": true
     },
     "allowed": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "type": "string",
       "maxLength": 80
      }
     },
     "maxItems": {
      "type": "integer",
      "minimum": 1,
      "description": "The most texts a list value may hold (an allow-list of hosts)."
     }
    }
   },
   "SettingDefinitionView": {
    "type": "object",
    "required": [
     "key",
     "type",
     "default",
     "hardBounds",
     "effect",
     "change",
     "editor",
     "labelKey",
     "helpKey",
     "control",
     "writeVia"
    ],
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 120,
      "example": "work.commentEditWindowMinutes"
     },
     "type": {
      "type": "string",
      "enum": [
       "toggle",
       "bounded_integer",
       "retention_period",
       "enum",
       "weekday",
       "weekday_set",
       "time_zone",
       "local_hour",
       "daily_window",
       "percentage_set",
       "member_ref",
       "registry_subset",
       "collection",
       "url"
      ],
      "description": "`url` (owner, register §230 add. 101 Q4): an absolute https address of at most 300 characters, or null when it is not set.",
      "x-extensible-enum": true
     },
     "default": {},
     "hardBounds": {
      "$ref": "#/components/schemas/SettingBoundsView"
     },
     "effect": {
      "type": "string",
      "enum": [
       "business",
       "availability",
       "visibility",
       "security",
       "retention",
       "display"
      ]
     },
     "direction": {
      "type": "string",
      "enum": [
       "free",
       "tighten_only",
       "within_entitlement"
      ]
     },
     "change": {
      "type": "string",
      "enum": [
       "immediate",
       "next_boundary",
       "prospective",
       "next_sign_in",
       "retention_rule"
      ]
     },
     "editor": {
      "type": "string",
      "maxLength": 60,
      "example": "administer"
     },
     "labelKey": {
      "type": "string",
      "maxLength": 120
     },
     "helpKey": {
      "type": "string",
      "maxLength": 120
     },
     "control": {
      "type": "string",
      "enum": [
       "switch",
       "number",
       "segmented",
       "select",
       "weekday",
       "weekdays",
       "time_zone",
       "hour",
       "window",
       "percentages",
       "member",
       "checklist",
       "url"
      ],
      "x-extensible-enum": true
     },
     "writeVia": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 120,
      "description": "null for the generic group operation; otherwise the dedicated resource's path."
     },
     "reasonRequired": {
      "type": "boolean"
     }
    }
   },
   "SettingGroupPatch": {
    "type": "object",
    "description": "JSON Merge Patch — an absent member is unchanged, null resets to the inherited value.",
    "minProperties": 1,
    "maxProperties": 60,
    "additionalProperties": true,
    "properties": {
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     }
    }
   },
   "SettingGroupView": {
    "type": "object",
    "required": [
     "group",
     "version",
     "settings",
     "validUntil"
    ],
    "properties": {
     "group": {
      "type": "string",
      "maxLength": 100
     },
     "version": {
      "type": "integer",
      "minimum": 0
     },
     "settings": {
      "type": "object",
      "maxProperties": 60,
      "additionalProperties": {
       "$ref": "#/components/schemas/EffectiveSettingView"
      }
     },
     "validUntil": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "SettingGroupsView": {
    "type": "object",
    "required": [
     "registryVersion",
     "groups"
    ],
    "description": "Every settings group of a scope the caller may read (`GET /settings`, `GET /projects/{projectKey}/settings`).",
    "properties": {
     "registryVersion": {
      "type": "integer",
      "minimum": 1
     },
     "groups": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "$ref": "#/components/schemas/SettingGroupView"
      }
     },
     "validUntil": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "SettingsSchemaView": {
    "type": "object",
    "required": [
     "registryVersion",
     "groups"
    ],
    "properties": {
     "registryVersion": {
      "type": "integer",
      "minimum": 1
     },
     "groups": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "type": "object",
       "required": [
        "group",
        "section",
        "labelKey",
        "keys"
       ],
       "properties": {
        "group": {
         "type": "string",
         "maxLength": 100,
         "example": "work"
        },
        "section": {
         "type": "string",
         "maxLength": 60
        },
        "labelKey": {
         "type": "string",
         "maxLength": 120
        },
        "keys": {
         "type": "array",
         "maxItems": 60,
         "items": {
          "$ref": "#/components/schemas/SettingDefinitionView"
         }
        }
       }
      }
     }
    }
   },
   "SettingsValidation": {
    "type": "object",
    "required": [
     "group",
     "consequences",
     "valid"
    ],
    "properties": {
     "group": {
      "type": "string",
      "maxLength": 100
     },
     "valid": {
      "type": "boolean"
     },
     "consequences": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "type": "object",
       "required": [
        "key",
        "sentence"
       ],
       "properties": {
        "key": {
         "type": "string",
         "maxLength": 120
        },
        "sentence": {
         "type": "string",
         "maxLength": 300,
         "example": "1,204 notifications older than 14 days will be removed from 26 Oct."
        },
        "count": {
         "type": "integer",
         "minimum": 0
        },
        "effectiveFrom": {
         "$ref": "#/components/schemas/Instant"
        }
       }
      }
     },
     "errors": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     }
    }
   },
   "SetupChecklistItem": {
    "type": "object",
    "required": [
     "key",
     "state",
     "dismissible"
    ],
    "properties": {
     "key": {
      "type": "string",
      "enum": [
       "identity_provider",
       "two_factor_admins",
       "client_sharing_reviewed",
       "repositories_connected",
       "ai_limits_set"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "done",
       "open",
       "dismissed"
      ]
     },
     "dismissible": {
      "type": "boolean"
     },
     "progress": {
      "type": "object",
      "required": [
       "done",
       "total"
      ],
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "checked": {
      "type": "boolean",
      "description": "False when the item's owner could not answer (F-TEN-03.R07): the item is open and shows \"Couldn't check this item\". Always sent."
     }
    }
   },
   "SetupChecklistView": {
    "type": "object",
    "required": [
     "items",
     "completed",
     "total",
     "hidden"
    ],
    "properties": {
     "items": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/SetupChecklistItem"
      }
     },
     "completed": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5
     },
     "total": {
      "type": "integer",
      "enum": [
       5
      ]
     },
     "hidden": {
      "type": "boolean",
      "description": "True only while an Admin hid the panel (PUT /tenant/setup-checklist/hidden). A complete checklist (5 of 5) stays shown, also after a reload (F-TEN-03.R04; D-063 as changed by register §229 add. 1; XM-1003)."
     },
     "showChecklistLink": {
      "type": "boolean",
      "description": "True exactly while the panel is hidden (F-TEN-03.R04): the page shows \"Show setup checklist\", which calls DELETE /tenant/setup-checklist/hidden. The five items are served also while hidden (XM-1003). Always sent."
     }
    }
   },
   "Sha256Hex": {
    "type": "string",
    "pattern": "^[0-9a-f]{64}$",
    "example": "9f2c4a1e0b7d3c5f6e8a9b0c1d2e3f405162738495a6b7c8d9e0f1a2b3c4d5e6"
   },
   "SharedLabelList": {
    "type": "object",
    "description": "The tenant's shared labels (F-WRK-22.R20): rows in name order, each a ProjectLabelView (the shape of a project's label, so the pickers read one shape).",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 5000,
      "items": {
       "$ref": "#/components/schemas/ProjectLabelView"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "activeCount",
       "canCreate",
       "limit",
       "sharedLabelsTruncated"
      ],
      "properties": {
       "activeCount": {
        "type": "integer",
        "minimum": 0
       },
       "canCreate": {
        "type": "boolean",
        "description": "True for an administer holder (Projects & boards)."
       },
       "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 5000,
        "description": "work.labels.sharedLabelLimit: the read bound of the list (1,000 † by default)."
       },
       "sharedLabelsTruncated": {
        "type": "boolean",
        "description": "More shared labels exist than the bound returns (REV-CFLR-06)."
       }
      }
     }
    }
   },
   "SignEveryoneOutResult": {
    "type": "object",
    "required": [
     "sessionsRevoked",
     "membersAffected",
     "epoch"
    ],
    "properties": {
     "sessionsRevoked": {
      "type": "integer",
      "minimum": 0
     },
     "membersAffected": {
      "type": "integer",
      "minimum": 0
     },
     "epoch": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "SignInAttemptView": {
    "type": "object",
    "description": "The attempt view every /auth step returns (06 §3.4).",
    "required": [
     "state"
    ],
    "properties": {
     "state": {
      "type": "string",
      "enum": [
       "started",
       "pending_name",
       "pending_second_factor",
       "pending_enrolment",
       "session",
       "exit_granted"
      ]
     },
     "account": {
      "type": "object",
      "properties": {
       "email": {
        "$ref": "#/components/schemas/EmailAddress"
       }
      }
     },
     "factors": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "type": "string",
       "enum": [
        "totp",
        "recovery_code"
       ]
      }
     },
     "trustDevice": {
      "type": "object",
      "properties": {
       "offered": {
        "type": "boolean"
       },
       "preselected": {
        "type": "boolean"
       },
       "days": {
        "type": "integer",
        "enum": [
         30
        ]
       }
      }
     },
     "remainingAttempts": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5
     },
     "recoveryCodesRemaining": {
      "type": "integer",
      "minimum": 0,
      "maximum": 8
     },
     "tenantName": {
      "type": "string",
      "description": "Named only for a step-up or a resolved SSO tenant."
     },
     "provider": {
      "type": "string",
      "enum": [
       "google",
       "microsoft",
       "saml"
      ],
      "description": "The method that proved the e-mail while the state is pending_name — \"Signed in with Google as …\" (F-TEN-08.R20; CG-08)."
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "landing": {
      "$ref": "#/components/schemas/Landing"
     },
     "twoFactorOff": {
      "type": "boolean",
      "description": "XM-1599. Only on GET /auth/state. True while the review environment's two-factor switch is off (APP_ENV=review and the platform key identity.reviewEnvironment.twoFactor off; owner #35); the SPA shows \"Dev host — two-factor is off\". Always false on production."
     }
    }
   },
   "SignInMethodConfigUpdate": {
    "type": "object",
    "required": [
     "enabled",
     "audience"
    ],
    "additionalProperties": false,
    "properties": {
     "enabled": {
      "type": "boolean"
     },
     "audience": {
      "type": "string",
      "enum": [
       "members",
       "members_and_clients"
      ]
     },
     "hostedDomain": {
      "oneOf": [
       {
        "type": "string",
        "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
       },
       {
        "type": "null"
       }
      ]
     },
     "entraTenantId": {
      "type": "string",
      "format": "uuid"
     },
     "minLength": {
      "type": "integer",
      "minimum": 12,
      "maximum": 128
     },
     "attributeMap": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
       "email": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
       },
       "givenName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
       },
       "familyName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
       }
      }
     },
     "mfaSource": {
      "type": "string",
      "enum": [
       "idp",
       "kanso_totp"
      ]
     },
     "authnContextMapping": {
      "oneOf": [
       {
        "type": "object",
        "required": [
         "classRefs",
         "maxAgeMinutes"
        ],
        "properties": {
         "classRefs": {
          "type": "array",
          "minItems": 1,
          "maxItems": 10,
          "items": {
           "type": "string",
           "maxLength": 256
          }
         },
         "maxAgeMinutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1440
         }
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "signOutAtIdp": {
      "type": "boolean"
     }
    }
   },
   "SignInMethodConfigView": {
    "type": "object",
    "required": [
     "method",
     "status",
     "enabled",
     "audience"
    ],
    "properties": {
     "method": {
      "type": "string",
      "enum": [
       "password",
       "google",
       "microsoft",
       "saml"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "not_configured",
       "configured",
       "enabled",
       "disabled"
      ]
     },
     "enabled": {
      "type": "boolean"
     },
     "audience": {
      "type": "string",
      "enum": [
       "members",
       "members_and_clients"
      ]
     },
     "hostedDomain": {
      "type": "string"
     },
     "entraTenantId": {
      "type": "string",
      "format": "uuid"
     },
     "minLength": {
      "type": "integer",
      "minimum": 12,
      "maximum": 128
     },
     "dependentAccounts": {
      "type": "integer",
      "minimum": 0,
      "description": "Accounts whose only usable method in this tenant is this one."
     },
     "saml": {
      "$ref": "#/components/schemas/SamlConfigurationView"
     }
    }
   },
   "SignInMethodImpact": {
    "type": "object",
    "required": [
     "sentence",
     "strandedAccounts",
     "strandedSample",
     "sessionsSteppingUp"
    ],
    "properties": {
     "sentence": {
      "type": "string",
      "maxLength": 300
     },
     "strandedAccounts": {
      "type": "integer",
      "minimum": 0
     },
     "strandedSample": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "memberId",
        "name",
        "email"
       ],
       "properties": {
        "memberId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "name": {
         "$ref": "#/components/schemas/PersonName"
        },
        "email": {
         "$ref": "#/components/schemas/EmailAddress"
        }
       }
      }
     },
     "sessionsSteppingUp": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "SignInMethodLastUsableProblem": {
    "description": "The problem `409 sign_in_method.last_usable` of an unlink (F-IDN-17.R03, XM-577, XM-580). It has the members of Problem and one extension, `tenants`. No other member is permitted.",
    "allOf": [
     {
      "$ref": "#/components/schemas/Problem"
     },
     {
      "type": "object",
      "required": [
       "tenants"
      ],
      "properties": {
       "code": {
        "type": "string",
        "enum": [
         "sign_in_method.last_usable"
        ]
       },
       "tenants": {
        "type": "array",
        "minItems": 1,
        "description": "The tenants that the unlink would leave without a sign-in method that the account holds, one item for each tenant, in tenant order. It names only tenants where the account itself has an active membership, so it names no other tenant. Show each item as one value: a tenant name can contain \", \". The `detail` text names the same tenants for people; do not parse it.",
        "items": {
         "type": "object",
         "required": [
          "id",
          "name"
         ],
         "properties": {
          "id": {
           "$ref": "#/components/schemas/Uuid"
          },
          "name": {
           "type": "string",
           "minLength": 1,
           "description": "The name of the tenant."
          }
         },
         "additionalProperties": false
        },
        "example": [
         {
          "id": "0195f1d2-6c4a-7b3e-9a10-4d2c8e7f5a01",
          "name": "Orbit Retail"
         }
        ]
       }
      }
     }
    ],
    "unevaluatedProperties": false
   },
   "SignInMethodsOverview": {
    "type": "object",
    "required": [
     "methods"
    ],
    "properties": {
     "methods": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "$ref": "#/components/schemas/AccountSignInMethodRow"
      }
     },
     "singleSignOn": {
      "type": "object",
      "description": "G-ACC-03 (F-IDN-17.R01): the single sign-on of the route tenant (`X-Kanso-Tenant`) for the person. `offered`: the tenant turned SAML on for the person's audience and no team of theirs narrows it away. `enforced`: a team of theirs signs in with SAML only. Absent without a tenant, or when the tenant is not active.",
      "required": [
       "offered",
       "enforced"
      ],
      "properties": {
       "offered": {
        "type": "boolean"
       },
       "enforced": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "SignedRequestView": {
    "type": "object",
    "required": [
     "method",
     "url",
     "headers",
     "expiresAt"
    ],
    "properties": {
     "method": {
      "type": "string",
      "enum": [
       "PUT",
       "POST",
       "DELETE"
      ]
     },
     "url": {
      "type": "string",
      "maxLength": 4096
     },
     "headers": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "SignedUrlView": {
    "description": "F-FIL-04.R12 — the signed URL of an allowed download or preview, for a request that cannot follow a redirect with its headers.",
    "type": "object",
    "required": [
     "url",
     "expiresAt"
    ],
    "properties": {
     "url": {
      "type": "string",
      "maxLength": 4096
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "SpendingAddRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "what",
     "kind",
     "amount",
     "fromMonth"
    ],
    "description": "A new spending (F-FIN-16 §5). On a project's page the project is the page's, and projectKey is refused.",
    "properties": {
     "what": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
     },
     "kind": {
      "$ref": "#/components/schemas/SpendingKind"
     },
     "amount": {
      "type": "string",
      "pattern": "^([1-9][0-9]{0,7}(\\.[0-9]{1,4})?|0\\.([1-9][0-9]{0,3}|0[1-9][0-9]{0,2}|00[1-9][0-9]?|000[1-9]))$",
      "description": "More than 0 and at most 10000000 (G262: the pattern refuses 0)."
     },
     "currency": {
      "$ref": "#/components/schemas/CurrencyCode"
     },
     "fromMonth": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "personId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     },
     "projectKey": {
      "oneOf": [
       {
        "type": "string",
        "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
       },
       {
        "type": "null"
       }
      ]
     },
     "category": {
      "oneOf": [
       {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "SpendingCategoryRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "category"
    ],
    "description": "The category of a line on every row (R22); null is No category.",
    "properties": {
     "category": {
      "oneOf": [
       {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "SpendingChangeRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "amount",
     "fromMonth"
    ],
    "description": "A new amount from a month on (R03); the month of the newest row corrects that row (R14). The amount takes the item's currency.",
    "properties": {
     "amount": {
      "type": "string",
      "pattern": "^([1-9][0-9]{0,7}(\\.[0-9]{1,4})?|0\\.([1-9][0-9]{0,3}|0[1-9][0-9]{0,2}|00[1-9][0-9]?|000[1-9]))$",
      "description": "More than 0 and at most 10000000; never 0 (G262). A line ends with stop_spending (monthly, yearly) or remove_spending (one time); one month changes with set_spending_month."
     },
     "fromMonth": {
      "$ref": "#/components/schemas/YearMonth"
     }
    }
   },
   "SpendingKind": {
    "type": "string",
    "enum": [
     "one_time",
     "monthly",
     "yearly"
    ]
   },
   "SpendingLineView": {
    "type": "object",
    "required": [
     "id",
     "what",
     "category",
     "kind",
     "amount",
     "from",
     "until",
     "active",
     "counted",
     "person",
     "project",
     "history",
     "monthAmounts",
     "monthsVersion"
    ],
    "description": "One line as it is now: the row in force (the first row while the line has not started; a stopped line shows its last amount). until is the last month with cost before a stop. counted is false for a line in another currency than EUR (shown, not in a total; R12).",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "what": {
      "type": "string"
     },
     "category": {
      "type": [
       "string",
       "null"
      ]
     },
     "kind": {
      "$ref": "#/components/schemas/SpendingKind"
     },
     "amount": {
      "$ref": "#/components/schemas/Money"
     },
     "from": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "until": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/YearMonth"
       },
       {
        "type": "null"
       }
      ]
     },
     "active": {
      "type": "boolean",
      "description": "The line costs in the current month."
     },
     "counted": {
      "type": "boolean"
     },
     "person": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/MemberRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "project": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/SpendingProjectRef"
       },
       {
        "type": "null"
       }
      ],
      "description": "Null is a global line."
     },
     "history": {
      "type": "array",
      "maxItems": 1000,
      "description": "Every row of the item, newest first.",
      "items": {
       "$ref": "#/components/schemas/SpendingRowView"
      }
     },
     "monthAmounts": {
      "type": "array",
      "maxItems": 1000,
      "description": "F-FIN-16.R23 — the months with their own amount, oldest first. In a month in which the line costs, the month's own amount replaces the amount of the line; in any other month it has no effect.",
      "items": {
       "$ref": "#/components/schemas/SpendingMonthAmountView"
      }
     },
     "monthsVersion": {
      "type": "integer",
      "minimum": 1,
      "description": "F-FIN-16.R23 — the If-Match of a one-month write (PUT or DELETE …/months/{month})."
     }
    }
   },
   "SpendingMonthAmountView": {
    "type": "object",
    "required": [
     "month",
     "amount"
    ],
    "properties": {
     "month": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "amount": {
      "$ref": "#/components/schemas/Money"
     }
    }
   },
   "SpendingMonthRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "amount"
    ],
    "description": "The amount of ONE month of a line (F-FIN-16.R23; a one-time line takes any month, R10a); 0 is \"nothing in that month\". The amount takes the item's currency.",
    "properties": {
     "amount": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,7})(\\.[0-9]{1,4})?$"
     }
    }
   },
   "SpendingProjectRef": {
    "type": "object",
    "required": [
     "key",
     "name"
    ],
    "properties": {
     "key": {
      "type": "string"
     },
     "name": {
      "type": "string"
     }
    }
   },
   "SpendingRowView": {
    "type": "object",
    "required": [
     "id",
     "from",
     "amount",
     "stopped"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "from": {
      "$ref": "#/components/schemas/YearMonth"
     },
     "amount": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ],
      "description": "Null on a stop row."
     },
     "stopped": {
      "type": "boolean"
     }
    }
   },
   "SpendingStopRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "fromMonth"
    ],
    "properties": {
     "fromMonth": {
      "$ref": "#/components/schemas/YearMonth"
     }
    }
   },
   "SpendingTotalsView": {
    "type": "object",
    "required": [
     "year",
     "monthly",
     "yearly",
     "oneTime"
    ],
    "description": "EUR only (R12) — the monthly and the yearly lines that cost now, and the one-time lines of the year.",
    "properties": {
     "year": {
      "type": "integer"
     },
     "monthly": {
      "$ref": "#/components/schemas/Money"
     },
     "yearly": {
      "$ref": "#/components/schemas/Money"
     },
     "oneTime": {
      "$ref": "#/components/schemas/Money"
     }
    }
   },
   "SpendingsView": {
    "type": "object",
    "required": [
     "lines",
     "byPerson",
     "totals",
     "categories",
     "can"
    ],
    "properties": {
     "lines": {
      "type": "array",
      "maxItems": 20000,
      "items": {
       "$ref": "#/components/schemas/SpendingLineView"
      }
     },
     "byPerson": {
      "type": "array",
      "maxItems": 20000,
      "items": {
       "$ref": "#/components/schemas/PersonSpendingsView"
      }
     },
     "totals": {
      "$ref": "#/components/schemas/SpendingTotalsView"
     },
     "categories": {
      "type": "array",
      "maxItems": 20000,
      "items": {
       "type": "string"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "change"
      ],
      "properties": {
       "change": {
        "type": "boolean",
        "description": "The caller may add, change, stop and remove lines on this page."
       }
      }
     }
    }
   },
   "SprintCompleteRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "F-WRK-08.R05 (the owner, register 29 November 2026, \"Carry-over to next sprint\"). An empty body keeps D-075: the unfinished tickets go to the top of the backlog.",
    "properties": {
     "carryOverTo": {
      "$ref": "#/components/schemas/Uuid",
      "description": "A planned sprint of the same project. The unfinished tickets go to its top, in their sprint order. Another id is 422 sprint.not_open at /carryOverTo."
     }
    }
   },
   "SprintCompletionResult": {
    "type": "object",
    "required": [
     "sprint",
     "completedTickets",
     "returnedTickets"
    ],
    "properties": {
     "sprint": {
      "$ref": "#/components/schemas/SprintView"
     },
     "completedTickets": {
      "type": "integer",
      "minimum": 0
     },
     "returnedTickets": {
      "type": "integer",
      "minimum": 0,
      "description": "The unfinished tickets that the completion moved — to the backlog, or to carriedTo."
     },
     "carriedTo": {
      "$ref": "#/components/schemas/Uuid",
      "description": "The planned sprint that took the unfinished tickets (F-WRK-08.R05; register 29 November 2026). Absent: they went to the backlog."
     }
    }
   },
   "SprintCreateRequest": {
    "type": "object",
    "required": [
     "startsOn",
     "endsOn"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "goal": {
      "type": "string",
      "maxLength": 500
     },
     "startsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "endsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "start": {
      "type": "boolean",
      "default": false,
      "description": "True starts the sprint at once (the dialog's \"Start sprint\")."
     },
     "capacityMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 6000000,
      "description": "F-WRK-08.R13: one total in minutes; only when the project estimates in time (else 422 sprint.capacity_unit)."
     },
     "capacityPoints": {
      "type": "number",
      "minimum": 0.1,
      "maximum": 100000,
      "description": "F-WRK-08.R13: one total in story points (one decimal at most); only when the project estimates in points. Never with capacityMinutes."
     }
    }
   },
   "SprintEpicLine": {
    "type": "object",
    "required": [
     "epic",
     "done",
     "total",
     "percent",
     "notes"
    ],
    "properties": {
     "epic": {
      "$ref": "#/components/schemas/EpicRef"
     },
     "done": {
      "type": "integer",
      "minimum": 0
     },
     "total": {
      "type": "integer",
      "minimum": 0
     },
     "percent": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "notes": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "object",
       "required": [
        "kind"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "in_review",
          "waiting_on_client",
          "over_estimate",
          "in_progress"
         ]
        },
        "count": {
         "type": "integer",
         "minimum": 1
        },
        "ticketKey": {
         "$ref": "#/components/schemas/TicketKey"
        }
       }
      }
     }
    }
   },
   "SprintPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "goal": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 500
     },
     "startsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "endsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "capacityMinutes": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 1,
      "maximum": 6000000,
      "description": "F-WRK-08.R13: a new capacity in minutes; null clears the capacity."
     },
     "capacityPoints": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0.1,
      "maximum": 100000,
      "description": "F-WRK-08.R13: a new capacity in points; null clears the capacity."
     }
    }
   },
   "SprintRef": {
    "type": "object",
    "required": [
     "id",
     "name",
     "endsOn"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Sprint 14"
     },
     "endsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "startsOn": {
      "$ref": "#/components/schemas/DateOnly",
      "description": "The first day of the sprint. Always present on TimelineView.sprints (the Timeline draws the sprint band from it, F-WRK-13; BE-WP1TL-2); absent on a ticket's sprint."
     }
    }
   },
   "SprintView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "startsOn",
     "endsOn",
     "state",
     "ticketCount",
     "goalProgress",
     "version",
     "can",
     "createdBy"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
     },
     "goal": {
      "type": "string",
      "maxLength": 500
     },
     "startsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "endsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "state": {
      "type": "string",
      "enum": [
       "planned",
       "active",
       "completed"
      ]
     },
     "daysLeft": {
      "type": "integer",
      "minimum": 0
     },
     "ticketCount": {
      "type": "integer",
      "minimum": 0
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "description": "Absent when the reader's mask hides Estimate; the goal is then computed without estimates."
     },
     "estimatePoints": {
      "$ref": "#/components/schemas/PointsTotal"
     },
     "capacityMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 6000000,
      "description": "F-WRK-08.R13 (register 29 November 2026): the capacity in minutes (unit time). Absent = no capacity in minutes."
     },
     "capacityPoints": {
      "type": "number",
      "minimum": 0.1,
      "maximum": 100000,
      "description": "F-WRK-08.R13: the capacity in story points (unit points). Absent = no capacity in points."
     },
     "goalProgress": {
      "$ref": "#/components/schemas/GoalProgressView"
     },
     "epics": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/SprintEpicLine"
      }
     },
     "completedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "start",
       "complete",
       "discard"
      ],
      "description": "The reader's own rights (F-WRK-08.R11), each with plan on an active project.",
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "start": {
        "type": "boolean",
        "description": "A planned sprint while no sprint of the project is active (F-WRK-08.R03)."
       },
       "complete": {
        "type": "boolean"
       },
       "discard": {
        "type": "boolean",
        "description": "A planned sprint (F-WRK-08.R08; its tickets return to the backlog)."
       }
      }
     },
     "createdBy": {
      "$ref": "#/components/schemas/CreatorMemberId",
      "description": "The member who planned the sprint (F-WRK-08.R12; XM-924)."
     }
    }
   },
   "SsoStartRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "email is required for the intents sign_in and invitation (422 email.invalid without it). For exit_export it is optional and only the IdP's login hint (XM-1072).",
    "properties": {
     "email": {
      "$ref": "#/components/schemas/EmailAddress"
     },
     "intended": {
      "$ref": "#/components/schemas/RelativeAppPath"
     },
     "intent": {
      "type": "string",
      "enum": [
       "sign_in",
       "invitation",
       "exit_export"
      ],
      "default": "sign_in",
      "description": "invitation starts the SAML acceptance of an invitation (F-TEN-08.R21, F-IDN-04.R14; CG-09); the tenant is the invitation's. exit_export starts the SAML step of the browser's exit attempt (F-PLT-09.R08; XM-1072); the tenant is the exit attempt's, never the e-mail's."
     },
     "invitationToken": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{43}$",
      "writeOnly": true,
      "description": "Required with intent invitation, never otherwise; the attempt keeps only its hash."
     }
    }
   },
   "StageColourKey": {
    "type": "string",
    "enum": [
     "blue",
     "orange",
     "violet",
     "green",
     "teal",
     "amber",
     "red",
     "slate"
    ]
   },
   "StageDraft": {
    "type": "object",
    "required": [
     "name",
     "kind",
     "colour",
     "presentation"
    ],
    "additionalProperties": false,
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "kind": {
      "$ref": "#/components/schemas/StageKindKey"
     },
     "colour": {
      "$ref": "#/components/schemas/StageColourKey"
     },
     "wipLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 999
     },
     "presentation": {
      "type": "string",
      "enum": [
       "shown",
       "merged",
       "hidden"
      ]
     },
     "mergedIntoIndex": {
      "type": "integer",
      "minimum": 0,
      "maximum": 19,
      "description": "Position in this list of the stage it is merged into."
     }
    }
   },
   "StageKindKey": {
    "type": "string",
    "enum": [
     "todo",
     "in_progress",
     "in_review",
     "done"
    ]
   },
   "StageListConsequence": {
    "type": "object",
    "required": [
     "stagesVersion",
     "valid",
     "removals",
     "presentationChanges",
     "kindChanges"
    ],
    "properties": {
     "stagesVersion": {
      "type": "integer",
      "minimum": 1
     },
     "valid": {
      "type": "boolean"
     },
     "removals": {
      "type": "array",
      "maxItems": 19,
      "items": {
       "type": "object",
       "required": [
        "stageId",
        "name",
        "ticketCount",
        "targetRequired"
       ],
       "properties": {
        "stageId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "name": {
         "type": "string",
         "maxLength": 40
        },
        "ticketCount": {
         "type": "integer",
         "minimum": 0
        },
        "targetRequired": {
         "type": "boolean"
        },
        "targetName": {
         "type": "string",
         "maxLength": 40
        }
       }
      }
     },
     "presentationChanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "stageId",
        "before",
        "after",
        "clientVisibleTickets"
       ],
       "properties": {
        "stageId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "before": {
         "type": "string",
         "maxLength": 60
        },
        "after": {
         "type": "string",
         "maxLength": 60
        },
        "clientVisibleTickets": {
         "type": "integer",
         "minimum": 0
        }
       }
      }
     },
     "kindChanges": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "stageId",
        "before",
        "after",
        "ticketCount"
       ],
       "properties": {
        "stageId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "before": {
         "$ref": "#/components/schemas/StageKindKey"
        },
        "after": {
         "$ref": "#/components/schemas/StageKindKey"
        },
        "ticketCount": {
         "type": "integer",
         "minimum": 0
        }
       }
      }
     },
     "errors": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/ProblemFieldError"
      }
     }
    }
   },
   "StageListRequest": {
    "type": "object",
    "required": [
     "stages"
    ],
    "additionalProperties": false,
    "properties": {
     "stages": {
      "type": "array",
      "minItems": 2,
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/StageDraft"
      }
     },
     "removals": {
      "type": "array",
      "maxItems": 19,
      "description": "Stages of the current list left out of stages, each with the surviving stage its tickets move to.",
      "items": {
       "type": "object",
       "required": [
        "stageId"
       ],
       "properties": {
        "stageId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "targetIndex": {
         "type": "integer",
         "minimum": 0,
         "maximum": 19
        }
       }
      }
     }
    }
   },
   "StageTemplate": {
    "type": "object",
    "required": [
     "name",
     "kind",
     "colour",
     "presentation"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "kind": {
      "$ref": "#/components/schemas/StageKindKey"
     },
     "colour": {
      "$ref": "#/components/schemas/StageColourKey"
     },
     "wipLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 999
     },
     "presentation": {
      "type": "string",
      "enum": [
       "shown",
       "merged",
       "hidden"
      ]
     },
     "mergedIntoIndex": {
      "type": "integer",
      "minimum": 0,
      "maximum": 19
     }
    }
   },
   "StageTicketCountList": {
    "type": "object",
    "required": [
     "stagesVersion",
     "stages"
    ],
    "properties": {
     "stagesVersion": {
      "type": "integer",
      "minimum": 1
     },
     "stages": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "stageId"
       ],
       "properties": {
        "stageId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "ticketCount": {
         "type": "integer",
         "minimum": 0,
         "description": "The live tickets in the stage that the caller may see; absent while the caller's plan hides the status (F-PRJ-06.R18)."
        }
       }
      }
     }
    }
   },
   "StandardFieldHintKey": {
    "type": "string",
    "enum": [
     "estimate",
     "start_date",
     "due_date",
     "priority"
    ]
   },
   "StepUpRequest": {
    "type": "object",
    "required": [
     "tenantId",
     "reason"
    ],
    "additionalProperties": false,
    "properties": {
     "tenantId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "reason": {
      "type": "string",
      "enum": [
       "tenant_entry",
       "saml",
       "totp"
      ]
     }
    }
   },
   "StoredFileView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "sizeBytes",
     "mimeType",
     "status",
     "purpose",
     "previews",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 255,
      "example": "approval-flow.pdf"
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1
     },
     "mimeType": {
      "type": "string",
      "maxLength": 127,
      "description": "The detected type once known, else the declared one."
     },
     "status": {
      "type": "string",
      "enum": [
       "pending",
       "scanning",
       "ready",
       "quarantined",
       "deleted"
      ]
     },
     "purpose": {
      "type": "string",
      "enum": [
       "attachment",
       "inline_image",
       "message_attachment",
       "import_source",
       "export",
       "branding_logo",
       "import_attachment",
       "expense_receipt"
      ]
     },
     "previews": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "type": "string",
       "enum": [
        "thumb",
        "view"
       ]
      }
     },
     "inlinePlayable": {
      "type": "boolean",
      "description": "True for MP4 and WebM, which play inline without previews."
     },
     "durationSeconds": {
      "type": "integer",
      "minimum": 0,
      "description": "Video duration from the container header, when known."
     },
     "scanFailed": {
      "type": "boolean"
     },
     "flags": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "enum": [
        "type_mismatch",
        "svg_active_content"
       ]
      }
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "readyAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "StoryPoints": {
    "type": "number",
    "minimum": 0,
    "maximum": 100,
    "multipleOf": 0.5,
    "description": "XM-1112 (F-WRK-42.R02): a value of the workspace's story-point scale (`work.estimate.pointScale`, a subset of the versioned catalogue 0, 0.5, 1, 2, 3, 5, 8, 13, 20, 21, 34, 40, 55, 89, 100).",
    "example": 5
   },
   "SubcontractorQuantity": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "hours",
     "supplierRate"
    ],
    "properties": {
     "hours": {
      "type": "number",
      "minimum": 0.25,
      "maximum": 10000,
      "multipleOf": 0.25
     },
     "supplierRate": {
      "$ref": "#/components/schemas/HourlyRate"
     }
    }
   },
   "SupportCaseReference": {
    "type": "string",
    "description": "The human case reference of a support access request (XM-997). 8 random characters, not the request's id and not derived from it. A label, never a credential.",
    "pattern": "^SUP-[A-HJ-NP-Z2-9]{4}-[A-HJ-NP-Z2-9]{4}$",
    "example": "SUP-7K2Q-M4XD"
   },
   "SupportDecisionNote": {
    "type": "object",
    "properties": {
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "SupportOperatorRef": {
    "type": "object",
    "description": "An operator as a tenant answer names them (F-PLT-13.R16; register §230 add. 2, Q19 (a) — every operator shows to tenants under one name; D-038; XM-997). The name is always \"Youniton support\" (the product name of 2 December 2026). The object has no role, because one constant role gives the tenant no information; this is the simpler of the two choices. It never holds the operator's own name, role, id, account or e-mail.",
    "additionalProperties": false,
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "enum": [
       "Youniton support"
      ]
     }
    }
   },
   "SupportProposalDecision": {
    "type": "object",
    "required": [
     "digest",
     "proposalVersion"
    ],
    "properties": {
     "digest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     },
     "proposalVersion": {
      "type": "integer",
      "minimum": 1
     },
     "activate": {
      "type": "boolean",
      "description": "Approve and apply at once (07 §7.4)."
     },
     "note": {
      "type": "string",
      "maxLength": 500
     }
    }
   },
   "SupportProposalDraft": {
    "type": "object",
    "required": [
     "operation",
     "target",
     "expectedVersion",
     "payload"
    ],
    "properties": {
     "operation": {
      "type": "object",
      "required": [
       "key",
       "version"
      ],
      "properties": {
       "key": {
        "type": "string",
        "maxLength": 80
       },
       "version": {
        "type": "integer",
        "minimum": 1
       }
      }
     },
     "target": {
      "type": "object",
      "required": [
       "type",
       "id"
      ],
      "properties": {
       "type": {
        "type": "string",
        "maxLength": 40
       },
       "id": {
        "$ref": "#/components/schemas/Uuid"
       }
      }
     },
     "expectedVersion": {
      "type": "integer",
      "minimum": 1
     },
     "payload": {
      "type": "object",
      "description": "The owner's command DTO for the catalogue entry, validated by its schema.",
      "maxProperties": 200,
      "additionalProperties": true
     },
     "reason": {
      "type": "string",
      "minLength": 3,
      "maxLength": 500,
      "description": "The operator's reason for this change, shown to the tenant's Admins (XM-997). Optional; a revision without it clears it. The submission freezes the reason the Admin reads (this one, else the request's) into the digest (07 §7.4, schema 2)."
     }
    }
   },
   "SupportProposalView": {
    "type": "object",
    "description": "Access's SupportChangeProposal as the tenant Admin and the operator see it (07 §7.4). A draft has no digest and no expiry yet (both are frozen at submission; platform-b, 21 Oct 2026).",
    "required": [
     "id",
     "supportRequestId",
     "section",
     "operator",
     "operation",
     "target",
     "expectedVersion",
     "classification",
     "state",
     "before",
     "after",
     "proposalVersion",
     "approvalsRequired",
     "approvals",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "supportRequestId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "caseReference": {
      "$ref": "#/components/schemas/SupportCaseReference"
     },
     "section": {
      "$ref": "#/components/schemas/SupportSection"
     },
     "operator": {
      "$ref": "#/components/schemas/SupportOperatorRef"
     },
     "operation": {
      "type": "object",
      "required": [
       "key",
       "version",
       "label"
      ],
      "properties": {
       "key": {
        "type": "string",
        "maxLength": 80,
        "example": "client_sharing.enable_guarded_field"
       },
       "version": {
        "type": "integer",
        "minimum": 1
       },
       "label": {
        "type": "string",
        "maxLength": 120
       }
      }
     },
     "target": {
      "$ref": "#/components/schemas/TypedRef"
     },
     "expectedVersion": {
      "type": "integer",
      "minimum": 1
     },
     "classification": {
      "type": "string",
      "enum": [
       "restrictive",
       "unchanged",
       "not_provably_narrower",
       "widening"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "draft",
       "proposed",
       "approved",
       "activated",
       "rejected",
       "expired",
       "superseded",
       "withdrawn"
      ]
     },
     "reason": {
      "type": "string",
      "minLength": 3,
      "maxLength": 500,
      "description": "The reason the approver reads, frozen at the submission into the proposal and its digest — the operator's reason, else the request's; a draft without its own reason shows the request's (XM-997). caseReference and reason are absent only when Platform no longer holds the request. submittedAt is the submission (R09); a draft has none."
     },
     "reasonSource": {
      "type": "string",
      "enum": [
       "operator",
       "request"
      ],
      "description": "Whose the reason is (REV-XM997-03) — the operator wrote it for this change, or it is the request's reason. Present with reason."
     },
     "submittedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "before": {
      "type": "object",
      "description": "The canonical before-snapshot under the section's redaction; never a secret.",
      "additionalProperties": true
     },
     "after": {
      "type": "object",
      "description": "The canonical payload (the owner's command DTO).",
      "additionalProperties": true
     },
     "digest": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     },
     "proposalVersion": {
      "type": "integer",
      "minimum": 1
     },
     "approvalsRequired": {
      "type": "integer",
      "enum": [
       1,
       2
      ]
     },
     "approvals": {
      "type": "array",
      "maxItems": 2,
      "items": {
       "type": "object",
       "required": [
        "member",
        "factor",
        "at"
       ],
       "properties": {
        "member": {
         "$ref": "#/components/schemas/NamedRef"
        },
        "factor": {
         "type": "string",
         "enum": [
          "totp",
          "sso"
         ]
        },
        "at": {
         "$ref": "#/components/schemas/Instant"
        }
       }
      }
     },
     "rejection": {
      "type": "object",
      "properties": {
       "member": {
        "$ref": "#/components/schemas/NamedRef"
       },
       "note": {
        "type": "string",
        "maxLength": 500
       }
      }
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "endedReason": {
      "type": "string",
      "enum": [
       "window_ended",
       "validity",
       "target_changed",
       "replaced"
      ]
     },
     "can": {
      "type": "object",
      "required": [
       "approve",
       "reject",
       "withdraw",
       "activate",
       "revise",
       "submit"
      ],
      "properties": {
       "approve": {
        "type": "boolean"
       },
       "reject": {
        "type": "boolean"
       },
       "withdraw": {
        "type": "boolean"
       },
       "activate": {
        "type": "boolean"
       },
       "revise": {
        "type": "boolean"
       },
       "submit": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "SupportSection": {
    "type": "string",
    "enum": [
     "security",
     "integrations",
     "ai_limits",
     "members",
     "teams",
     "roles",
     "client_sharing",
     "projects",
     "relationships",
     "messaging",
     "automation",
     "fields",
     "docs"
    ]
   },
   "TeamAvatarChoice": {
    "description": "OF-12 (F-TEN-11.R12) — the body of setTeamAvatar: the initial, or an icon of the registry. An image is uploaded through uploadTeamAvatarImage.",
    "type": "object",
    "required": [
     "kind"
    ],
    "additionalProperties": false,
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "initial",
       "icon"
      ]
     },
     "icon": {
      "$ref": "#/components/schemas/TeamIconName"
     }
    }
   },
   "TeamAvatarIndexView": {
    "description": "OF-12 (F-TEN-11.R12) — the teams with an icon or an image (at most 1,000); a team that is not listed shows its initial.",
    "type": "object",
    "required": [
     "teams"
    ],
    "properties": {
     "teams": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "type": "object",
       "required": [
        "teamId",
        "kind"
       ],
       "additionalProperties": false,
       "properties": {
        "teamId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "kind": {
         "type": "string",
         "enum": [
          "icon",
          "image"
         ]
        },
        "icon": {
         "$ref": "#/components/schemas/TeamIconName"
        },
        "imageTag": {
         "type": "string",
         "pattern": "^[0-9a-f]{16}$"
        }
       }
      }
     }
    }
   },
   "TeamAvatarView": {
    "description": "OF-12 (F-TEN-11.R12) — how the team shows: its initial (the default), an icon of the registry (`icon`), or an uploaded image (`imageTag`: the image's version tag; the image is GET /teams/{teamId}/avatar/image?tenant=…&v=<imageTag>).",
    "type": "object",
    "required": [
     "kind"
    ],
    "additionalProperties": false,
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "initial",
       "icon",
       "image"
      ]
     },
     "icon": {
      "$ref": "#/components/schemas/TeamIconName"
     },
     "imageTag": {
      "type": "string",
      "pattern": "^[0-9a-f]{16}$"
     }
    }
   },
   "TeamCard": {
    "type": "object",
    "required": [
     "id",
     "name",
     "memberCount",
     "projectCount",
     "memberInitials",
     "ssoEnforced",
     "signIn",
     "roleCounts",
     "version",
     "createdBy",
     "description",
     "avatar"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "maxLength": 80
     },
     "memberCount": {
      "type": "integer",
      "minimum": 0
     },
     "projectCount": {
      "type": "integer",
      "minimum": 0
     },
     "memberInitials": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "maxLength": 2
      }
     },
     "lead": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "ssoEnforced": {
      "type": "boolean"
     },
     "signIn": {
      "$ref": "#/components/schemas/TeamSignInSummary"
     },
     "roleCounts": {
      "description": "XM-1489 (F-TEN-10.R12) — the team's roles mix. One item for each role that one or more active members of the team have; a role with no member is absent. Order: the count descending, then the role name (case-insensitive; a deleted role after the named roles), then the role id. The counts add up to memberCount.",
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/TeamRoleCount"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "createdBy": {
      "$ref": "#/components/schemas/CreatorMemberId"
     },
     "description": {
      "description": "XM-991 (F-TEN-11.R11) — the team's description, plain text with line breaks; null when the team has none.",
      "type": [
       "string",
       "null"
      ],
      "maxLength": 500
     },
     "avatar": {
      "$ref": "#/components/schemas/TeamAvatarView"
     }
    }
   },
   "TeamCreateRequest": {
    "type": "object",
    "required": [
     "name"
    ],
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "description": {
      "description": "XM-991 (F-TEN-11.R11) — optional; at most 500 characters after trimming; null or a blank text is no description.",
      "type": [
       "string",
       "null"
      ],
      "maxLength": 4000
     },
     "leadMemberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "memberIds": {
      "type": "array",
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "transferProjectKeys": {
      "type": "array",
      "maxItems": 50,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "pattern": "^[A-Z][A-Z0-9]{1,9}$"
      }
     }
    }
   },
   "TeamCreateResult": {
    "type": "object",
    "required": [
     "team",
     "transfers"
    ],
    "properties": {
     "team": {
      "$ref": "#/components/schemas/TeamCard"
     },
     "transfers": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "object",
       "required": [
        "projectKey",
        "outcome"
       ],
       "properties": {
        "projectKey": {
         "type": "string"
        },
        "outcome": {
         "type": "string",
         "enum": [
          "moved",
          "refused",
          "unknown"
         ]
        },
        "reason": {
         "type": "string",
         "maxLength": 64
        }
       }
      }
     }
    }
   },
   "TeamDetail": {
    "type": "object",
    "required": [
     "team",
     "members",
     "memberTotal",
     "projects",
     "signIn",
     "can"
    ],
    "properties": {
     "team": {
      "$ref": "#/components/schemas/TeamCard"
     },
     "members": {
      "type": "array",
      "maxItems": 6,
      "items": {
       "$ref": "#/components/schemas/TeamMemberRow"
      }
     },
     "memberTotal": {
      "type": "integer",
      "minimum": 0
     },
     "projects": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "type": "object",
       "required": [
        "id",
        "key",
        "name"
       ],
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "key": {
         "$ref": "#/components/schemas/ProjectKey"
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "signIn": {
      "type": "object",
      "required": [
       "ssoEnforced",
       "allEnabled",
       "allowedMethods"
      ],
      "properties": {
       "ssoEnforced": {
        "type": "boolean"
       },
       "allEnabled": {
        "type": "boolean"
       },
       "allowedMethods": {
        "type": "array",
        "maxItems": 4,
        "items": {
         "type": "string",
         "enum": [
          "password",
          "google",
          "microsoft",
          "saml"
         ]
        }
       },
       "domain": {
        "type": "string"
       }
      }
     },
     "can": {
      "type": "object",
      "properties": {
       "rename": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       },
       "addMembers": {
        "type": "boolean"
       },
       "editSignInPolicy": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "TeamExportScope": {
    "type": "object",
    "additionalProperties": false,
    "description": "The team variant of the export (F-TIM-12.R10). The rows are the worklogs of the people of the exporter's Team timesheets reach (or of one team of the reach). The period is 1–42 days. `projectKey` and `memberId` are refused with it. The CSV has a leading `group` column.",
    "required": [
     "groupBy"
    ],
    "properties": {
     "groupBy": {
      "type": "string",
      "enum": [
       "team",
       "project",
       "client"
      ]
     },
     "teamId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "TeamIconName": {
    "description": "OF-12 (F-TEN-11.R12) — the team icon registry, version 1 (the UI's icon names, lucide, kebab case). A new icon is a new name at the end; a name is never removed or renamed.",
    "type": "string",
    "enum": [
     "sparkles",
     "layers",
     "briefcase",
     "git-branch",
     "package",
     "users",
     "rocket",
     "code",
     "palette",
     "megaphone",
     "headset",
     "chart-column",
     "shield",
     "globe",
     "wrench",
     "heart"
    ]
   },
   "TeamLeadUpdate": {
    "type": "object",
    "required": [
     "memberId"
    ],
    "additionalProperties": false,
    "properties": {
     "memberId": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Uuid"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "TeamMemberRow": {
    "type": "object",
    "required": [
     "memberId",
     "name",
     "role",
     "joinedAt",
     "isLead",
     "memberVersion"
    ],
    "properties": {
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "$ref": "#/components/schemas/PersonName"
     },
     "initials": {
      "type": "string",
      "maxLength": 2
     },
     "role": {
      "$ref": "#/components/schemas/RoleRef"
     },
     "joinedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "isLead": {
      "type": "boolean"
     },
     "email": {
      "description": "XM-992 (F-TEN-10.R11) — present only for a reader who may administer Members (the directory's e-mail rule, F-TEN-04 §6).",
      "type": "string",
      "format": "email"
     },
     "memberVersion": {
      "description": "XM-992 widened by G-C-29 (F-TEN-10.R11) — the member's version, the If-Match of updateMember (\"Change role\"); not the team's version.",
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "TeamMembersAdd": {
    "type": "object",
    "required": [
     "memberIds"
    ],
    "additionalProperties": false,
    "properties": {
     "memberIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "TeamPeriod": {
    "type": "object",
    "required": [
     "project",
     "period",
     "rows",
     "eligibleApprovers"
    ],
    "properties": {
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "period": {
      "$ref": "#/components/schemas/TimesheetPeriodView"
     },
     "rows": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/TeamPeriodRow"
      }
     },
     "eligibleApprovers": {
      "type": "integer",
      "minimum": 0
     }
    }
   },
   "TeamPeriodRow": {
    "type": "object",
    "required": [
     "member",
     "capacityMinutes",
     "totalMinutes",
     "self"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "jobTitle": {
      "type": "string",
      "maxLength": 80
     },
     "capacityMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "totalMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "timesheet": {
      "$ref": "#/components/schemas/TimesheetView"
     },
     "self": {
      "type": "boolean",
      "description": "The viewer's own row — never approvable by the viewer."
     }
    }
   },
   "TeamRename": {
    "description": "XM-991 (F-TEN-11.R11) — the name, the description, or both; a member that is absent stays as it is.",
    "type": "object",
    "minProperties": 1,
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "description": {
      "description": "at most 500 characters after trimming; null or a blank text clears the description.",
      "type": [
       "string",
       "null"
      ],
      "maxLength": 4000
     }
    }
   },
   "TeamRoleCount": {
    "description": "XM-1489 (F-TEN-10.R12) — a tenant role and the count of the team's active members that have it.",
    "type": "object",
    "required": [
     "roleId",
     "name",
     "count"
    ],
    "properties": {
     "roleId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "description": "the role's name; \"Deleted role\" when the role is not in the tenant's role list.",
      "type": "string",
      "maxLength": 60
     },
     "count": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "TeamSignInPolicyUpdate": {
    "type": "object",
    "required": [
     "allowedMethods",
     "ssoEnforced"
    ],
    "additionalProperties": false,
    "properties": {
     "allowedMethods": {
      "description": "null means every enabled method (no narrowing).",
      "oneOf": [
       {
        "type": "array",
        "minItems": 1,
        "maxItems": 4,
        "uniqueItems": true,
        "items": {
         "type": "string",
         "enum": [
          "password",
          "google",
          "microsoft",
          "saml"
         ]
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "ssoEnforced": {
      "type": "boolean"
     }
    }
   },
   "TeamSignInPolicyView": {
    "type": "object",
    "required": [
     "teamId",
     "teamName",
     "allowedMethods",
     "ssoEnforced",
     "allEnabled"
    ],
    "properties": {
     "teamId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "teamName": {
      "type": "string",
      "maxLength": 80
     },
     "allowedMethods": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "enum": [
        "password",
        "google",
        "microsoft",
        "saml"
       ]
      }
     },
     "ssoEnforced": {
      "type": "boolean"
     },
     "allEnabled": {
      "type": "boolean",
      "description": "No narrowing (\"All enabled methods\")."
     }
    }
   },
   "TeamSignInSummary": {
    "description": "XM-1489 (F-TEN-10.R06, R12) — the team's sign-in rule on its card. It has the same values as TeamDetail.signIn, without the domain. allEnabled true: the team has no narrowing (every method that the tenant has on); ssoEnforced true: SAML only.",
    "type": "object",
    "required": [
     "ssoEnforced",
     "allEnabled",
     "allowedMethods"
    ],
    "properties": {
     "ssoEnforced": {
      "type": "boolean"
     },
     "allEnabled": {
      "type": "boolean"
     },
     "allowedMethods": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "type": "string",
       "enum": [
        "password",
        "google",
        "microsoft",
        "saml"
       ]
      }
     }
    }
   },
   "TeamTimesheetDay": {
    "type": "object",
    "required": [
     "date",
     "minutes",
     "billableMinutes"
    ],
    "properties": {
     "date": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "minutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "billableMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     }
    }
   },
   "TeamTimesheetEntry": {
    "type": "object",
    "required": [
     "id",
     "workedOn",
     "minutes",
     "billable",
     "effectiveBillable"
    ],
    "description": "F-TIM-12.R07: one worklog of the drill-down. On a project the reader may not see, only id, workedOn, minutes, billable, effectiveBillable and `hidden: true`.",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "loggedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "ticket": {
      "$ref": "#/components/schemas/TimeTicketRef"
     },
     "category": {
      "$ref": "#/components/schemas/TimeCategoryRef"
     },
     "workedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "minutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440
     },
     "startTime": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
     },
     "endTime": {
      "type": "string",
      "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
     },
     "billable": {
      "type": "boolean",
      "description": "The entry's own billable mark."
     },
     "effectiveBillable": {
      "type": "boolean",
      "description": "F-TIM-12.R04: the mark AND Finance's billability rule (a billable project; a ticket, or a billable category)."
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "hidden": {
      "type": "boolean",
      "const": true
     }
    }
   },
   "TeamTimesheetGroup": {
    "type": "object",
    "required": [
     "key"
    ],
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 36,
      "description": "A team, project or client organisation id; or `internal` (projects without a client), `hidden` (projects or clients the reader may not see) or `no_team` (a person in no team of the reach)."
     },
     "label": {
      "type": "string",
      "maxLength": 200,
      "description": "The team or client name, or the project's key and name. Absent for the fixed keys."
     }
    }
   },
   "TeamTimesheetPerson": {
    "type": "object",
    "required": [
     "member",
     "teamIds",
     "minutes",
     "billableMinutes",
     "rows"
    ],
    "properties": {
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "jobTitle": {
      "type": "string",
      "maxLength": 80
     },
     "teamIds": {
      "type": "array",
      "maxItems": 200,
      "description": "The teams of the reach that the person is in.",
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "status": {
      "type": "string",
      "enum": [
       "draft",
       "submitted",
       "approved",
       "returned"
      ],
      "description": "F-TIM-12.R06: the least settled state of the person's sheets that overlap the period (returned, draft, submitted, approved). Absent when the person has no sheet."
     },
     "minutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "billableMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "rows": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "$ref": "#/components/schemas/TeamTimesheetRow"
      }
     }
    }
   },
   "TeamTimesheetRow": {
    "type": "object",
    "required": [
     "group",
     "minutes",
     "billableMinutes",
     "days"
    ],
    "properties": {
     "group": {
      "type": "string",
      "maxLength": 36,
      "description": "The key of a `TeamTimesheetGroup` of the read (F-TIM-12.R05)."
     },
     "minutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "billableMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "days": {
      "type": "array",
      "maxItems": 42,
      "description": "The days with time, in date order.",
      "items": {
       "$ref": "#/components/schemas/TeamTimesheetDay"
      }
     }
    }
   },
   "TeamTimesheets": {
    "type": "object",
    "required": [
     "period",
     "groupBy",
     "scope",
     "groups",
     "people"
    ],
    "properties": {
     "period": {
      "type": "object",
      "required": [
       "from",
       "to"
      ],
      "properties": {
       "from": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "to": {
        "$ref": "#/components/schemas/DateOnly"
       }
      }
     },
     "groupBy": {
      "type": "string",
      "enum": [
       "team",
       "project",
       "client"
      ]
     },
     "scope": {
      "$ref": "#/components/schemas/TimesheetScopeKey"
     },
     "groups": {
      "type": "array",
      "maxItems": 5000,
      "items": {
       "$ref": "#/components/schemas/TeamTimesheetGroup"
      }
     },
     "people": {
      "type": "array",
      "maxItems": 20000,
      "description": "The people of the reader's reach, each once, by name (no ranking, F-TIM-12.R11).",
      "items": {
       "$ref": "#/components/schemas/TeamTimesheetPerson"
      }
     }
    }
   },
   "TenantBudgetRow": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "project",
     "budget",
     "spent",
     "actuals",
     "actualsCounted",
     "spendings",
     "left",
     "usedPercent",
     "status",
     "people"
    ],
    "description": "One project of the tenant Finance overview: the same figures as the project's own budget read (ProjectBudgetView, without can and version).",
    "properties": {
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "budget": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ]
     },
     "spent": {
      "$ref": "#/components/schemas/Money"
     },
     "actuals": {
      "$ref": "#/components/schemas/Money"
     },
     "actualsCounted": {
      "type": "boolean",
      "description": "false: the project's currency is not EUR; its actual costs are shown and not added (R12)."
     },
     "spendings": {
      "$ref": "#/components/schemas/Money"
     },
     "left": {
      "oneOf": [
       {
        "$ref": "#/components/schemas/Money"
       },
       {
        "type": "null"
       }
      ]
     },
     "usedPercent": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 0
     },
     "status": {
      "type": "string",
      "enum": [
       "on_track",
       "near_limit",
       "over",
       "no_budget"
      ]
     },
     "people": {
      "$ref": "#/components/schemas/PeopleCostView"
     }
    }
   },
   "TenantBudgetsView": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "rows",
     "totals",
     "truncated"
    ],
    "description": "The tenant Finance overview (owner, 22 Nov 2026): every active project whose money the reader may read (view_finance and the project page's money gate, R19), by key, at most 1,000. Totals in EUR: usedPercent = the spent of the projects with a budget ÷ the total budget (null without a budget); the people totals add the counted rows only; remainingComplete false: a row's remaining estimates are hidden. truncated: more than 1,000 such projects.",
    "properties": {
     "rows": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "$ref": "#/components/schemas/TenantBudgetRow"
      }
     },
     "totals": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "budget",
       "spent",
       "usedPercent",
       "people"
      ],
      "properties": {
       "budget": {
        "$ref": "#/components/schemas/Money"
       },
       "spent": {
        "$ref": "#/components/schemas/Money"
       },
       "usedPercent": {
        "type": [
         "integer",
         "null"
        ],
        "minimum": 0
       },
       "people": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "actual",
         "provisional",
         "remaining",
         "remainingComplete"
        ],
        "properties": {
         "actual": {
          "$ref": "#/components/schemas/Money"
         },
         "provisional": {
          "$ref": "#/components/schemas/Money"
         },
         "remaining": {
          "$ref": "#/components/schemas/Money"
         },
         "remainingComplete": {
          "type": "boolean"
         }
        }
       }
      }
     },
     "truncated": {
      "type": "boolean"
     }
    }
   },
   "TenantCountsView": {
    "type": "object",
    "required": [
     "members",
     "internalMembers",
     "clientGuests",
     "pendingInvitations",
     "teams",
     "projects"
    ],
    "properties": {
     "members": {
      "type": "integer",
      "minimum": 0,
      "description": "Active members of both audiences (D-023)."
     },
     "internalMembers": {
      "type": "integer",
      "minimum": 0
     },
     "clientGuests": {
      "type": "integer",
      "minimum": 0
     },
     "pendingInvitations": {
      "type": "integer",
      "minimum": 0,
      "description": "Pending and unexpired."
     },
     "teams": {
      "type": "integer",
      "minimum": 0
     },
     "projects": {
      "type": "integer",
      "minimum": 0,
      "description": "Not archived."
     }
    }
   },
   "TenantExportView": {
    "type": "object",
    "required": [
     "id",
     "state",
     "createdAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "state": {
      "type": "string",
      "enum": [
       "queued",
       "generating",
       "ready",
       "failed",
       "expired",
       "withdrawn"
      ],
      "description": "`withdrawn` (XM-244) — a member erasure invalidated the export; request a new one. The cause is never shown."
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "readyAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 0
     },
     "manifestSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     },
     "manifest": {
      "type": "object",
      "description": "Files and counts per file; never content. The per-file SHA-256 is in the archive's own manifest.json; manifestSha256 is that manifest.json's SHA-256, so it vouches for every file's digest — XP-11, the stored row keeps counts per aggregate type only.",
      "properties": {
       "schemaVersion": {
        "type": "integer",
        "minimum": 1
       },
       "files": {
        "type": "array",
        "maxItems": 200,
        "items": {
         "type": "object",
         "required": [
          "name",
          "count"
         ],
         "properties": {
          "name": {
           "type": "string",
           "maxLength": 120
          },
          "count": {
           "type": "integer",
           "minimum": 0
          },
          "sha256": {
           "type": "string",
           "pattern": "^[0-9a-f]{64}$"
          }
         }
        }
       }
      }
     }
    }
   },
   "TenantNavigationFactKey": {
    "type": "string",
    "description": "A tenant-level navigation fact of the session read (§8 `TenantNavigationSource`; XM-554; workspace §10 `navigation`), in the vocabulary's order; the SPA drops a value it does not know.",
    "enum": [
     "clients",
     "documents",
     "reports",
     "finance",
     "finance-admin",
     "finance-cashflow",
     "memory-admin"
    ],
    "x-extensible-enum": true
   },
   "TenantOverview": {
    "type": "object",
    "required": [
     "tenantName",
     "counts",
     "twoFactor",
     "projects",
     "projectTotal",
     "checklist"
    ],
    "properties": {
     "tenantName": {
      "type": "string",
      "maxLength": 200
     },
     "counts": {
      "$ref": "#/components/schemas/TenantCountsView"
     },
     "twoFactor": {
      "type": "object",
      "required": [
       "enrolled",
       "members"
      ],
      "properties": {
       "enrolled": {
        "type": "integer",
        "minimum": 0
       },
       "members": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "projects": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/OverviewProjectRow"
      }
     },
     "projectTotal": {
      "type": "integer",
      "minimum": 0
     },
     "checklist": {
      "$ref": "#/components/schemas/SetupChecklistView"
     },
     "unavailable": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "uniqueItems": true,
      "description": "The parts whose source could not be read (F-TEN-02.R09, §13 \"Partial failure\", S05; XM-1003). A listed part's members carry placeholders (0, no rows, five open items with checked false) that the SPA does not show: it renders \"Couldn't load this panel\" with Retry there, and the other parts render. counts — counts (except counts.projects) and twoFactor; projects — projects, projectTotal and counts.projects; checklist — checklist. Absent when every part was read.",
      "items": {
       "type": "string",
       "enum": [
        "counts",
        "projects",
        "checklist"
       ]
      }
     }
    }
   },
   "TenantSecurityOverview": {
    "type": "object",
    "required": [
     "methods",
     "teamPolicies",
     "twoFactor",
     "sessions",
     "tokens",
     "version"
    ],
    "properties": {
     "methods": {
      "type": "array",
      "maxItems": 4,
      "items": {
       "$ref": "#/components/schemas/SignInMethodConfigView"
      }
     },
     "teamPolicies": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/TeamSignInPolicyView"
      }
     },
     "twoFactor": {
      "type": "object",
      "required": [
       "policy",
       "trustedDevicesAllowed",
       "trustedDevicesPreselected",
       "enrolled",
       "members",
       "notEnrolled",
       "requiredNotEnrolled"
      ],
      "properties": {
       "policy": {
        "type": "string",
        "enum": [
         "everyone",
         "admins",
         "optional"
        ]
       },
       "trustedDevicesAllowed": {
        "type": "boolean"
       },
       "trustedDevicesPreselected": {
        "type": "boolean"
       },
       "reminderCooldownHours": {
        "type": "integer",
        "minimum": 24,
        "maximum": 168
       },
       "enrolled": {
        "type": "integer",
        "minimum": 0
       },
       "members": {
        "type": "integer",
        "minimum": 0
       },
       "notEnrolled": {
        "type": "integer",
        "minimum": 0
       },
       "requiredNotEnrolled": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "sessions": {
      "type": "object",
      "required": [
       "maxLifetimeMinutes",
       "idleTimeoutMinutes",
       "activeSessions",
       "activeMembers"
      ],
      "properties": {
       "maxLifetimeMinutes": {
        "type": "integer",
        "minimum": 60,
        "maximum": 129600
       },
       "idleTimeoutMinutes": {
        "type": "integer",
        "minimum": 15,
        "maximum": 10080
       },
       "activeSessions": {
        "type": "integer",
        "minimum": 0
       },
       "activeMembers": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "tokens": {
      "type": "object",
      "required": [
       "allowed",
       "maxLifetimeDays",
       "activeTokens"
      ],
      "properties": {
       "allowed": {
        "type": "boolean"
       },
       "maxLifetimeDays": {
        "type": "integer",
        "minimum": 1,
        "maximum": 365
       },
       "activeTokens": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "samlAvailable": {
      "type": "boolean",
      "description": "The plan includes SAML; false keeps an existing enforcement (SEC-09)."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "supportContact": {
      "type": "object",
      "description": "The platform's support contact for \"Contact Youniton support\" (F-IDN-22.R16; XM-1129), set by an Owner on the console. Both members null means not set: the control shows its designed empty state. No operator data.",
      "required": [
       "webAddress",
       "email"
      ],
      "properties": {
       "webAddress": {
        "type": [
         "string",
         "null"
        ],
        "format": "uri",
        "maxLength": 2048,
        "description": "An https address."
       },
       "email": {
        "type": [
         "string",
         "null"
        ],
        "format": "email",
        "maxLength": 254
       }
      }
     }
    }
   },
   "TenantSupportRequestView": {
    "type": "object",
    "description": "The tenant Admin's view of a support request on app.<apex> (F-PLT-13). It never holds the operator's own name, role, id, account or e-mail (F-PLT-13.R07, R16; D-038; register §230 add. 2, Q19 (a)).",
    "required": [
     "id",
     "operatorName",
     "operator",
     "caseReference",
     "section",
     "windowHours",
     "reason",
     "state",
     "requestedAt",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "operatorName": {
      "type": "string",
      "enum": [
       "Youniton support"
      ],
      "description": "Always \"Youniton support\" (F-PLT-13.R16; register §230 add. 2, Q19 (a)); the same as operator.name."
     },
     "operator": {
      "$ref": "#/components/schemas/SupportOperatorRef"
     },
     "caseReference": {
      "$ref": "#/components/schemas/SupportCaseReference"
     },
     "section": {
      "$ref": "#/components/schemas/SupportSection"
     },
     "windowHours": {
      "type": "integer",
      "minimum": 1,
      "maximum": 24
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     },
     "state": {
      "type": "string",
      "enum": [
       "requested",
       "approved",
       "active",
       "denied",
       "expired",
       "revoked",
       "withdrawn"
      ]
     },
     "requestedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "decidedBy": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "until": {
      "$ref": "#/components/schemas/Instant"
     },
     "pendingProposals": {
      "type": "integer",
      "minimum": 0
     },
     "can": {
      "type": "object",
      "required": [
       "approve",
       "deny",
       "revoke"
      ],
      "properties": {
       "approve": {
        "type": "boolean"
       },
       "deny": {
        "type": "boolean"
       },
       "revoke": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "TextRevisionView": {
    "type": "object",
    "required": [
     "id",
     "field",
     "length",
     "createdAt"
    ],
    "properties": {
     "redacted": {
      "type": "object",
      "required": [
       "at"
      ],
      "description": "An Admin redacted the revision (F-WRK-36.R13); the body holds the notice only.",
      "properties": {
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "by": {
        "$ref": "#/components/schemas/MemberRef"
       }
      }
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "field": {
      "type": "string",
      "enum": [
       "description",
       "custom_field"
      ]
     },
     "customFieldKey": {
      "$ref": "#/components/schemas/CustomFieldKey"
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "text": {
      "type": "string",
      "maxLength": 100000
     },
     "length": {
      "type": "integer",
      "minimum": 0
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "ThreadHistoryShareRequest": {
    "type": "object",
    "required": [
     "commentIds",
     "expectedClientVersion"
    ],
    "additionalProperties": false,
    "properties": {
     "commentIds": {
      "type": "array",
      "minItems": 1,
      "maxItems": 500,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     }
    }
   },
   "TicketCan": {
    "type": "object",
    "required": [
     "edit",
     "changeStatus",
     "rerank",
     "plan",
     "comment",
     "commentClient",
     "attach",
     "logTime",
     "setClientVisibility",
     "requestApproval",
     "delete"
    ],
    "properties": {
     "edit": {
      "type": "boolean"
     },
     "changeStatus": {
      "type": "boolean"
     },
     "rerank": {
      "type": "boolean"
     },
     "plan": {
      "type": "boolean"
     },
     "comment": {
      "type": "boolean"
     },
     "commentClient": {
      "type": "boolean"
     },
     "attach": {
      "type": "boolean"
     },
     "logTime": {
      "type": "boolean"
     },
     "setClientVisibility": {
      "type": "boolean"
     },
     "requestApproval": {
      "type": "boolean"
     },
     "delete": {
      "type": "boolean"
     }
    }
   },
   "TicketCard": {
    "type": "object",
    "required": [
     "id",
     "key",
     "title",
     "priority",
     "clientVisible",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "priority": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "epic": {
      "$ref": "#/components/schemas/EpicRef"
     },
     "clientVisible": {
      "type": "boolean"
     },
     "mergeRequest": {
      "$ref": "#/components/schemas/MergeRequestChip"
     },
     "loggedMinutes": {
      "type": "integer",
      "minimum": 0
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
     },
     "estimatePoints": {
      "$ref": "#/components/schemas/StoryPoints"
     },
     "overEstimate": {
      "type": "boolean"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "onCardFields": {
      "$ref": "#/components/schemas/CustomFieldValueMap"
     },
     "type": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "parent": {
      "$ref": "#/components/schemas/ParentRef"
     },
     "blocked": {
      "type": "boolean",
      "description": "Spec BF-1: a visible open blocker exists (F-WRK-34); absent reads false."
     },
     "labelIds": {
      "$ref": "#/components/schemas/RowLabelIds"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "changeStatus",
       "rerank",
       "edit"
      ],
      "properties": {
       "changeStatus": {
        "type": "boolean"
       },
       "rerank": {
        "type": "boolean"
       },
       "edit": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "TicketChildRow": {
    "type": "object",
    "required": [
     "key",
     "version"
    ],
    "description": "The type is absent when Type is masked, and blocked when Relations is masked (SR-BF1-22).",
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "type": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "stage": {
      "$ref": "#/components/schemas/TicketStage"
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
     },
     "priority": {
      "description": "XM-1103: the child's priority (not maskable, as on TicketCard). Absent only in the type-change preview, which does not read it.",
      "allOf": [
       {
        "$ref": "#/components/schemas/TicketPriority"
       }
      ]
     },
     "dueDate": {
      "description": "XM-1103: the child's due date; absent when unset or when Due date is masked.",
      "allOf": [
       {
        "$ref": "#/components/schemas/DateOnly"
       }
      ]
     },
     "childCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
     },
     "blocked": {
      "type": "boolean"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "description": "XM-865: present on every row of listTicketChildren; absent on the rows of a type change preview.",
      "required": [
       "rerank"
      ],
      "properties": {
       "rerank": {
        "type": "boolean",
        "description": "The reader may reorder this row among its parent's children: PUT /tickets/{ticketKey}/position with scope parent (F-WRK-03.R25), or scope epic under an epic-level parent (R14). True when the reader has rerank on the active project: the same rule as EpicTicketRow.can.rerank."
       }
      }
     }
    }
   },
   "TicketCopiedFromView": {
    "type": "object",
    "description": "XM-1108 (F-WRK-16.R22): \"Duplicated from ORB-12\" or \"Moved from ORB-12\".",
    "required": [
     "key",
     "kind"
    ],
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}-[1-9][0-9]{0,8}$",
      "example": "ORB-12"
     },
     "kind": {
      "type": "string",
      "enum": [
       "duplicate",
       "move"
      ]
     }
    }
   },
   "TicketCopyRequest": {
    "type": "object",
    "additionalProperties": false,
    "description": "XM-1108 (F-WRK-16.R15–R18): the target project. Duplicate: absent = the source's own project. Move: required, another project than the source's.",
    "properties": {
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "example": "WEB"
     }
    }
   },
   "TicketCreateRequest": {
    "type": "object",
    "required": [
     "title"
    ],
    "additionalProperties": false,
    "properties": {
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Add a reason to the reject step"
     },
     "description": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "stageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "inActiveSprint": {
      "type": "boolean",
      "default": false,
      "description": "True from a board column \"+\" (D-077): the active sprint and the column's stage, ranked last in the column. XM-926 keeps it as this shortcut. With sprintId too, sprintId must be the active sprint (422 ticket.sprint_conflict at /sprintId)."
     },
     "sprintId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "XM-926 (F-WRK-23.R17): needs plan on the project (403 access.forbidden, capability plan, before any 422; the column \"+\" with inActiveSprint needs only create). An open sprint of the project — the active sprint or a planned sprint; the ticket goes into it, ranked last. Another id (a completed sprint, another project's or tenant's, an unknown id, or any id while Backlog & sprints is off) is 422 sprint.not_open at /sprintId. Absent: the backlog, or the active sprint with inActiveSprint."
     },
     "priority": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "assigneeId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "reporterId": {
      "$ref": "#/components/schemas/Uuid",
      "description": "XM-926 (F-WRK-23.R16): the reporter; absent or the creator — the creator. Another member needs plan on the project (403 access.forbidden, capability plan) and must be an active internal member who may see the project (422 ticket.reporter_not_eligible)."
     },
     "labelIds": {
      "type": "array",
      "description": "XM-926 (F-WRK-23.R18): active labels of the project; an archived one is 422 label.archived, any other id 422 label.not_in_project, at /labelIds/<index>.",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "startDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
     },
     "estimatePoints": {
      "$ref": "#/components/schemas/StoryPoints"
     },
     "clientVisible": {
      "type": "boolean",
      "default": false
     },
     "expectedClientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "fileIds": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "customFields": {
      "$ref": "#/components/schemas/CustomFieldInputMap"
     },
     "typeKey": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,29}$",
      "description": "Spec BF-1: an active type of the project; absent → the default type (F-WRK-30.R08)."
     },
     "parentKey": {
      "$ref": "#/components/schemas/TicketKey"
     }
    }
   },
   "TicketDetail": {
    "type": "object",
    "description": "Every member a field mask can hide — title (Title), stage (Status), description, dueDate, assignee, estimateMinutes, loggedMinutes, labels, counts and the masked custom fields — is optional and absent when masked, never null (F-ACC-04.R08; 05 §4.3 \"every maskable member is optional\"; P2 round 2). Spec BF-1 (SR-BF1-22) — type (Type), hierarchy (Hierarchy), dependency and relationCount (Relations) follow the same rule (§3.9).",
    "required": [
     "id",
     "key",
     "projectKey",
     "priority",
     "clientVisible",
     "customFields",
     "createdAt",
     "updatedAt",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "projectKey": {
      "$ref": "#/components/schemas/ProjectKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "example": "Design the approval experience",
      "description": "Absent when Title is masked."
     },
     "description": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "descriptionMentions": {
      "type": "array",
      "maxItems": 50,
      "description": "The members the description's mention nodes name, in order of first mention, resolved at read (`former` once removed; F-WRK-25.R11, XM-936). Absent when Description is masked or the description mentions nobody.",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "descriptionTicketRefs": {
      "type": "array",
      "maxItems": 20,
      "description": "Q30 (22 Nov 2026) — the tickets that the description's ticketRef nodes (\"#\") name, each once in order, for this team reader. Absent when Description is masked or the description names none.",
      "items": {
       "$ref": "#/components/schemas/RichTextTicketRef"
      }
     },
     "descriptionPageLinks": {
      "type": "array",
      "maxItems": 20,
      "description": "Q30 (22 Nov 2026) — the doc pages that the description's pageLink nodes (\"[[\") name, each once in order, for this team reader. Absent when Description is masked or the description names none.",
      "items": {
       "$ref": "#/components/schemas/RichTextPageLink"
      }
     },
     "stage": {
      "description": "Absent when Status is masked.",
      "allOf": [
       {
        "$ref": "#/components/schemas/TicketStage"
       }
      ]
     },
     "priority": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "epic": {
      "$ref": "#/components/schemas/EpicRef"
     },
     "sprint": {
      "$ref": "#/components/schemas/SprintRef"
     },
     "startDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
     },
     "estimatePoints": {
      "$ref": "#/components/schemas/StoryPoints"
     },
     "loggedMinutes": {
      "type": "integer",
      "minimum": 0
     },
     "overEstimate": {
      "type": "boolean"
     },
     "labels": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/LabelRef"
      }
     },
     "clientVisible": {
      "type": "boolean"
     },
     "resolution": {
      "$ref": "#/components/schemas/TicketResolutionView"
     },
     "openApprovalRequestId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "customFields": {
      "$ref": "#/components/schemas/CustomFieldValueMap"
     },
     "fieldSetVersion": {
      "type": "integer",
      "minimum": 1
     },
     "counts": {
      "type": "object",
      "properties": {
       "attachments": {
        "type": "integer",
        "minimum": 0
       },
       "sharedAttachments": {
        "type": "integer",
        "minimum": 0
       },
       "comments": {
        "type": "integer",
        "minimum": 0
       },
       "mergeRequests": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "createdBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "reporter": {
      "$ref": "#/components/schemas/MemberRef",
      "description": "XM-926 (F-WRK-23.R16): the member who reported the work — the creator, unless the creator named another member at creation."
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "trashedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "purgesAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "A trashed ticket read by a plan holder — when the trash purge removes it (`work.trashRetentionDays`; F-WRK-16.R12)."
     },
     "type": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "hierarchy": {
      "$ref": "#/components/schemas/HierarchySummary"
     },
     "dependency": {
      "$ref": "#/components/schemas/DependencySignalView"
     },
     "relationCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Spec BF-1: the relations this reader can see; absent when relations is masked (F-WRK-33)."
     },
     "acceptance": {
      "$ref": "#/components/schemas/AcceptanceSummaryView",
      "description": "F-WRK-39.R09 (XM-939): \"N of M met\" of the acceptance criteria; absent when description is masked. The rows are `GET /tickets/{ticketKey}/acceptance-criteria`."
     },
     "origin": {
      "$ref": "#/components/schemas/TicketOriginView",
      "description": "XM-1107 (F-WRK-16.R14): the help-desk request that the ticket came from (\"From help desk: ORB-R20 · Orbit Retail\"). Absent when the ticket has none, and when the reader may not see the request (triage_requests on the project, F-HLP-07.R01): hidden ≡ missing."
     },
     "copiedFrom": {
      "$ref": "#/components/schemas/TicketCopiedFromView",
      "description": "XM-1108 (F-WRK-16.R22): the ticket that this ticket is a duplicate of, or was moved from. Absent when the ticket is no copy, when the reader may not see the source, and when the source was purged."
     },
     "structureCan": {
      "type": "object",
      "description": "Spec BF-1: what the panel may offer (F-WRK-32).",
      "properties": {
       "changeType": {
        "type": "boolean"
       },
       "setParent": {
        "type": "boolean"
       },
       "link": {
        "type": "boolean"
       }
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "example": 12
     },
     "can": {
      "$ref": "#/components/schemas/TicketCan"
     }
    }
   },
   "TicketExposureConsequence": {
    "type": "object",
    "required": [
     "clientVersion",
     "portalOn",
     "visibleFields",
     "hiddenFields",
     "sharedFiles",
     "clientComments",
     "openApprovalRequest",
     "stageHidden"
    ],
    "properties": {
     "organisation": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "portalOn": {
      "type": "boolean"
     },
     "visibleFields": {
      "type": "array",
      "maxItems": 16,
      "description": "The client-eligible built-in fields the client sees — at most 16 of the 18; internal_comments and history never (access INV-ACC-03, CFL-414).",
      "items": {
       "$ref": "#/components/schemas/TicketFieldKey"
      }
     },
     "hiddenFields": {
      "type": "array",
      "maxItems": 18,
      "description": "The built-in fields hidden from the client — up to all 18 of TicketField registry version 3; internal_comments and history are always here.",
      "items": {
       "$ref": "#/components/schemas/TicketFieldKey"
      }
     },
     "visibleCustomFields": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "type": "string",
       "pattern": "^[a-z][a-z0-9_]{1,39}$"
      }
     },
     "sharedFiles": {
      "type": "integer",
      "minimum": 0
     },
     "clientComments": {
      "type": "integer",
      "minimum": 0
     },
     "openApprovalRequest": {
      "type": "boolean"
     },
     "stageHidden": {
      "type": "boolean"
     }
    }
   },
   "TicketFieldKey": {
    "type": "string",
    "enum": [
     "title",
     "status",
     "due_date",
     "description",
     "client_comments",
     "shared_attachments",
     "assignee",
     "estimate",
     "time_logged",
     "internal_comments",
     "labels",
     "merge_requests",
     "type",
     "hierarchy",
     "relations",
     "history",
     "priority",
     "reporter"
    ]
   },
   "TicketHistoryActorView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "member",
       "client",
       "automation",
       "assistant",
       "import",
       "system",
       "service"
      ]
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "organisationName": {
      "type": "string",
      "maxLength": 200
     },
     "rule": {
      "$ref": "#/components/schemas/NamedRef"
     },
     "onBehalfOf": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "runId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "operationId": {
      "$ref": "#/components/schemas/Uuid"
     }
    }
   },
   "TicketHistoryEntryView": {
    "type": "object",
    "required": [
     "id",
     "changeSetId",
     "at",
     "field",
     "operation",
     "actor",
     "cause"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "changeSetId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "ticket": {
      "type": "object",
      "required": [
       "key"
      ],
      "description": "In project lists only.",
      "properties": {
       "key": {
        "$ref": "#/components/schemas/TicketKey"
       },
       "title": {
        "type": "string",
        "maxLength": 200
       }
      }
     },
     "field": {
      "type": "string",
      "enum": [
       "created",
       "title",
       "description",
       "type",
       "parent",
       "children",
       "stage",
       "resolution",
       "priority",
       "assignee",
       "sprint",
       "epic",
       "start_date",
       "due_date",
       "estimate",
       "labels",
       "custom_field",
       "client_visibility",
       "relation",
       "attachment",
       "comment",
       "lifecycle",
       "acceptance_criterion",
       "reporter",
       "points"
      ]
     },
     "customField": {
      "type": "object",
      "required": [
       "key",
       "name"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/CustomFieldKey"
       },
       "name": {
        "type": "string",
        "maxLength": 60
       }
      }
     },
     "operation": {
      "type": "string",
      "enum": [
       "set",
       "added",
       "removed",
       "created",
       "edited",
       "deleted",
       "trashed",
       "restored",
       "shared",
       "unshared",
       "resolved",
       "reopened"
      ]
     },
     "before": {
      "$ref": "#/components/schemas/TicketHistoryValueView"
     },
     "after": {
      "$ref": "#/components/schemas/TicketHistoryValueView"
     },
     "actor": {
      "$ref": "#/components/schemas/TicketHistoryActorView"
     },
     "cause": {
      "type": "string",
      "enum": [
       "direct",
       "bulk",
       "type_change",
       "parent_change",
       "label_merge",
       "stage_merged",
       "stage_kind_changed",
       "sprint_completed",
       "member_removed",
       "parent_trashed",
       "parent_purged",
       "ticket_purged",
       "import",
       "resolution_policy",
       "epic_migration"
      ]
     },
     "coalescedCount": {
      "type": "integer",
      "minimum": 1
     },
     "ref": {
      "type": "string",
      "pattern": "^CHG-[1-9][0-9]{0,17}$",
      "maxLength": 22,
      "description": "The change set's short reference in its project (F-WRK-35.R19; XM-1123), the same on every entry of the set. Only when the reader's history of the project is unfiltered (F-WRK-36.R02); absent for an entry recorded before XM-1123."
     }
    }
   },
   "TicketHistoryExportRequest": {
    "type": "object",
    "required": [
     "from",
     "to"
    ],
    "additionalProperties": false,
    "properties": {
     "from": {
      "$ref": "#/components/schemas/Instant"
     },
     "to": {
      "$ref": "#/components/schemas/Instant"
     },
     "fields": {
      "type": "array",
      "maxItems": 25,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "maxLength": 20
      }
     },
     "actorId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "actorKinds": {
      "type": "array",
      "maxItems": 7,
      "uniqueItems": true,
      "items": {
       "type": "string",
       "enum": [
        "member",
        "client",
        "automation",
        "assistant",
        "import",
        "system",
        "service"
       ]
      }
     }
    }
   },
   "TicketHistoryPage": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/TicketHistoryEntryView"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "page",
       "historyStartedAt"
      ],
      "properties": {
       "page": {
        "$ref": "#/components/schemas/CursorPageMeta"
       },
       "historyStartedAt": {
        "$ref": "#/components/schemas/Instant"
       },
       "hiddenFields": {
        "type": "boolean",
        "description": "True when the reader's mask does not admit at least one part of a field that this view can list (with a field filter, of the selected fields only). It comes from the mask and the filter, never from the entries, so it is the same on each ticket, period, actor and page (work §3.14 item 6). The UI shows it as \"Some changes may be hidden by your role.\""
       }
      }
     },
     "links": {
      "$ref": "#/components/schemas/CursorLinks"
     }
    }
   },
   "TicketHistoryValueView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "description": "One typed value (work §3.14); only the member of its kind is present.",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "text",
       "text_revision",
       "enum_value",
       "date",
       "duration",
       "member",
       "stage",
       "sprint",
       "epic",
       "ticket",
       "type",
       "labels",
       "custom_value",
       "flag",
       "client_exposure",
       "relation",
       "attachment",
       "comment",
       "creation",
       "unavailable",
       "redacted",
       "criterion",
       "points"
      ]
     },
     "text": {
      "type": "string",
      "maxLength": 200
     },
     "redacted": {
      "type": "object",
      "required": [
       "at"
      ],
      "description": "An Admin redacted this inline text (F-WRK-36.R14); the view shows the notice only.",
      "properties": {
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "by": {
        "$ref": "#/components/schemas/MemberRef"
       }
      }
     },
     "revision": {
      "type": "object",
      "required": [
       "id",
       "length"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "length": {
        "type": "integer",
        "minimum": 0
       }
      }
     },
     "enumValue": {
      "type": "string",
      "maxLength": 40
     },
     "date": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "minutes": {
      "type": "integer",
      "minimum": 0
     },
     "points": {
      "type": "number",
      "minimum": 0,
      "description": "XM-1112 (F-WRK-42.R03): a `points` value."
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "ref": {
      "type": "object",
      "required": [
       "name"
      ],
      "description": "A stage, sprint or epic with its current name, or its name at the change when it no longer exists.",
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       },
       "kind": {
        "$ref": "#/components/schemas/StageKindKey"
       },
       "gone": {
        "type": "boolean"
       }
      }
     },
     "ticket": {
      "type": "object",
      "required": [
       "key"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/TicketKey"
       }
      }
     },
     "type": {
      "type": "object",
      "required": [
       "name",
       "level"
      ],
      "description": "The type by its current key and name, or by its name at the change with `gone` when the type is deleted (F-WRK-36.R05; BF1-HIST-VIEW).",
      "properties": {
       "key": {
        "$ref": "#/components/schemas/TicketTypeKey"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       },
       "level": {
        "$ref": "#/components/schemas/TicketTypeLevelKey"
       },
       "gone": {
        "type": "boolean"
       }
      }
     },
     "typeFields": {
      "type": "object",
      "description": "The custom fields that a type change hid and showed again; only the fields that the reader's projection admits (SR-BF1-02).",
      "properties": {
       "hidden": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/CustomFieldKey"
        }
       },
       "shown": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/CustomFieldKey"
        }
       }
      }
     },
     "labelsAdded": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "id",
        "name"
       ],
       "description": "A label by its current name and colour, or by its name at the change with `gone` when the label is deleted (F-WRK-36.R05; BF1-HIST-VIEW).",
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "name": {
         "type": "string",
         "maxLength": 120
        },
        "colour": {
         "$ref": "#/components/schemas/LabelColour"
        },
        "gone": {
         "type": "boolean"
        }
       }
      }
     },
     "labelsRemoved": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "id",
        "name"
       ],
       "description": "A label by its current name and colour, or by its name at the change with `gone` when the label is deleted (F-WRK-36.R05; BF1-HIST-VIEW).",
       "properties": {
        "id": {
         "$ref": "#/components/schemas/Uuid"
        },
        "name": {
         "type": "string",
         "maxLength": 120
        },
        "colour": {
         "$ref": "#/components/schemas/LabelColour"
        },
        "gone": {
         "type": "boolean"
        }
       }
      }
     },
     "customValue": {
      "$ref": "#/components/schemas/CustomFieldValue"
     },
     "flag": {
      "type": "boolean"
     },
     "clientVersion": {
      "$ref": "#/components/schemas/ClientVersion"
     },
     "relation": {
      "type": "object",
      "required": [
       "kindKey",
       "phrase"
      ],
      "properties": {
       "kindKey": {
        "$ref": "#/components/schemas/TicketTypeKey"
       },
       "phrase": {
        "type": "string",
        "maxLength": 40
       },
       "ticket": {
        "$ref": "#/components/schemas/TicketKey"
       }
      }
     },
     "attachment": {
      "type": "object",
      "required": [
       "name",
       "sharing"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 255
       },
       "sharing": {
        "type": "string",
        "enum": [
         "internal",
         "shared_with_client"
        ]
       }
      }
     },
     "comment": {
      "type": "object",
      "required": [
       "thread"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "thread": {
        "type": "string",
        "enum": [
         "internal",
         "client"
        ]
       },
       "reply": {
        "type": "boolean",
        "description": "True when the comment is a reply to another comment (F-WRK-21.R18; XM-931). The parent is not named."
       }
      }
     },
     "creation": {
      "type": "object",
      "description": "The values a ticket was created with, each through the reader's mask.",
      "additionalProperties": true
     },
     "criterion": {
      "type": "object",
      "required": [
       "text",
       "met",
       "position"
      ],
      "description": "XM-939 (F-WRK-39.R10): an acceptance criterion as the change left it — an excerpt of its text, the tick and the place; never its id.",
      "properties": {
       "text": {
        "type": "string",
        "maxLength": 200
       },
       "met": {
        "type": "boolean"
       },
       "position": {
        "type": "integer",
        "minimum": 0,
        "maximum": 199
       }
      }
     }
    }
   },
   "TicketKey": {
    "type": "string",
    "pattern": "^[A-Z][A-Z0-9]{1,9}-[1-9][0-9]{0,8}$",
    "example": "ORB-124"
   },
   "TicketListCounts": {
    "type": "object",
    "required": [
     "total"
    ],
    "description": "XM-1109 (F-WRK-14.R14): the List's \"N of M tickets\" total and, with groupBy, the count of each group header — under the List's own predicate and filters; only tickets the reader can see are counted.",
    "properties": {
     "total": {
      "$ref": "#/components/schemas/BoundedCount"
     },
     "groupBy": {
      "type": "string",
      "enum": [
       "status",
       "assignee",
       "epic",
       "priority"
      ]
     },
     "groups": {
      "type": "array",
      "maxItems": 500,
      "description": "Present with groupBy: the groups with at least one ticket, the largest first. key: a stage id (status), a member id (assignee), an epic ticket id (epic), a priority key (priority), or none (unassigned, no epic).",
      "items": {
       "type": "object",
       "required": [
        "key",
        "count"
       ],
       "properties": {
        "key": {
         "type": "string",
         "minLength": 1,
         "maxLength": 40
        },
        "count": {
         "$ref": "#/components/schemas/BoundedCount"
        }
       }
      }
     }
    }
   },
   "TicketListFilterInput": {
    "description": "The filters of the generic ticket list (F-WRK-14.R09; XM-708): the shared Work filters and the list's own — the stage kinds, the due-date range and the sprint.",
    "allOf": [
     {
      "$ref": "#/components/schemas/WorkFilterInput"
     },
     {
      "type": "object",
      "properties": {
       "stageKind": {
        "type": "string",
        "maxLength": 60,
        "description": "A comma list of todo, in_progress, in_review, done."
       },
       "dueDate": {
        "type": "object",
        "additionalProperties": false,
        "description": "The Calendar's range (G-WK2-2): gte and lte are dates, gte ≤ lte, both ends included; a closed range spans at most 366 † days, else 400 query.invalid naming filter[dueDate]. Needs Due date in the reader's mask.",
        "properties": {
         "gte": {
          "$ref": "#/components/schemas/DateOnly"
         },
         "lte": {
          "$ref": "#/components/schemas/DateOnly"
         }
        }
       },
       "sprint": {
        "type": "string",
        "maxLength": 36,
        "description": "active, none (the backlog) or the id of a sprint of the project."
       }
      }
     }
    ]
   },
   "TicketListItem": {
    "type": "object",
    "required": [
     "id",
     "key",
     "title",
     "stage",
     "priority",
     "clientVisible",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "stage": {
      "$ref": "#/components/schemas/TicketStage"
     },
     "priority": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "dueDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "startDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "assignee": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "epic": {
      "$ref": "#/components/schemas/EpicRef"
     },
     "clientVisible": {
      "type": "boolean"
     },
     "customFields": {
      "$ref": "#/components/schemas/CustomFieldValueMap"
     },
     "type": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "parent": {
      "$ref": "#/components/schemas/ParentRef"
     },
     "blocked": {
      "type": "boolean"
     },
     "labelIds": {
      "$ref": "#/components/schemas/RowLabelIds"
     },
     "reporter": {
      "$ref": "#/components/schemas/MemberRef",
      "description": "XM-1110 (F-WRK-14.R13): only with columns=reporter — the creator, unless the creator named another member (F-WRK-23.R16)."
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "XM-1110: only with columns=created."
     },
     "updatedAt": {
      "$ref": "#/components/schemas/Instant",
      "description": "XM-1110: only with columns=updated."
     },
     "sprint": {
      "$ref": "#/components/schemas/RowSprintRef",
      "description": "XM-1110: only with columns=sprint; absent for a ticket in no sprint."
     },
     "estimateMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000,
      "description": "XM-1369 (G-BL-08; F-WRK-14.R15): as on BacklogRow; absent when unset or when Estimate is masked."
     },
     "estimatePoints": {
      "description": "XM-1369 (G-BL-08; F-WRK-14.R15): as on BacklogRow; absent when unset or when Estimate is masked.",
      "allOf": [
       {
        "$ref": "#/components/schemas/StoryPoints"
       }
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "description": "XM-1369 (G-BL-08; F-WRK-14.R15): the rule of BacklogRow.can (one presenter rule, the same view rights).",
      "properties": {
       "plan": {
        "type": "boolean"
       },
       "rerank": {
        "type": "boolean"
       },
       "select": {
        "type": "boolean"
       },
       "edit": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "TicketOpportunityLink": {
    "type": "object",
    "required": [
     "id",
     "title",
     "outcome",
     "decidedAt"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "title": {
      "type": "string",
      "maxLength": 200
     },
     "outcome": {
      "$ref": "#/components/schemas/DecisionOutcome"
     },
     "decidedAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "TicketOriginView": {
    "type": "object",
    "description": "XM-1107 (F-WRK-16.R14): the request that created the ticket (decision accepted), else the first request merged into it (decision merged).",
    "required": [
     "source",
     "requestKey",
     "decision",
     "can"
    ],
    "properties": {
     "source": {
      "type": "string",
      "enum": [
       "help_desk"
      ]
     },
     "requestKey": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}-R[1-9][0-9]{0,8}$",
      "example": "ORB-R20"
     },
     "decision": {
      "type": "string",
      "enum": [
       "accepted",
       "merged"
      ]
     },
     "organisation": {
      "type": "object",
      "description": "The request's client organisation; absent for an internal request or when the reader may not see the organisation.",
      "required": [
       "id",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
       }
      }
     },
     "can": {
      "type": "object",
      "required": [
       "triage"
      ],
      "properties": {
       "triage": {
        "type": "boolean",
        "description": "The reader may open the request in the triage queue now: Help desk is available on the project and the reader holds triage_requests (the requests.triage navigation fact)."
       }
      }
     }
    }
   },
   "TicketPatch": {
    "type": "object",
    "description": "JSON Merge Patch (05 §3.2); an absent member is unchanged, null clears. The sprint changes through the position.",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
     },
     "description": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "priority": {
      "$ref": "#/components/schemas/TicketPriority"
     },
     "assigneeId": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid"
     },
     "startDate": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "dueDate": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "estimateMinutes": {
      "type": [
       "integer",
       "null"
      ],
      "minimum": 0,
      "maximum": 100000
     },
     "estimatePoints": {
      "type": [
       "number",
       "null"
      ],
      "minimum": 0,
      "maximum": 100,
      "multipleOf": 0.5,
      "description": "XM-1112 (F-WRK-42.R02): a value of the workspace's scale; null clears it."
     },
     "labelIds": {
      "type": "array",
      "description": "The ticket's whole label set — active labels of its own project, replaced as one value (F-WRK-22.R12).",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "customFields": {
      "$ref": "#/components/schemas/CustomFieldInputMap"
     },
     "reporterId": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid",
      "description": "F-WRK-22.R22 (XM-949): the new reporter; null makes the creator the reporter again. Needs plan (403 access.forbidden, capability plan) before any field is judged; an ineligible member is 422 ticket.reporter_not_eligible at /reporterId."
     }
    }
   },
   "TicketPlacementRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "stageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "sprint": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^(active|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
      "description": "\"active\" plans into the active sprint; the id of an open sprint (planned or active) of the ticket's project plans into that sprint (F-WRK-07.R08; register §178) — another id is 422 sprint.not_open at /sprint; null unplans; absent keeps."
     },
     "after": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "before": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "resolution": {
      "$ref": "#/components/schemas/TicketResolutionView"
     },
     "scope": {
      "type": "string",
      "enum": [
       "view",
       "epic",
       "parent"
      ],
      "default": "view",
      "description": "Where after and before are (F-WRK-03.R14, R25): view (absent) — the scope the stage and the sprint derive (R03); epic — the tickets of the ticket's epic (the Epics view and the Timeline). With epic only the rank may change: no stageId, sprint or resolution (422 ticket.epic_rank_only); a ticket without an epic is 422 ticket.no_epic. parent (XM-865) — the children of the ticket's parent of any level (the ticket panel's subtasks); only the rank may change (422 ticket.parent_rank_only); a ticket without a parent is 422 ticket.no_parent."
     }
    }
   },
   "TicketPlacementResult": {
    "type": "object",
    "required": [
     "key",
     "stageId",
     "rank",
     "version"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "stageId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "sprintId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "rank": {
      "type": "string",
      "maxLength": 64,
      "description": "Opaque; the SPA may sort by it but never computes one."
     },
     "resolution": {
      "$ref": "#/components/schemas/TicketResolutionView"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "previous": {
      "type": "object",
      "description": "BE-MOVE-UNDO-PREVIOUS (XM-857; F-WRK-03.R18): the stage, the sprint (absent: the backlog) and the resolution of the ticket before this placement, for the Undo on the move notice.",
      "required": [
       "stageId"
      ],
      "properties": {
       "stageId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "sprintId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "resolution": {
        "$ref": "#/components/schemas/TicketResolutionView"
       }
      }
     }
    }
   },
   "TicketPresenceSignal": {
    "type": "object",
    "description": "The body of `POST /tickets/{ticketKey}/presence` (F-WRK-37.R08–R11). `field` with `editing`, `thread` with `typing`, nothing with `idle`.",
    "required": [
     "activity"
    ],
    "additionalProperties": false,
    "properties": {
     "activity": {
      "type": "string",
      "enum": [
       "editing",
       "typing",
       "idle"
      ]
     },
     "field": {
      "$ref": "#/components/schemas/PresenceFieldKey"
     },
     "thread": {
      "type": "string",
      "enum": [
       "internal",
       "client"
      ]
     }
    }
   },
   "TicketPriority": {
    "type": "string",
    "pattern": "^[a-z][a-z0-9_]{0,39}$",
    "maxLength": 40,
    "description": "XM-1098 (F-WRK-40): a key of the tenant's priority list (`GET /priorities`). The built-in keys are low, medium, high and urgent; an Admin adds keys and archives keys. Read the name and the colour from the list.",
    "example": "urgent"
   },
   "TicketRelationCreateRequest": {
    "type": "object",
    "required": [
     "kindKey",
     "direction",
     "otherKey"
    ],
    "additionalProperties": false,
    "properties": {
     "kindKey": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "direction": {
      "type": "string",
      "enum": [
       "outward",
       "inward"
      ],
      "description": "inward: \"this ticket <inward phrase> other\" — for blocks, this ticket is blocked by the other."
     },
     "otherKey": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 280
     }
    }
   },
   "TicketRelationGroupsView": {
    "type": "object",
    "required": [
     "groups",
     "total"
    ],
    "properties": {
     "total": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
     },
     "groups": {
      "type": "array",
      "maxItems": 60,
      "items": {
       "type": "object",
       "required": [
        "kindKey",
        "direction",
        "phrase",
        "relations"
       ],
       "properties": {
        "kindKey": {
         "$ref": "#/components/schemas/TicketTypeKey"
        },
        "direction": {
         "type": "string",
         "enum": [
          "outward",
          "inward"
         ]
        },
        "phrase": {
         "type": "string",
         "maxLength": 40
        },
        "relations": {
         "type": "array",
         "maxItems": 100,
         "items": {
          "$ref": "#/components/schemas/TicketRelationView"
         }
        }
       }
      }
     },
     "canAdd": {
      "type": "boolean"
     }
    }
   },
   "TicketRelationPatch": {
    "type": "object",
    "required": [
     "reason"
    ],
    "additionalProperties": false,
    "properties": {
     "reason": {
      "type": [
       "string",
       "null"
      ],
      "maxLength": 280
     }
    }
   },
   "TicketRelationView": {
    "type": "object",
    "required": [
     "id",
     "kindKey",
     "phrase",
     "direction",
     "dependency",
     "other",
     "createdAt",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "kindKey": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "phrase": {
      "type": "string",
      "maxLength": 40,
      "example": "is blocked by",
      "description": "The kind's phrase as this ticket reads it."
     },
     "direction": {
      "type": "string",
      "enum": [
       "outward",
       "inward"
      ]
     },
     "dependency": {
      "type": "string",
      "enum": [
       "none",
       "finish_to_start",
       "finish_to_finish"
      ]
     },
     "role": {
      "type": "string",
      "enum": [
       "prerequisite",
       "dependent"
      ],
      "description": "The other ticket's role in a dependency."
     },
     "kindArchived": {
      "type": "boolean"
     },
     "other": {
      "type": "object",
      "required": [
       "key",
       "projectKey"
      ],
      "properties": {
       "key": {
        "$ref": "#/components/schemas/TicketKey"
       },
       "projectKey": {
        "$ref": "#/components/schemas/ProjectKey"
       },
       "projectName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120,
        "description": "XM-1105: the name of the other ticket's project. The row exists only for an other ticket that the reader can view (R06)."
       },
       "dueDate": {
        "description": "XM-1105: the other ticket's due date; absent when unset or when the mask of the other ticket's project hides Due date.",
        "allOf": [
         {
          "$ref": "#/components/schemas/DateOnly"
         }
        ]
       },
       "title": {
        "type": "string",
        "maxLength": 200
       },
       "type": {
        "$ref": "#/components/schemas/TicketTypeRef"
       },
       "stage": {
        "$ref": "#/components/schemas/TicketStage"
       },
       "assignee": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "open": {
        "type": "boolean"
       }
      }
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 280
     },
     "createdBy": {
      "$ref": "#/components/schemas/TicketHistoryActorView"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "remove"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "remove": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "TicketResolutionRequest": {
    "type": "object",
    "required": [
     "resolution"
    ],
    "additionalProperties": false,
    "properties": {
     "resolution": {
      "type": "string",
      "enum": [
       "completed",
       "cancelled",
       "duplicate"
      ]
     },
     "duplicateOf": {
      "$ref": "#/components/schemas/TicketKey"
     }
    }
   },
   "TicketResolutionView": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "completed",
       "cancelled",
       "duplicate"
      ]
     },
     "duplicateOf": {
      "$ref": "#/components/schemas/TicketKey"
     }
    }
   },
   "TicketSessionGrant": {
    "type": "object",
    "description": "XM-1162 part C (G-TP-13d): the grant of a live session of a ticket's description (F-WRK-25.R10; openDescriptionSession and renewDescriptionSession). It has the members of DocSessionGrant. Its documentName is the TicketDescriptionName of the current epoch. The two patterns are disjoint: a doc page's grant never decodes as a ticket grant, and a ticket grant never decodes as a doc page's grant.",
    "required": [
     "sessionId",
     "token",
     "expiresAt",
     "documentName",
     "mode",
     "url",
     "schemaVersion",
     "offlineEditing"
    ],
    "properties": {
     "sessionId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "token": {
      "type": "string",
      "maxLength": 2048,
      "description": "ES256 JWT, at most 120 s; sent only in the provider's authentication message, never logged or put in a URL."
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "documentName": {
      "type": "string",
      "pattern": "^t/[0-9a-f-]{36}/ticket/[0-9a-f-]{36}/e[1-9][0-9]*$"
     },
     "mode": {
      "type": "string",
      "enum": [
       "write",
       "read"
      ]
     },
     "readOnlyReason": {
      "type": "string",
      "enum": [
       "no_edit_capability",
       "project_archived",
       "preview",
       "editors_limit",
       "document_too_large",
       "space_archived",
       "edit_restricted"
      ]
     },
     "url": {
      "type": "string",
      "maxLength": 200,
      "example": "wss://ws.youniton.example/collab"
     },
     "schemaVersion": {
      "type": "integer",
      "minimum": 1
     },
     "offlineEditing": {
      "type": "boolean"
     }
    }
   },
   "TicketSprintMoveRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "sprint"
    ],
    "properties": {
     "sprint": {
      "type": [
       "string",
       "null"
      ],
      "format": "uuid",
      "description": "An open sprint of the ticket's project; null = the backlog."
     }
    }
   },
   "TicketStage": {
    "type": "object",
    "required": [
     "id",
     "name",
     "kind",
     "colour"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "In review"
     },
     "kind": {
      "$ref": "#/components/schemas/StageKindKey"
     },
     "colour": {
      "$ref": "#/components/schemas/StageColourKey"
     }
    }
   },
   "TicketTime": {
    "type": "object",
    "required": [
     "entryCount",
     "totalMinutes",
     "entries"
    ],
    "properties": {
     "entryCount": {
      "type": "integer",
      "minimum": 0
     },
     "totalMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "entries": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/WorklogView"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     },
     "canLog": {
      "type": "boolean"
     }
    }
   },
   "TicketTypeCatalogue": {
    "type": "object",
    "required": [
     "data",
     "meta"
    ],
    "properties": {
     "data": {
      "type": "array",
      "maxItems": 30,
      "items": {
       "$ref": "#/components/schemas/TicketTypeView"
      }
     },
     "meta": {
      "type": "object",
      "required": [
       "canEdit",
       "levels",
       "defaultKey",
       "version"
      ],
      "properties": {
       "canEdit": {
        "type": "boolean"
       },
       "version": {
        "type": "string",
        "pattern": "^[0-9a-f]{64}$",
        "description": "The catalogue version (work §3.11), the If-Match of the reorder."
       },
       "defaultKey": {
        "$ref": "#/components/schemas/TicketTypeKey"
       },
       "levels": {
        "type": "array",
        "maxItems": 3,
        "description": "The levels offered now.",
        "items": {
         "$ref": "#/components/schemas/TicketTypeLevelKey"
        }
       }
      }
     }
    }
   },
   "TicketTypeCreateRequest": {
    "type": "object",
    "required": [
     "key",
     "name",
     "icon",
     "level"
    ],
    "additionalProperties": false,
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "icon": {
      "$ref": "#/components/schemas/TicketTypeIconKey"
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     },
     "level": {
      "$ref": "#/components/schemas/TicketTypeLevelKey"
     },
     "kind": {
      "$ref": "#/components/schemas/TicketTypeKindKey",
      "description": "XM-1113: `work` when absent; set once, never changed. A `milestone` type is of the `standard` level."
     },
     "allowedParentKeys": {
      "type": "array",
      "maxItems": 29,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/TicketTypeKey"
      }
     },
     "fieldProfile": {
      "$ref": "#/components/schemas/TypeFieldProfileInput"
     },
     "standardFieldHints": {
      "type": "array",
      "maxItems": 4,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/StandardFieldHintKey"
      }
     }
    }
   },
   "TicketTypeIconKey": {
    "type": "string",
    "enum": [
     "story",
     "task",
     "bug",
     "info",
     "subtask",
     "epic",
     "improvement",
     "spike",
     "question",
     "risk",
     "milestone"
    ]
   },
   "TicketTypeKey": {
    "type": "string",
    "pattern": "^[a-z][a-z0-9_]{1,29}$",
    "example": "bug",
    "description": "A stable machine key — of a ticket type in its project, or of a relation kind in the tenant."
   },
   "TicketTypeKindKey": {
    "type": "string",
    "enum": [
     "work",
     "milestone"
    ],
    "description": "XM-1113 (F-WRK-30.R18; owner Q22 (a)): `milestone` — a type whose tickets carry one date, the due date (F-WRK-13.R13); `work` — every other type."
   },
   "TicketTypeLevelKey": {
    "type": "string",
    "enum": [
     "epic",
     "standard",
     "subtask"
    ],
    "description": "The hierarchy level (work §3.12); an epic is a ticket of an epic-level type (work §3.15, BF1-EPIC)."
   },
   "TicketTypeOrderRequest": {
    "type": "object",
    "required": [
     "keys"
    ],
    "additionalProperties": false,
    "properties": {
     "keys": {
      "type": "array",
      "minItems": 1,
      "maxItems": 30,
      "uniqueItems": true,
      "description": "Every type key of the project, in the new order.",
      "items": {
       "$ref": "#/components/schemas/TicketTypeKey"
      }
     }
    }
   },
   "TicketTypePatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "icon": {
      "$ref": "#/components/schemas/TicketTypeIconKey"
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     },
     "allowedParentKeys": {
      "type": "array",
      "maxItems": 29,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/TicketTypeKey"
      }
     },
     "fieldProfile": {
      "$ref": "#/components/schemas/TypeFieldProfileInput"
     },
     "standardFieldHints": {
      "type": "array",
      "maxItems": 4,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/StandardFieldHintKey"
      }
     }
    }
   },
   "TicketTypeRef": {
    "type": "object",
    "required": [
     "key",
     "name",
     "icon",
     "colour",
     "level"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "Bug"
     },
     "icon": {
      "$ref": "#/components/schemas/TicketTypeIconKey"
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     },
     "level": {
      "$ref": "#/components/schemas/TicketTypeLevelKey"
     },
     "kind": {
      "$ref": "#/components/schemas/TicketTypeKindKey"
     },
     "archived": {
      "type": "boolean",
      "description": "An archived type still on the ticket, shown muted."
     }
    }
   },
   "TicketTypeTemplateEntry": {
    "type": "object",
    "description": "Spec BF-1: one type of the tenant's template — data only, no Work id (CFL-413); validated by Work's catalogue rules (F-WRK-30.R03–R11).",
    "required": [
     "key",
     "name",
     "icon",
     "level"
    ],
    "additionalProperties": false,
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "icon": {
      "$ref": "#/components/schemas/TicketTypeIconKey"
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     },
     "level": {
      "$ref": "#/components/schemas/TicketTypeLevelKey"
     },
     "kind": {
      "$ref": "#/components/schemas/TicketTypeKindKey",
      "description": "XM-1113 (F-WRK-30.R18): `work` when absent (also a template stored before). A milestone entry is of the standard level, never a parent and never the default."
     },
     "allowedParentKeys": {
      "type": "array",
      "maxItems": 29,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/TicketTypeKey"
      }
     },
     "fieldProfile": {
      "$ref": "#/components/schemas/TypeFieldProfileInput"
     },
     "standardFieldHints": {
      "type": "array",
      "maxItems": 4,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/StandardFieldHintKey"
      }
     },
     "isDefault": {
      "type": "boolean"
     }
    }
   },
   "TicketTypeView": {
    "type": "object",
    "required": [
     "key",
     "name",
     "icon",
     "colour",
     "level",
     "allowedParentKeys",
     "fieldProfile",
     "standardFieldHints",
     "isDefault",
     "state",
     "position",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "key": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "icon": {
      "$ref": "#/components/schemas/TicketTypeIconKey"
     },
     "colour": {
      "$ref": "#/components/schemas/LabelColour"
     },
     "level": {
      "$ref": "#/components/schemas/TicketTypeLevelKey"
     },
     "kind": {
      "$ref": "#/components/schemas/TicketTypeKindKey"
     },
     "allowedParentKeys": {
      "type": "array",
      "maxItems": 29,
      "items": {
       "$ref": "#/components/schemas/TicketTypeKey"
      }
     },
     "fieldProfile": {
      "$ref": "#/components/schemas/TypeFieldProfileInput"
     },
     "standardFieldHints": {
      "type": "array",
      "maxItems": 4,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/StandardFieldHintKey"
      }
     },
     "isDefault": {
      "type": "boolean"
     },
     "state": {
      "type": "string",
      "enum": [
       "active",
       "archived"
      ]
     },
     "position": {
      "type": "integer",
      "minimum": 0,
      "maximum": 29
     },
     "ticketCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Only for catalogue editors — live and trashed tickets of the type."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "type": "object",
      "required": [
       "edit",
       "archive",
       "delete",
       "setDefault"
      ],
      "properties": {
       "edit": {
        "type": "boolean"
       },
       "archive": {
        "type": "boolean"
       },
       "delete": {
        "type": "boolean"
       },
       "setDefault": {
        "type": "boolean"
       }
      }
     }
    }
   },
   "TicketWatchersView": {
    "type": "object",
    "description": "XM-1102 + XM-965 (F-WRK-16.R23–R27): the Watchers row of the ticket panel.",
    "required": [
     "reporter",
     "others",
     "watching",
     "can"
    ],
    "properties": {
     "reporter": {
      "type": "object",
      "description": "The reporter, a participant by default (R24); watching is false after the reporter's Unwatch.",
      "required": [
       "member",
       "watching"
      ],
      "properties": {
       "member": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "watching": {
        "type": "boolean"
       }
      }
     },
     "others": {
      "type": "array",
      "maxItems": 500,
      "description": "The other active members who watch the ticket, in name order.",
      "items": {
       "$ref": "#/components/schemas/MemberRef"
      }
     },
     "watching": {
      "type": "boolean",
      "description": "The caller is a participant: the reporter not muted, or a watcher (\"Watch ticket\" / \"Unwatch\")."
     },
     "can": {
      "type": "object",
      "required": [
       "manage"
      ],
      "properties": {
       "manage": {
        "type": "boolean",
        "description": "The caller may add or remove another member (edit on the ticket, R26). The caller's own row needs view only."
       }
      }
     }
    }
   },
   "TimeCategoryInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
     },
     "archived": {
      "type": "boolean"
     },
     "leave": {
      "type": "boolean",
      "description": "Sets the leave mark (XM-1097). Absent keeps the current mark; a new category without it has no mark."
     }
    }
   },
   "TimeCategoryRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "Meetings"
     },
     "archived": {
      "type": "boolean"
     },
     "leave": {
      "type": "boolean",
      "description": "Time on the category is leave or absence (XM-1097); the week grid shows its rows with kind leave."
     },
     "usage": {
      "type": "integer",
      "minimum": 0,
      "description": "XM-1316: the number of time entries on the category — only in an Admin's read of GET/PUT /time/categories."
     }
    }
   },
   "TimeMinutes": {
    "type": "integer",
    "minimum": 0,
    "maximum": 1000000,
    "description": "Whole minutes; the SPA formats them as 3h 20m."
   },
   "TimeProjectRef": {
    "type": "object",
    "required": [
     "key",
     "name"
    ],
    "properties": {
     "key": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9]{1,9}$",
      "example": "ORB"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "example": "Atlas client portal"
     }
    }
   },
   "TimeRecurrence": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "frequency",
     "startsOn"
    ],
    "description": "F-TIM-02.R17 (XM-960): every `interval` days, or every `interval` weeks on the ISO `weekdays`; ends never, on `endsOn` (inclusive) or after `count` occurrences — at most one end.",
    "properties": {
     "frequency": {
      "type": "string",
      "enum": [
       "daily",
       "weekly"
      ]
     },
     "interval": {
      "type": "integer",
      "minimum": 1,
      "maximum": 99,
      "default": 1
     },
     "weekdays": {
      "type": "array",
      "maxItems": 7,
      "description": "ISO weekdays, 1 (Monday) to 7 (Sunday); required with weekly, absent with daily.",
      "items": {
       "type": "integer",
       "minimum": 1,
       "maximum": 7
      }
     },
     "startsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "endsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "count": {
      "type": "integer",
      "minimum": 1,
      "maximum": 999
     }
    }
   },
   "TimeSettingsUpdate": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "weekStartsOn": {
      "type": "integer",
      "minimum": 1,
      "maximum": 7
     },
     "accountingTimeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "approvalRequired": {
      "type": "boolean"
     },
     "submittedEditPolicy": {
      "type": "string",
      "enum": [
       "pm_may_edit",
       "return_required"
      ]
     },
     "workingDays": {
      "type": "array",
      "minItems": 1,
      "maxItems": 7,
      "uniqueItems": true,
      "items": {
       "type": "integer",
       "minimum": 1,
       "maximum": 7
      }
     },
     "defaultWeeklyCapacityMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 6000
     },
     "loggingStreakEnabled": {
      "type": "boolean"
     },
     "maxMinutesPerDay": {
      "type": "integer",
      "minimum": 60,
      "maximum": 1440
     },
     "workingDayMinutes": {
      "type": "integer",
      "minimum": 60,
      "maximum": 1440
     },
     "entryOverlap": {
      "type": "string",
      "enum": [
       "allowed",
       "warned",
       "refused"
      ]
     },
     "workingHours": {
      "$ref": "#/components/schemas/TimeWorkingHours"
     },
     "maxStarredTickets": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
     },
     "seriesHorizonDays": {
      "type": "integer",
      "minimum": 7,
      "maximum": 731
     }
    }
   },
   "TimeSettingsView": {
    "type": "object",
    "required": [
     "weekStartsOn",
     "accountingTimeZone",
     "approvalRequired",
     "submittedEditPolicy",
     "workingDays",
     "defaultWeeklyCapacityMinutes",
     "loggingStreakEnabled",
     "maxMinutesPerDay",
     "workingDayMinutes",
     "entryOverlap",
     "workingHours",
     "maxStarredTickets",
     "seriesHorizonDays",
     "version",
     "nextBoundary"
    ],
    "properties": {
     "weekStartsOn": {
      "type": "integer",
      "minimum": 1,
      "maximum": 7
     },
     "accountingTimeZone": {
      "$ref": "#/components/schemas/IanaTimeZone"
     },
     "approvalRequired": {
      "type": "boolean"
     },
     "submittedEditPolicy": {
      "type": "string",
      "enum": [
       "pm_may_edit",
       "return_required"
      ]
     },
     "workingDays": {
      "type": "array",
      "minItems": 1,
      "maxItems": 7,
      "items": {
       "type": "integer",
       "minimum": 1,
       "maximum": 7
      }
     },
     "defaultWeeklyCapacityMinutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 6000
     },
     "loggingStreakEnabled": {
      "type": "boolean"
     },
     "maxMinutesPerDay": {
      "type": "integer",
      "minimum": 60,
      "maximum": 1440
     },
     "workingDayMinutes": {
      "type": "integer",
      "minimum": 60,
      "maximum": 1440
     },
     "entryOverlap": {
      "type": "string",
      "enum": [
       "allowed",
       "warned",
       "refused"
      ],
      "description": "F-TIM-02.R14 (XM-956): what happens when two timed entries of one member overlap."
     },
     "workingHours": {
      "$ref": "#/components/schemas/TimeWorkingHours"
     },
     "maxStarredTickets": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "F-TIM-02.R15 (XM-957): how many tickets a member may star for time logging."
     },
     "seriesHorizonDays": {
      "type": "integer",
      "minimum": 7,
      "maximum": 731,
      "description": "F-TIM-02.R17 (XM-960): how many days ahead a repeat series writes its real future entries."
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "nextBoundary": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "pending": {
      "type": "object",
      "required": [
       "effectiveFrom"
      ],
      "properties": {
       "effectiveFrom": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "transitionEnd": {
        "$ref": "#/components/schemas/DateOnly"
       },
       "changed": {
        "type": "array",
        "maxItems": 10,
        "items": {
         "type": "string",
         "maxLength": 120
        }
       },
       "weekStartsOn": {
        "type": "integer",
        "minimum": 1,
        "maximum": 7,
        "description": "Owner Q32 (22 Nov 2026): the waiting week start, from effectiveFrom."
       },
       "accountingTimeZone": {
        "$ref": "#/components/schemas/IanaTimeZone"
       },
       "approvalRequired": {
        "type": "boolean"
       },
       "submittedEditPolicy": {
        "type": "string",
        "enum": [
         "pm_may_edit",
         "return_required"
        ]
       },
       "workingDays": {
        "type": "array",
        "minItems": 1,
        "maxItems": 7,
        "items": {
         "type": "integer",
         "minimum": 1,
         "maximum": 7
        }
       }
      }
     },
     "needsAttention": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "string",
       "maxLength": 120
      },
      "description": "The keys whose stored value is unreadable — each shows its safe value (KDC-22; REV-XP14-12); absent when none is."
     }
    }
   },
   "TimeSummary": {
    "type": "object",
    "required": [
     "today",
     "todayMinutes",
     "period",
     "periodMinutes",
     "periodCapacityMinutes"
    ],
    "properties": {
     "today": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "todayMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "todayTargetMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "period": {
      "$ref": "#/components/schemas/TimesheetPeriodView"
     },
     "periodMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "periodCapacityMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "streakDays": {
      "type": "integer",
      "minimum": 1,
      "description": "Absent when the streak is 0 or switched off."
     },
     "previousPeriodMinutes": {
      "description": "F-TIM-08.R09 (G-H-60): the previous period's minutes up to the same day of that period (the Dashboard's trend). Absent when the member cannot log time.",
      "allOf": [
       {
        "$ref": "#/components/schemas/TimeMinutes"
       }
      ]
     }
    }
   },
   "TimeTicketCandidate": {
    "type": "object",
    "required": [
     "ticket",
     "project"
    ],
    "properties": {
     "ticket": {
      "$ref": "#/components/schemas/TimeTicketRef"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "stageName": {
      "type": "string",
      "maxLength": 40
     }
    }
   },
   "TimeTicketRef": {
    "type": "object",
    "required": [
     "key"
    ],
    "properties": {
     "key": {
      "type": "string",
      "maxLength": 30,
      "example": "ORB-126"
     },
     "title": {
      "type": "string",
      "maxLength": 200,
      "description": "Absent when the ticket is no longer visible to the viewer."
     },
     "available": {
      "type": "boolean"
     }
    }
   },
   "TimeTicketShortcuts": {
    "type": "object",
    "required": [
     "starred",
     "recent",
     "starLimit"
    ],
    "description": "F-TIM-02.R15, R16 (XM-957, XM-958) — the member's starred tickets (newest star first) and recent tickets (newest first).",
    "properties": {
     "starred": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/TimeTicketCandidate"
      }
     },
     "recent": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/TimeTicketCandidate"
      }
     },
     "starLimit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "`time.maxStarredTickets` in force."
     }
    }
   },
   "TimeTicketVisit": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "ticketKey"
    ],
    "properties": {
     "ticketKey": {
      "type": "string",
      "maxLength": 40
     }
    }
   },
   "TimeWorkingHours": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "start",
     "end"
    ],
    "description": "F-TIM-11.R11 (XM-956) — the working hours the My time calendar shades, in the accounting time zone; display only. start < end.",
    "properties": {
     "start": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
      "example": "09:00"
     },
     "end": {
      "type": "string",
      "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$",
      "example": "17:00"
     }
    }
   },
   "TimelineBar": {
    "type": "object",
    "required": [
     "start",
     "end"
    ],
    "properties": {
     "start": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "end": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "derivedStart": {
      "type": "boolean",
      "description": "The start came from the sprint start or is a one-day bar (D-025)."
     },
     "overflowFrom": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "milestone": {
      "type": "boolean",
      "description": "XM-1113 (F-WRK-13.R13): a milestone on its one date (start = end = the due date); the timeline draws a diamond. Absent for other bars."
     },
     "scheduleConflict": {
      "type": "boolean",
      "description": "Spec BF-1: the bar starts or ends before a visible prerequisite allows (F-WRK-34.R08)."
     }
    }
   },
   "TimelineRow": {
    "type": "object",
    "required": [
     "kind"
    ],
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "epic",
       "ticket",
       "no_epic"
      ]
     },
     "epic": {
      "$ref": "#/components/schemas/EpicRef"
     },
     "owner": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "targetDate": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "ticket": {
      "$ref": "#/components/schemas/TicketListItem"
     },
     "bar": {
      "$ref": "#/components/schemas/TimelineBar"
     },
     "depth": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2,
      "description": "Spec BF-1: the row's depth under a parent scope (F-WRK-31.R13)."
     },
     "progress": {
      "type": "object",
      "required": [
       "done",
       "total",
       "percent"
      ],
      "description": "XM-1111 (G-TL-01): the done share of an epic or a ticket row over its direct children that the reader can view — as the Epics view's progress (F-WRK-11.R12): total excludes the children closed with another resolution than completed, done counts the completed ones. {0, 0, 0} without such a child (the bar then shows its own stage). Absent on a no_epic row and when Status or Hierarchy is masked.",
      "properties": {
       "done": {
        "type": "integer",
        "minimum": 0
       },
       "total": {
        "type": "integer",
        "minimum": 0
       },
       "percent": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100
       }
      }
     },
     "can": {
      "type": "object",
      "required": [
       "rerank"
      ],
      "description": "A ticket row only (F-WRK-03.R14; BE-WP1TL-1).",
      "properties": {
       "rerank": {
        "type": "boolean",
        "description": "The reader may reorder the ticket among its epic's tickets (PUT /tickets/{ticketKey}/position with scope epic): rerank on the active project and the row is in an epic group; false in the No epic group."
       }
      }
     }
    }
   },
   "TimelineSettingsView": {
    "type": "object",
    "required": [
     "useStartDates",
     "undatedBars"
    ],
    "properties": {
     "useStartDates": {
      "type": "boolean"
     },
     "undatedBars": {
      "type": "string",
      "enum": [
       "sprint_start",
       "due_date_only"
      ]
     }
    }
   },
   "TimelineView": {
    "type": "object",
    "required": [
     "scope",
     "from",
     "to",
     "today",
     "useStartDates",
     "undatedBars",
     "rows"
    ],
    "properties": {
     "scope": {
      "type": "object",
      "required": [
       "kind",
       "id",
       "name"
      ],
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "sprint",
         "epic",
         "parent"
        ],
        "description": "parent — Spec BF-1: a parent ticket and its descendants (F-WRK-31.R13)."
       },
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "type": "string",
        "maxLength": 120
       },
       "key": {
        "$ref": "#/components/schemas/TicketKey"
       }
      }
     },
     "dependencies": {
      "type": "array",
      "maxItems": 1000,
      "description": "Spec BF-1: dependency edges between rows of this page that the reader can see (F-WRK-34.R08).",
      "items": {
       "$ref": "#/components/schemas/DependencyEdge"
      }
     },
     "dependenciesTruncated": {
      "type": "boolean",
      "description": "Spec BF-1: true when the page has more than 1,000 † visible edges; the first 1,000 by the dependent's row order are returned (F-WRK-34.R08)."
     },
     "from": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "to": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "today": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "useStartDates": {
      "type": "boolean"
     },
     "undatedBars": {
      "type": "string",
      "enum": [
       "sprint_start",
       "due_date_only"
      ]
     },
     "sprints": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "$ref": "#/components/schemas/SprintRef"
      }
     },
     "rows": {
      "type": "array",
      "maxItems": 600,
      "items": {
       "$ref": "#/components/schemas/TimelineRow"
      }
     },
     "nextCursor": {
      "type": "string",
      "maxLength": 512
     }
    }
   },
   "TimelineZoomKey": {
    "type": "string",
    "description": "XM-1722 (F-PRJ-07.R15): the zoom a new project's Timeline opens with. A save accepts only a zoom that the Timeline offers — today week only (D-050); day and month answer 422 defaults.timeline_zoom_unavailable.",
    "enum": [
     "day",
     "week",
     "month"
    ]
   },
   "TimesheetCan": {
    "type": "object",
    "required": [
     "submit",
     "approve",
     "return",
     "reopen",
     "editEntries"
    ],
    "properties": {
     "submit": {
      "type": "boolean"
     },
     "withdraw": {
      "type": "boolean",
      "description": "The member, before any decision (F-TIM-04.R11; register §21, CFL-607)."
     },
     "approve": {
      "type": "boolean"
     },
     "return": {
      "type": "boolean"
     },
     "reopen": {
      "type": "boolean"
     },
     "editEntries": {
      "type": "boolean"
     },
     "editRequiresReason": {
      "type": "boolean"
     }
    }
   },
   "TimesheetDecisionView": {
    "type": "object",
    "required": [
     "number",
     "kind",
     "actor",
     "at"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "kind": {
      "type": "string",
      "enum": [
       "approve",
       "return",
       "reopen",
       "withdraw"
      ]
     },
     "revision": {
      "type": "integer",
      "minimum": 1
     },
     "actor": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "TimesheetDetail": {
    "type": "object",
    "required": [
     "timesheet"
    ],
    "properties": {
     "timesheet": {
      "$ref": "#/components/schemas/TimesheetView"
     },
     "revisions": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/TimesheetRevisionView"
      }
     },
     "decisions": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/TimesheetDecisionView"
      }
     }
    }
   },
   "TimesheetExportRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "from",
     "to"
    ],
    "properties": {
     "from": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "to": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$"
     },
     "memberId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "customFieldKeys": {
      "type": "array",
      "maxItems": 10,
      "items": {
       "type": "string",
       "pattern": "^[a-z][a-z0-9_]{1,39}$"
      }
     },
     "team": {
      "$ref": "#/components/schemas/TeamExportScope"
     }
    }
   },
   "TimesheetPeriodView": {
    "type": "object",
    "required": [
     "start",
     "end",
     "current",
     "transition"
    ],
    "properties": {
     "start": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "end": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "current": {
      "type": "boolean",
      "description": "The period containing the viewer's today."
     },
     "transition": {
      "type": "boolean",
      "description": "An explicit transition period after a week-start change."
     },
     "previousStart": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "nextStart": {
      "$ref": "#/components/schemas/DateOnly"
     }
    }
   },
   "TimesheetRevisionView": {
    "type": "object",
    "required": [
     "number",
     "kind",
     "author",
     "createdAt",
     "totalMinutes",
     "entries"
    ],
    "properties": {
     "number": {
      "type": "integer",
      "minimum": 1
     },
     "kind": {
      "type": "string",
      "enum": [
       "submission",
       "pm_edit"
      ]
     },
     "author": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "totalMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "reason": {
      "type": "string",
      "maxLength": 500
     },
     "entries": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "type": "object",
       "required": [
        "worklogId",
        "project",
        "workedOn",
        "minutes"
       ],
       "properties": {
        "worklogId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "ticket": {
         "$ref": "#/components/schemas/TimeTicketRef"
        },
        "category": {
         "$ref": "#/components/schemas/TimeCategoryRef"
        },
        "project": {
         "$ref": "#/components/schemas/TimeProjectRef"
        },
        "workedOn": {
         "$ref": "#/components/schemas/DateOnly"
        },
        "minutes": {
         "type": "integer",
         "minimum": 1,
         "maximum": 1440
        },
        "note": {
         "type": "string",
         "maxLength": 500
        }
       }
      }
     }
    }
   },
   "TimesheetScopeKey": {
    "type": "string",
    "description": "Whose time a tenant time right reaches (grammar 5; XM-946) — the holder's own teams, the selected teams, or every internal member.",
    "enum": [
     "own_teams",
     "selected_teams",
     "all"
    ]
   },
   "TimesheetView": {
    "type": "object",
    "required": [
     "id",
     "member",
     "project",
     "period",
     "state",
     "totalMinutes",
     "approvalRequired",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "period": {
      "$ref": "#/components/schemas/TimesheetPeriodView"
     },
     "state": {
      "type": "string",
      "enum": [
       "draft",
       "submitted",
       "approved",
       "returned"
      ]
     },
     "totalMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "latestRevision": {
      "type": "integer",
      "minimum": 0
     },
     "approvalRequired": {
      "type": "boolean"
     },
     "noEligibleApprover": {
      "type": "boolean",
      "description": "Present and true while the sheet is submitted and no one but its own member could approve it — the row reads \"Submitted · waiting for an approver\" (F-TIM-04.R12, F-TIM-06.R08; P2 round 2, CG-06). Computed on read by the same eligibility rule as the approval queue."
     },
     "submittedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "approval": {
      "type": "object",
      "required": [
       "by",
       "at",
       "revision",
       "totalMinutes"
      ],
      "properties": {
       "by": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "revision": {
        "type": "integer",
        "minimum": 1
       },
       "totalMinutes": {
        "$ref": "#/components/schemas/TimeMinutes"
       }
      }
     },
     "returned": {
      "type": "object",
      "required": [
       "by",
       "at",
       "note"
      ],
      "properties": {
       "by": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "note": {
        "type": "string",
        "maxLength": 500
       }
      }
     },
     "reopened": {
      "type": "object",
      "required": [
       "by",
       "at",
       "reason"
      ],
      "properties": {
       "by": {
        "$ref": "#/components/schemas/MemberRef"
       },
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "reason": {
        "type": "string",
        "maxLength": 500
       }
      }
     },
     "can": {
      "$ref": "#/components/schemas/TimesheetCan"
     }
    }
   },
   "TokenCheckView": {
    "type": "object",
    "required": [
     "checkId",
     "expiresAt",
     "tokenKind",
     "tokenAccount",
     "verifiedScopes",
     "webhookModes",
     "repositories"
    ],
    "properties": {
     "checkId": {
      "type": "string",
      "minLength": 22,
      "maxLength": 64,
      "example": "9mQ2v8Wq1Zx4fT0bHk3sLA"
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "tokenKind": {
      "$ref": "#/components/schemas/TokenKindKey"
     },
     "tokenAccount": {
      "type": "object",
      "required": [
       "login",
       "kind"
      ],
      "properties": {
       "login": {
        "type": "string",
        "maxLength": 100,
        "example": "northwind-youniton-bot"
       },
       "kind": {
        "type": "string",
        "enum": [
         "user",
         "bot",
         "service_account"
        ]
       }
      }
     },
     "tokenExpiresAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "verifiedScopes": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "string",
       "maxLength": 40
      }
     },
     "webhookModes": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "items": {
       "$ref": "#/components/schemas/WebhookModeKey"
      },
      "description": "managed only when the token may manage hooks; manual always."
     },
     "repositories": {
      "type": "array",
      "maxItems": 500,
      "items": {
       "$ref": "#/components/schemas/RepositoryChoice"
      }
     },
     "truncated": {
      "type": "boolean",
      "description": "True when the token can read more than 500 repositories."
     }
    }
   },
   "TokenKindKey": {
    "type": "string",
    "enum": [
     "github_fine_grained",
     "gitlab_project",
     "gitlab_group",
     "gitlab_service_account"
    ]
   },
   "TokenPolicyUpdate": {
    "type": "object",
    "required": [
     "allowed",
     "maxLifetimeDays"
    ],
    "additionalProperties": false,
    "properties": {
     "allowed": {
      "type": "boolean"
     },
     "maxLifetimeDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365
     },
     "expectedActiveTokens": {
      "type": "integer",
      "minimum": 0,
      "description": "The count the confirmation showed; a different count answers 409 so the admin confirms again."
     }
    }
   },
   "TranscriptPassageView": {
    "type": "object",
    "required": [
     "passageNo",
     "speakerLabel",
     "startMs",
     "endMs",
     "text",
     "finality"
    ],
    "properties": {
     "passageNo": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20000
     },
     "speakerLabel": {
      "type": "string",
      "maxLength": 120,
      "description": "Untrusted text from the transcriber; never an identity."
     },
     "startMs": {
      "type": "integer",
      "minimum": 0
     },
     "endMs": {
      "type": "integer",
      "minimum": 0
     },
     "text": {
      "type": "string",
      "maxLength": 4000
     },
     "finality": {
      "type": "string",
      "enum": [
       "final",
       "recovered_partial"
      ]
     }
    }
   },
   "TutorialActionRequest": {
    "type": "object",
    "required": [
     "action"
    ],
    "additionalProperties": false,
    "properties": {
     "action": {
      "type": "string",
      "enum": [
       "search_result_opened"
      ],
      "description": "A completing action the server cannot observe (Search writes nothing) — step 5 (F-WSP-09.R10)."
     }
    }
   },
   "TutorialSkipRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "step": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5,
      "description": "Skip one step (\"Next\"); omit to skip the tour."
     }
    }
   },
   "TutorialStepView": {
    "type": "object",
    "required": [
     "step",
     "state"
    ],
    "properties": {
     "step": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
     },
     "key": {
      "type": "string",
      "enum": [
       "pin_project",
       "move_to_in_progress",
       "log_time",
       "comment_on_ticket",
       "open_search_result"
      ]
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "completed",
       "skipped"
      ]
     },
     "at": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "TutorialView": {
    "type": "object",
    "required": [
     "visible",
     "totalSteps",
     "steps"
    ],
    "properties": {
     "visible": {
      "type": "boolean",
      "description": "False after Skip tour or Dismiss, after the last step, or with the tenant's tour off."
     },
     "currentStep": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
     },
     "totalSteps": {
      "type": "integer",
      "minimum": 5,
      "maximum": 5
     },
     "lastResult": {
      "type": "string",
      "enum": [
       "completed",
       "skipped"
      ]
     },
     "stepTicketKey": {
      "type": "string",
      "maxLength": 30,
      "description": "The card dropped for step 2, opened by step 3's button when still visible."
     },
     "steps": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/TutorialStepView"
      }
     }
    }
   },
   "TwoFactorOverview": {
    "type": "object",
    "required": [
     "enrolled",
     "requiredHere",
     "requiredAnywhere",
     "policy"
    ],
    "properties": {
     "enrolled": {
      "type": "boolean"
     },
     "enrolledAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "requiredHere": {
      "type": "boolean",
      "description": "The current tenant requires 2FA for the person (policy, Admin role or invitation flag)."
     },
     "requiredAnywhere": {
      "type": "boolean",
      "description": "Some tenant of the account requires it; turning off is refused."
     },
     "policy": {
      "type": "string",
      "enum": [
       "everyone",
       "admins",
       "optional"
      ]
     },
     "requiredReason": {
      "type": "string",
      "enum": [
       "policy_everyone",
       "policy_admins",
       "invitation"
      ]
     },
     "tenantName": {
      "type": "string"
     },
     "recoveryCodesRemaining": {
      "type": "integer",
      "minimum": 0,
      "maximum": 8
     },
     "canTurnOff": {
      "type": "boolean"
     }
    }
   },
   "TwoFactorPolicyUpdate": {
    "type": "object",
    "required": [
     "policy",
     "trustedDevicesAllowed",
     "trustedDevicesPreselected"
    ],
    "additionalProperties": false,
    "properties": {
     "policy": {
      "type": "string",
      "enum": [
       "everyone",
       "admins",
       "optional"
      ]
     },
     "trustedDevicesAllowed": {
      "type": "boolean"
     },
     "trustedDevicesPreselected": {
      "type": "boolean"
     },
     "reminderCooldownHours": {
      "type": "integer",
      "minimum": 24,
      "maximum": 168,
      "description": "identity.twoFactor.reminderCooldownHours (F-NOT-06.R02); absent keeps the stored value (XM-34)."
     }
    }
   },
   "TwoFactorReminderRequest": {
    "type": "object",
    "properties": {
     "memberIds": {
      "type": "array",
      "description": "Absent — every member who must enrol and has not (D-057).",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     }
    }
   },
   "TwoFactorReminderResult": {
    "type": "object",
    "required": [
     "sent",
     "skipped"
    ],
    "properties": {
     "sent": {
      "type": "integer",
      "minimum": 0,
      "example": 3
     },
     "skipped": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "type": "object",
       "required": [
        "memberId",
        "reason"
       ],
       "properties": {
        "memberId": {
         "$ref": "#/components/schemas/Uuid"
        },
        "reason": {
         "type": "string",
         "enum": [
          "reminder_cooldown",
          "already_enrolled",
          "not_active",
          "client_member",
          "self"
         ]
        }
       }
      }
     }
    }
   },
   "TypeChangePreview": {
    "type": "object",
    "required": [
     "from",
     "to",
     "parent",
     "children",
     "customFields",
     "ticketVersion"
    ],
    "properties": {
     "from": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "to": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "ticketVersion": {
      "type": "integer",
      "minimum": 1
     },
     "parent": {
      "type": "object",
      "required": [
       "fits",
       "required"
      ],
      "properties": {
       "current": {
        "$ref": "#/components/schemas/ParentRef"
       },
       "fits": {
        "type": "boolean",
        "description": "The current parent (or no parent) is allowed for the new type."
       },
       "required": {
        "type": "boolean",
        "description": "The new type is a subtask type and needs a parent."
       },
       "allowedParentTypes": {
        "type": "array",
        "maxItems": 29,
        "items": {
         "$ref": "#/components/schemas/TicketTypeRef"
        }
       }
      }
     },
     "children": {
      "type": "object",
      "required": [
       "total",
       "fitting",
       "notFitting",
       "dispositions",
       "childrenOutsideYourView"
      ],
      "description": "The counts cover only the children that the actor can view.",
      "properties": {
       "total": {
        "type": "integer",
        "minimum": 0,
        "description": "No maximum: an epic that the one-time epic move left above its 5,000 † bound can have more children (§3.15; SR-BF1-43)."
       },
       "fitting": {
        "type": "integer",
        "minimum": 0
       },
       "notFitting": {
        "type": "integer",
        "minimum": 0
       },
       "notFittingByType": {
        "type": "array",
        "maxItems": 30,
        "items": {
         "type": "object",
         "required": [
          "type",
          "count"
         ],
         "properties": {
          "type": {
           "$ref": "#/components/schemas/TicketTypeRef"
          },
          "count": {
           "type": "integer",
           "minimum": 1
          }
         }
        }
       },
       "sample": {
        "type": "array",
        "maxItems": 20,
        "items": {
         "$ref": "#/components/schemas/TicketChildRow"
        }
       },
       "dispositions": {
        "type": "array",
        "maxItems": 5,
        "description": "The child dispositions that are possible for this change.",
        "items": {
         "type": "string",
         "enum": [
          "keep",
          "detach",
          "move_to_parent",
          "move",
          "retype"
         ]
        }
       },
       "childrenOutsideYourView": {
        "type": "boolean",
        "description": "True when the change affects at least one child that the actor cannot view. Never a count (SR-BF1-03). The change is then refused with 403."
       }
      }
     },
     "customFields": {
      "type": "object",
      "required": [
       "hidden",
       "shownAgain",
       "requiredMissing"
      ],
      "properties": {
       "hidden": {
        "type": "array",
        "maxItems": 50,
        "description": "Fields with a value that the new type does not use — kept and hidden.",
        "items": {
         "$ref": "#/components/schemas/CustomFieldKey"
        }
       },
       "shownAgain": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/CustomFieldKey"
        }
       },
       "requiredMissing": {
        "type": "array",
        "maxItems": 50,
        "items": {
         "$ref": "#/components/schemas/CustomFieldSchemaEntry"
        }
       }
      }
     },
     "sprintFollowsParent": {
      "type": "boolean"
     }
    }
   },
   "TypeChangeRequest": {
    "type": "object",
    "required": [
     "typeKey",
     "expectedChildCount"
    ],
    "additionalProperties": false,
    "properties": {
     "typeKey": {
      "$ref": "#/components/schemas/TicketTypeKey"
     },
     "expectedChildCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The child total that the preview showed (the children that the actor can view). No maximum, as the preview's total (SR-BF1-43)."
     },
     "parent": {
      "type": "object",
      "required": [
       "disposition"
      ],
      "additionalProperties": false,
      "properties": {
       "disposition": {
        "type": "string",
        "enum": [
         "keep",
         "detach",
         "move"
        ]
       },
       "parentKey": {
        "$ref": "#/components/schemas/TicketKey"
       }
      }
     },
     "children": {
      "type": "object",
      "required": [
       "disposition"
      ],
      "additionalProperties": false,
      "properties": {
       "disposition": {
        "type": "string",
        "enum": [
         "keep",
         "detach",
         "move_to_parent",
         "move",
         "retype"
        ]
       },
       "parentKey": {
        "$ref": "#/components/schemas/TicketKey"
       },
       "typeKey": {
        "$ref": "#/components/schemas/TicketTypeKey"
       }
      }
     },
     "customFields": {
      "$ref": "#/components/schemas/CustomFieldInputMap"
     }
    }
   },
   "TypeChangeResult": {
    "type": "object",
    "required": [
     "key",
     "type",
     "version",
     "childrenMoved",
     "childrenRetyped",
     "hiddenFieldKeys"
    ],
    "properties": {
     "key": {
      "$ref": "#/components/schemas/TicketKey"
     },
     "type": {
      "$ref": "#/components/schemas/TicketTypeRef"
     },
     "parent": {
      "$ref": "#/components/schemas/ParentRef"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "childrenMoved": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
     },
     "childrenRetyped": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
     },
     "hiddenFieldKeys": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/CustomFieldKey"
      }
     }
    }
   },
   "TypeFieldProfileInput": {
    "type": "object",
    "required": [
     "mode"
    ],
    "additionalProperties": false,
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "all",
       "only"
      ]
     },
     "fieldKeys": {
      "type": "array",
      "maxItems": 50,
      "uniqueItems": true,
      "description": "For mode only — custom field keys of the project's field set.",
      "items": {
       "$ref": "#/components/schemas/CustomFieldKey"
      }
     }
    }
   },
   "TypedRef": {
    "type": "object",
    "required": [
     "type",
     "id"
    ],
    "properties": {
     "type": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "example": "role"
     },
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "label": {
      "type": "string",
      "maxLength": 200,
      "example": "Client"
     }
    }
   },
   "UnreadSummary": {
    "type": "object",
    "required": [
     "conversationsWithUnread",
     "capped",
     "byKind"
    ],
    "properties": {
     "conversationsWithUnread": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99
     },
     "capped": {
      "type": "boolean",
      "description": "True when more conversations than the cap have unread messages."
     },
     "byKind": {
      "type": "object",
      "required": [
       "direct",
       "group",
       "project_client"
      ],
      "properties": {
       "direct": {
        "type": "integer",
        "minimum": 0
       },
       "group": {
        "type": "integer",
        "minimum": 0
       },
       "project_client": {
        "type": "integer",
        "minimum": 0
       }
      }
     }
    }
   },
   "UploadCompleteRequest": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "parts": {
      "type": "array",
      "minItems": 1,
      "maxItems": 16,
      "items": {
       "type": "object",
       "required": [
        "partNumber",
        "etag"
       ],
       "additionalProperties": false,
       "properties": {
        "partNumber": {
         "type": "integer",
         "minimum": 1,
         "maximum": 16
        },
        "etag": {
         "type": "string",
         "maxLength": 128
        }
       }
      }
     }
    }
   },
   "UploadIntentRequest": {
    "type": "object",
    "required": [
     "purpose",
     "target",
     "fileName",
     "sizeBytes",
     "mimeType"
    ],
    "additionalProperties": false,
    "properties": {
     "purpose": {
      "type": "string",
      "enum": [
       "attachment",
       "inline_image",
       "message_attachment",
       "import_source",
       "branding_logo",
       "expense_receipt"
      ]
     },
     "target": {
      "type": "object",
      "required": [
       "type",
       "id"
      ],
      "additionalProperties": false,
      "properties": {
       "type": {
        "type": "string",
        "enum": [
         "ticket",
         "comment_draft",
         "ticket_description",
         "doc_page",
         "message_draft",
         "import",
         "portal_branding",
         "help_desk_draft",
         "help_desk_request",
         "expense"
        ]
       },
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "thread": {
        "type": "string",
        "enum": [
         "internal",
         "client"
        ],
        "description": "For comment_draft — the thread the file will follow."
       }
      }
     },
     "fileName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "example": "approval-flow.pdf"
     },
     "sizeBytes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 262144000,
      "example": 1843200
     },
     "mimeType": {
      "type": "string",
      "maxLength": 127,
      "example": "application/pdf"
     },
     "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     }
    }
   },
   "UploadIntentView": {
    "type": "object",
    "required": [
     "fileId",
     "strategy",
     "expiresAt"
    ],
    "properties": {
     "fileId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "strategy": {
      "type": "string",
      "enum": [
       "single",
       "multipart"
      ]
     },
     "put": {
      "type": "object",
      "required": [
       "url",
       "headers"
      ],
      "properties": {
       "url": {
        "type": "string",
        "maxLength": 4096
       },
       "headers": {
        "type": "object",
        "additionalProperties": {
         "type": "string"
        }
       }
      }
     },
     "multipart": {
      "type": "object",
      "required": [
       "partSizeBytes",
       "maxParts"
      ],
      "properties": {
       "partSizeBytes": {
        "type": "integer",
        "enum": [
         16777216
        ]
       },
       "maxParts": {
        "type": "integer",
        "minimum": 1,
        "maximum": 16
       }
      }
     },
     "expiresAt": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "UploadSignRequest": {
    "type": "object",
    "required": [
     "operation"
    ],
    "additionalProperties": false,
    "properties": {
     "operation": {
      "type": "string",
      "enum": [
       "create",
       "part",
       "abort"
      ]
     },
     "uploadId": {
      "type": "string",
      "maxLength": 1024
     },
     "partNumber": {
      "type": "integer",
      "minimum": 1,
      "maximum": 16
     }
    }
   },
   "Uuid": {
    "type": "string",
    "format": "uuid",
    "example": "0192f1a8-7c3e-7b10-9a2e-5d1f0c4b8e21"
   },
   "VatPercentText": {
    "type": "string",
    "pattern": "^(0|[1-9][0-9]{0,2})(\\.[0-9]{1,2})?$",
    "description": "A VAT percent from 0 to 100 with at most 2 fraction digits (F-FIN-16.R16)."
   },
   "ViewColumnIdList": {
    "type": "array",
    "description": "Distinct column ids of the view's vocabulary, in order (F-WRK-41 §7 lists them).",
    "maxItems": 64,
    "uniqueItems": true,
    "items": {
     "type": "string",
     "pattern": "^[a-z][a-z0-9_]{0,39}$"
    }
   },
   "ViewDefault": {
    "type": "object",
    "description": "The default of the view as the reader sees it (the saved default, or the system default).",
    "required": [
     "columns",
     "order",
     "density",
     "forced",
     "scope",
     "source",
     "version"
    ],
    "properties": {
     "columns": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "order": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "density": {
      "$ref": "#/components/schemas/ViewDensity"
     },
     "forced": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "scope": {
      "type": "string",
      "enum": [
       "project",
       "workspace"
      ]
     },
     "source": {
      "type": "string",
      "enum": [
       "default",
       "system"
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1,
      "description": "The default's version for If-Match on the default (1 when never saved)."
     },
     "savedBy": {
      "type": "string",
      "format": "uuid",
      "description": "The member id of the saver. The UI reads the name through the normal member read; an erased member reads \"Former member\"."
     },
     "savedAt": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "ViewDefaultDraft": {
    "type": "object",
    "description": "A default (R08, R09). forced must be shown by columns and listed in work.views.forcibleColumns (a workspace view forces nothing).",
    "required": [
     "columns",
     "density"
    ],
    "properties": {
     "columns": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "order": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "density": {
      "$ref": "#/components/schemas/ViewDensity"
     },
     "forced": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     }
    }
   },
   "ViewDensity": {
    "type": "string",
    "enum": [
     "comfortable",
     "compact"
    ]
   },
   "ViewKind": {
    "type": "string",
    "description": "The view (F-WRK-41.R02). New views join the registry without a migration (R04).",
    "enum": [
     "backlog",
     "list",
     "epics",
     "my_tickets",
     "projects",
     "help_desk_queue",
     "dashboard"
    ]
   },
   "ViewPreference": {
    "type": "object",
    "description": "F-WRK-41.R03: the effective display layout of the view for the reader — the reader's own, else the saved default, else the system default; only the columns the reader may see (R06); the forced columns shown (R08). columns = shown, in order; order = every offered column. version is the reader's preference version for If-Match (1 when never saved).",
    "required": [
     "view",
     "columns",
     "order",
     "density",
     "source",
     "version",
     "default",
     "canSaveDefault"
    ],
    "properties": {
     "view": {
      "$ref": "#/components/schemas/ViewKind"
     },
     "columns": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "order": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "density": {
      "$ref": "#/components/schemas/ViewDensity"
     },
     "source": {
      "type": "string",
      "enum": [
       "user",
       "default",
       "system"
      ]
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "default": {
      "$ref": "#/components/schemas/ViewDefault"
     },
     "canSaveDefault": {
      "type": "boolean",
      "description": "R09 — plan on the project (a project view) or administer (a workspace view)."
     }
    }
   },
   "ViewPreferenceDraft": {
    "type": "object",
    "description": "The caller's own layout (R07). Every id must be a column the caller may see (view.column_unknown); no forced columns.",
    "required": [
     "columns",
     "density"
    ],
    "properties": {
     "columns": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "order": {
      "$ref": "#/components/schemas/ViewColumnIdList"
     },
     "density": {
      "$ref": "#/components/schemas/ViewDensity"
     }
    }
   },
   "VisibleFeatureList": {
    "type": "array",
    "maxItems": 2000,
    "uniqueItems": true,
    "description": "XM-1331 (F-PLT-15.R13): THE check's answer — the keys of the feature-switch map that the signed-in account may see, in the catalogue's order, and only the keys of the reading shell's own surfaces (XM-1356: the workspace session, the client portal and the console each get their own). A row is visible when it is on, its visibility admits the reader (everyone; platform admins = an account that is an ACTIVE console operator's account, by the account id; testers = an address on the tester list, and platform admins) and its parent row is visible. A key the reader may not see is ABSENT (hidden ≡ missing); the SPA shows a menu item, page or feature only while its key is in the list, and reads a key it does not know as hidden. An affordance only: a switched-off feature is NOT refused by the API until XM-1333; every request is decided again by its owner.",
    "items": {
     "$ref": "#/components/schemas/FeatureSwitchKey"
    }
   },
   "Warning": {
    "type": "object",
    "required": [
     "code"
    ],
    "properties": {
     "code": {
      "type": "string"
     },
     "detail": {
      "type": "string"
     }
    }
   },
   "WebhookEndpointInput": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
     },
     "url": {
      "type": "string",
      "maxLength": 2048,
      "pattern": "^https://"
     },
     "availableToProjectRules": {
      "type": "boolean"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "paused",
       "disabled"
      ]
     }
    }
   },
   "WebhookEndpointSecretView": {
    "type": "object",
    "required": [
     "endpoint",
     "secret"
    ],
    "description": "The only answers that carry the secret (create and rotate); never readable again.",
    "properties": {
     "endpoint": {
      "$ref": "#/components/schemas/WebhookEndpointView"
     },
     "secret": {
      "type": "string",
      "pattern": "^whsec_[A-Za-z0-9+/=]{43,64}$"
     },
     "previousValidUntil": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "WebhookEndpointView": {
    "type": "object",
    "required": [
     "id",
     "name",
     "url",
     "status",
     "availableToProjectRules",
     "usedByRules",
     "createdAt",
     "version"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "Orbit ops bridge"
     },
     "url": {
      "type": "string",
      "maxLength": 2048,
      "example": "https://hooks.northwind.example/youniton"
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "failing",
       "paused",
       "disabled"
      ]
     },
     "statusReason": {
      "type": "string",
      "enum": [
       "manual",
       "failing_three_days",
       "gone",
       "support_restriction"
      ]
     },
     "availableToProjectRules": {
      "type": "boolean"
     },
     "failingSince": {
      "$ref": "#/components/schemas/Instant"
     },
     "secretRotatingUntil": {
      "$ref": "#/components/schemas/Instant"
     },
     "usedByRules": {
      "type": "integer",
      "minimum": 0
     },
     "secretTail": {
      "type": "string",
      "pattern": "^[A-Za-z0-9+/]{4}$",
      "description": "A13 (XM-1298): the last 4 characters of the current secret without the base64 padding (the hint whsec_…Q2m8); absent for a secret issued before A13."
     },
     "secretRotatedAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "lastDelivery": {
      "type": "object",
      "description": "A13 (XM-1298): the newest delivery of the endpoint's log; absent before the first one.",
      "required": [
       "at",
       "status"
      ],
      "properties": {
       "at": {
        "$ref": "#/components/schemas/Instant"
       },
       "status": {
        "type": "string",
        "enum": [
         "pending",
         "delivered",
         "retrying",
         "failed",
         "abandoned",
         "suppressed"
        ]
       }
      }
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "WebhookModeKey": {
    "type": "string",
    "enum": [
     "managed",
     "manual"
    ]
   },
   "WeekGrid": {
    "type": "object",
    "required": [
     "period",
     "member",
     "rows",
     "dailyTotals",
     "totalMinutes",
     "capacityMinutes",
     "ticketRowCount",
     "otherRowCount",
     "timesheets",
     "can"
    ],
    "properties": {
     "period": {
      "$ref": "#/components/schemas/TimesheetPeriodView"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "dayOrder": {
      "type": "array",
      "maxItems": 14,
      "description": "The period's dates in chronological order — pref.weekStart never reorders the Time grid (register §21, CFL-604); kept so the order is one server rule.",
      "items": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     "rows": {
      "type": "array",
      "maxItems": 200,
      "items": {
       "$ref": "#/components/schemas/WeekGridRow"
      }
     },
     "dailyTotals": {
      "type": "array",
      "maxItems": 14,
      "items": {
       "$ref": "#/components/schemas/TimeMinutes"
      }
     },
     "totalMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "capacityMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     },
     "ticketRowCount": {
      "type": "integer",
      "minimum": 0
     },
     "otherRowCount": {
      "type": "integer",
      "minimum": 0
     },
     "timesheets": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/TimesheetView"
      }
     },
     "can": {
      "type": "object",
      "required": [
       "logTime"
      ],
      "properties": {
       "logTime": {
        "type": "boolean"
       },
       "editable": {
        "type": "boolean",
        "description": "False for read-only viewers. A future period is editable (F-TIM-02.R03)."
       }
      }
     }
    }
   },
   "WeekGridRow": {
    "type": "object",
    "required": [
     "id",
     "project",
     "kind",
     "days",
     "totalMinutes"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 96,
      "description": "ticket:<id> (43 characters) or category:<id>:<projectId> (82 characters); each id is a UUIDv7 (36 characters). The UI uses it in ?cell=<rowId>:<date> (F-TIM-03), so the format does not change. The bound is 96 (XM-797; it was 80, which refused every category row)."
     },
     "ticket": {
      "$ref": "#/components/schemas/TimeTicketRef"
     },
     "category": {
      "$ref": "#/components/schemas/TimeCategoryRef"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "kind": {
      "type": "string",
      "enum": [
       "client",
       "internal",
       "leave"
      ],
      "description": "What the time was for (XM-1097; F-TIM-01.R11): leave for a category with the leave mark; client when the project has a client organisation that the reader can see; else internal. A hidden organisation counts as none."
     },
     "clientName": {
      "type": "string",
      "maxLength": 120,
      "description": "The display name of the project's client organisation. Only on a client row."
     },
     "days": {
      "type": "array",
      "minItems": 1,
      "maxItems": 14,
      "description": "Minutes per day of the period in date order; null where nothing is logged.",
      "items": {
       "oneOf": [
        {
         "$ref": "#/components/schemas/TimeMinutes"
        },
        {
         "type": "null"
        }
       ]
      }
     },
     "totalMinutes": {
      "$ref": "#/components/schemas/TimeMinutes"
     }
    }
   },
   "WhatsNewEntry": {
    "type": "object",
    "required": [
     "id",
     "publishedOn",
     "title",
     "body",
     "unseen"
    ],
    "properties": {
     "id": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9-]{1,40}$"
     },
     "publishedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "title": {
      "type": "string",
      "maxLength": 120
     },
     "body": {
      "$ref": "#/components/schemas/RichTextDocument"
     },
     "unseen": {
      "type": "boolean"
     }
    }
   },
   "WhatsNewView": {
    "type": "object",
    "required": [
     "entries",
     "unseenCount",
     "helpCentreUrl"
    ],
    "properties": {
     "entries": {
      "type": "array",
      "maxItems": 50,
      "items": {
       "$ref": "#/components/schemas/WhatsNewEntry"
      }
     },
     "unseenCount": {
      "type": "integer",
      "minimum": 0
     },
     "helpCentreUrl": {
      "type": "string",
      "maxLength": 300,
      "example": "https://help.youniton.example"
     }
    }
   },
   "WorkFilterInput": {
    "type": "object",
    "properties": {
     "assigneeId": {
      "type": "string",
      "maxLength": 3700,
      "description": "me, none or a member id — or a comma list of 1–100 of them, any of (XM-708: the assignee avatars select several people; F-WRK-01.R06). More than 100 values, an unknown id or an empty value is 400 query.invalid."
     },
     "clientVisible": {
      "type": "boolean"
     },
     "epicId": {
      "description": "BF1-EPIC (§3.15): none, or the id of an epic-level ticket of the project — its direct children. XM-1166 (G-BL-03): also a comma list of 1–100 epic ids (any of), or an object of operator rules (FacetRulesInput). Each named id must be a live epic of the project, else 400 query.invalid naming filter[epicId]. A ticket has no epic or one: allOf of two or more epics matches no ticket; noneOf keeps the tickets without an epic. Needs hierarchy in the reader's mask, else 400 hierarchy_not_visible.",
      "oneOf": [
       {
        "type": "string",
        "maxLength": 3700
       },
       {
        "$ref": "#/components/schemas/FacetRulesInput"
       }
      ]
     },
     "priority": {
      "type": "string",
      "maxLength": 840,
      "description": "XM-1098: a comma list of 1–20 keys of the tenant's priority list (any of). A malformed key is 400 query.invalid; a key that no ticket holds matches no ticket."
     },
     "due": {
      "type": "string",
      "enum": [
       "overdue",
       "this_week",
       "next_week",
       "none"
      ]
     },
     "type": {
      "description": "Spec BF-1: a comma list of the project type keys (F-WRK-31.R12), any of. XM-1166 (G-BL-03): or an object of operator rules (FacetRulesInput) over 1–30 type keys. A ticket has one type: allOf of two or more types and empty match no ticket; notEmpty matches every ticket. Needs Type in the reader's mask, else 400 type_not_visible.",
      "oneOf": [
       {
        "type": "string",
        "maxLength": 300
       },
       {
        "$ref": "#/components/schemas/FacetRulesInput"
       }
      ]
     },
     "parent": {
      "type": "string",
      "maxLength": 20,
      "description": "Spec BF-1: none or a parent ticket key — its direct children (F-WRK-31.R12)."
     },
     "blocked": {
      "type": "boolean",
      "description": "Spec BF-1: tickets with (true) or without (false) a visible open blocker (F-WRK-34.R06)."
     },
     "stage": {
      "description": "XM-1100: a comma list of 1–20 stage ids (any of). An empty, malformed or too long list is 400 query.invalid; an id that is no stage of the project matches no ticket. Needs Status in the reader's mask, else 400 status_not_visible. XM-1166 (G-WB-07): or an object of operator rules (FacetRulesInput), each rule 1–20 stage ids. A ticket has one stage: allOf of two or more stages and empty match no ticket; notEmpty matches every ticket.",
      "oneOf": [
       {
        "type": "string",
        "maxLength": 760
       },
       {
        "$ref": "#/components/schemas/FacetRulesInput"
       }
      ]
     },
     "label": {
      "description": "XM-1100: a comma list of 1–100 label ids — the tickets that carry any of them. An empty, malformed or too long list is 400 query.invalid; an id that is no label of the project matches no ticket. Needs Labels in the reader's mask (for every operator, empty and notEmpty included), else 400 labels_not_visible. XM-1166 (G-WB-07): or an object of operator rules (FacetRulesInput), each rule 1–100 label ids. A ticket holds at most 20 labels, so allOf of more than 20 labels matches no ticket.",
      "oneOf": [
       {
        "type": "string",
        "maxLength": 3800
       },
       {
        "$ref": "#/components/schemas/FacetRulesInput"
       }
      ]
     },
     "title": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": false,
      "description": "XM-1166 (G-BL-03): \"Title contains\" — the tickets whose title contains the text (contains) or does not contain it (not.contains), without case; 1–120 characters each, else 400 query.invalid naming the parameter (filter[title][contains]). Not the key (that is q). Needs Title in the reader's mask, else 400 title_not_visible.",
      "properties": {
       "contains": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       },
       "not.contains": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
       }
      }
     }
    },
    "additionalProperties": {
     "description": "cf.<key> filters; the value grammar follows the field type (any of, ranges with [gte]/[lte], me, empty). A range is an object of its operators (XM-708).",
     "oneOf": [
      {
       "type": "string",
       "maxLength": 2000
      },
      {
       "type": "object",
       "maxProperties": 2,
       "additionalProperties": {
        "type": "string",
        "maxLength": 2000
       }
      }
     ]
    }
   },
   "WorkFrameView": {
    "type": "object",
    "required": [
     "sprintsEnabled",
     "backlogCount",
     "clientVisibleCount",
     "assignees",
     "views"
    ],
    "properties": {
     "sprintsEnabled": {
      "type": "boolean",
      "description": "False when the Backlog & sprints module is off (D-033)."
     },
     "sprint": {
      "$ref": "#/components/schemas/WorkSprintSummary"
     },
     "backlogCount": {
      "type": "integer",
      "minimum": 0,
      "example": 2318
     },
     "clientVisibleCount": {
      "type": "integer",
      "minimum": 0,
      "example": 4
     },
     "assignees": {
      "type": "object",
      "required": [
       "members",
       "more",
       "unassigned"
      ],
      "properties": {
       "members": {
        "type": "array",
        "maxItems": 8,
        "items": {
         "$ref": "#/components/schemas/AssigneeStripMember"
        }
       },
       "more": {
        "type": "integer",
        "minimum": 0
       },
       "unassigned": {
        "type": "boolean"
       }
      }
     },
     "views": {
      "type": "array",
      "maxItems": 5,
      "items": {
       "$ref": "#/components/schemas/WorkViewKey"
      }
     }
    }
   },
   "WorkSprintSummary": {
    "type": "object",
    "required": [
     "id",
     "name",
     "startsOn",
     "endsOn",
     "ticketCount",
     "goal"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "example": "Sprint 14"
     },
     "startsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "endsOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "ticketCount": {
      "type": "integer",
      "minimum": 0,
      "example": 12
     },
     "goal": {
      "$ref": "#/components/schemas/GoalProgressView"
     },
     "capacityMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 6000000,
      "description": "F-WRK-08.R13 (register 29 November 2026): the capacity in minutes (unit time). Absent = no capacity in minutes."
     },
     "capacityPoints": {
      "type": "number",
      "minimum": 0.1,
      "maximum": 100000,
      "description": "F-WRK-08.R13: the capacity in story points (unit points). Absent = no capacity in points."
     }
    }
   },
   "WorkViewKey": {
    "type": "string",
    "enum": [
     "board",
     "backlog",
     "epics",
     "timeline",
     "calendar"
    ]
   },
   "WorklogCan": {
    "type": "object",
    "description": "What the reader may do with the worklog (F-TIM-03 §6). G230: the assistant's change and delete of an entry need edit and clear.",
    "required": [
     "edit",
     "clear"
    ],
    "properties": {
     "edit": {
      "type": "boolean"
     },
     "clear": {
      "type": "boolean"
     },
     "requiresReason": {
      "type": "boolean"
     }
    }
   },
   "WorklogCreateRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "workedOn"
    ],
    "description": "The duration, or startTime + endTime (XM-956), or all three when they agree (422 worklog.end_time_mismatch otherwise).",
    "properties": {
     "ticketKey": {
      "type": "string",
      "maxLength": 30,
      "example": "ORB-126"
     },
     "categoryId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$",
      "description": "Required with a category."
     },
     "workedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "duration": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20,
      "description": "The duration grammar: 4h, 1h 30m, 1.5h, 90m, 1d 2h.",
      "example": "1h 30m"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "startTime": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
      "example": "09:30",
      "description": "Optional (F-TIM-02.R12): the time of day the entry starts on workedOn; start + the duration must end by 24:00 (422 worklog.start_time_past_day)."
     },
     "endTime": {
      "type": "string",
      "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$",
      "example": "11:00",
      "description": "XM-956: with startTime; the duration is endTime − startTime (422 worklog.end_time_without_start · worklog.end_time_before_start · worklog.end_time_mismatch)."
     },
     "billable": {
      "type": "boolean",
      "description": "F-TIM-02.R13 (XM-956): default true; false removes the entry from billable time."
     }
    }
   },
   "WorklogPatch": {
    "type": "object",
    "additionalProperties": false,
    "minProperties": 1,
    "properties": {
     "workedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "duration": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20
     },
     "note": {
      "oneOf": [
       {
        "type": "string",
        "maxLength": 500
       },
       {
        "type": "null"
       }
      ]
     },
     "startTime": {
      "description": "Set (HH:MM) or clear (null) the start time (F-TIM-02.R12, F-TIM-03.R10); the entry must still end by 24:00.",
      "oneOf": [
       {
        "type": "string",
        "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
       },
       {
        "type": "null"
       }
      ]
     },
     "reason": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "description": "Required for an approver's edit of a submitted sheet."
     },
     "endTime": {
      "type": "string",
      "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$",
      "description": "XM-956: sets the duration to endTime − the start time in force after this patch."
     },
     "billable": {
      "type": "boolean",
      "description": "F-TIM-02.R13 (XM-956)."
     },
     "ticketKey": {
      "type": "string",
      "maxLength": 30,
      "example": "ORB-125",
      "description": "XM-1447 (F-TIM-03.R12): a new subject — the rule of WorklogCreateRequest (exactly one of ticketKey and categoryId)."
     },
     "categoryId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "projectKey": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$",
      "description": "XM-1447: required with a category. A subject in another project moves the entry there (the rights in both projects; audited time.worklog_moved)."
     }
    }
   },
   "WorklogSeriesChangeRequest": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "recurrence"
    ],
    "description": "What every occurrence logs (F-TIM-02.R17; XM-960): the duration, or startTime + endTime, as WorklogCreateRequest; the subject is fixed.",
    "properties": {
     "duration": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20,
      "example": "15m"
     },
     "startTime": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
      "example": "09:30"
     },
     "endTime": {
      "type": "string",
      "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$",
      "example": "09:45"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "billable": {
      "type": "boolean",
      "description": "Default true (F-TIM-02.R13)."
     },
     "recurrence": {
      "$ref": "#/components/schemas/TimeRecurrence"
     }
    }
   },
   "WorklogSeriesCreateRequest": {
    "description": "A new repeat series (F-TIM-02.R17; XM-960): exactly one of ticketKey and categoryId (with projectKey), and the definition.",
    "allOf": [
     {
      "$ref": "#/components/schemas/WorklogSeriesChangeRequest"
     },
     {
      "type": "object",
      "properties": {
       "ticketKey": {
        "type": "string",
        "maxLength": 30,
        "example": "ORB-126"
       },
       "categoryId": {
        "$ref": "#/components/schemas/Uuid"
       },
       "projectKey": {
        "type": "string",
        "pattern": "^[A-Za-z][A-Za-z0-9]{1,9}$",
        "description": "Required with a category."
       }
      }
     }
    ]
   },
   "WorklogSeriesView": {
    "type": "object",
    "required": [
     "id",
     "project",
     "minutes",
     "billable",
     "recurrence",
     "exceptions",
     "skipped",
     "version"
    ],
    "description": "A repeat series of the reader (F-TIM-02.R17; XM-960; the web app TimeSeries). The client writes the label from these fields.",
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "ticket": {
      "$ref": "#/components/schemas/TimeTicketRef"
     },
     "category": {
      "$ref": "#/components/schemas/TimeCategoryRef"
     },
     "minutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440
     },
     "startTime": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
     },
     "endTime": {
      "type": "string",
      "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"
     },
     "billable": {
      "type": "boolean"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "recurrence": {
      "$ref": "#/components/schemas/TimeRecurrence"
     },
     "writtenThrough": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "exceptions": {
      "type": "array",
      "maxItems": 1500,
      "description": "The occurrence dates the member deleted (\"This entry\"), from today − time.seriesHorizonDays on.",
      "items": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     "skipped": {
      "type": "array",
      "maxItems": 1500,
      "description": "The occurrence dates the daily extension could not write (a closed period, a submitted week, the day cap, the overlap rule).",
      "items": {
       "$ref": "#/components/schemas/DateOnly"
      }
     },
     "version": {
      "type": "integer",
      "minimum": 1
     }
    }
   },
   "WorklogView": {
    "type": "object",
    "required": [
     "id",
     "member",
     "project",
     "workedOn",
     "minutes",
     "billable",
     "timesheetId",
     "version",
     "can"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "member": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "loggedBy": {
      "$ref": "#/components/schemas/MemberRef"
     },
     "project": {
      "$ref": "#/components/schemas/TimeProjectRef"
     },
     "billable": {
      "type": "boolean",
      "description": "The entry's billable mark (F-TIM-02.R13). False removes the entry from billable time; true leaves the decision to Finance's BillabilityPolicy."
     },
     "ticket": {
      "$ref": "#/components/schemas/TimeTicketRef"
     },
     "category": {
      "$ref": "#/components/schemas/TimeCategoryRef"
     },
     "workedOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "minutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440
     },
     "startTime": {
      "type": "string",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
      "example": "09:30",
      "description": "The time of day the entry starts on `workedOn` (F-TIM-02.R12), a wall-clock `HH:MM` in the member's day; absent for an entry logged without one (the grid, the week widget). start + minutes ≤ 24:00."
     },
     "endTime": {
      "type": "string",
      "pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$",
      "example": "11:00",
      "description": "XM-956: startTime + minutes; present only with startTime."
     },
     "overlaps": {
      "type": "array",
      "maxItems": 100,
      "description": "F-TIM-02.R14 (XM-956): only on the answer of one entry (a create, an edit or its replay) when time.entryOverlap is warned — the ids of the member's timed entries of that day that this entry overlaps and the reader can see, earliest first.",
      "items": {
       "$ref": "#/components/schemas/Uuid"
      }
     },
     "seriesId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "seriesOn": {
      "$ref": "#/components/schemas/DateOnly"
     },
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "timesheetId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "createdAt": {
      "$ref": "#/components/schemas/Instant"
     },
     "version": {
      "type": "integer",
      "minimum": 1
     },
     "can": {
      "$ref": "#/components/schemas/WorklogCan"
     }
    }
   },
   "WorkspaceSessionDocument": {
    "type": "object",
    "required": [
     "tenant",
     "member",
     "teams",
     "areas",
     "capabilities",
     "navigation",
     "availability",
     "features",
     "realtime",
     "settings",
     "settingsValidUntil"
    ],
    "properties": {
     "tenant": {
      "type": "object",
      "required": [
       "id",
       "slug",
       "name"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "slug": {
        "type": "string",
        "maxLength": 63,
        "example": "northwind"
       },
       "name": {
        "type": "string",
        "maxLength": 120,
        "example": "Northwind Group"
       },
       "status": {
        "type": "string",
        "enum": [
         "active",
         "suspended"
        ]
       }
      }
     },
     "member": {
      "type": "object",
      "required": [
       "id",
       "name",
       "initials",
       "audience",
       "role",
       "isAdmin"
      ],
      "properties": {
       "id": {
        "$ref": "#/components/schemas/Uuid"
       },
       "name": {
        "$ref": "#/components/schemas/PersonName"
       },
       "initials": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2
       },
       "email": {
        "$ref": "#/components/schemas/EmailAddress"
       },
       "jobTitle": {
        "type": "string",
        "maxLength": 80
       },
       "audience": {
        "type": "string",
        "enum": [
         "internal"
        ]
       },
       "role": {
        "$ref": "#/components/schemas/TypedRef"
       },
       "isAdmin": {
        "type": "boolean"
       },
       "defaultProjectKey": {
        "type": "string",
        "pattern": "^[A-Z][A-Z0-9]{1,9}$"
       }
      }
     },
     "teams": {
      "type": "array",
      "maxItems": 100,
      "items": {
       "$ref": "#/components/schemas/WorkspaceTeamRef"
      }
     },
     "defaultTeamId": {
      "$ref": "#/components/schemas/Uuid"
     },
     "impersonation": {
      "description": "The console Owner's impersonation of this session (F-PLT-22; register §230 add. 34), or null for a normal session. The shell shows the banner \"You are acting as <user> — <time left> — Exit\" from it.",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "$ref": "#/components/schemas/ImpersonationState"
       }
      ]
     },
     "areas": {
      "type": "object",
      "required": [
       "workspace",
       "administration",
       "adminSections",
       "portalPreview",
       "platformConsole"
      ],
      "properties": {
       "workspace": {
        "type": "boolean"
       },
       "administration": {
        "type": "boolean"
       },
       "adminSections": {
        "type": "array",
        "description": "The administration sections the running build serves and the member may enter (`administer` ∧ the tenant's availability), in the sidebar order of F-TEN-01.R04; empty without `administer`. `memory` and `finance` show only with the navigation facts `memory-admin` and `finance-admin` (XM-554). A section joins the vocabulary with its feature (the SPA drops keys it does not know).",
        "maxItems": 30,
        "items": {
         "type": "string",
         "maxLength": 40,
         "enum": [
          "overview",
          "members",
          "teams",
          "roles",
          "sharing",
          "projects",
          "integrations",
          "ai",
          "security",
          "audit",
          "time",
          "support-access",
          "custom-fields",
          "automation",
          "relationships",
          "messaging",
          "docs",
          "notifications",
          "memory",
          "finance"
         ]
        }
       },
       "portalPreview": {
        "type": "boolean"
       },
       "platformConsole": {
        "type": "boolean"
       }
      }
     },
     "capabilities": {
      "type": "object",
      "description": "Tenant-level affordances (D-064) — createTicket (in any accessible project), createProject, inviteMembers, administer, exportContacts, shareReports (`share_reports`, F-RPT-03.R04; XM-1267).",
      "additionalProperties": {
       "type": "boolean"
      }
     },
     "navigation": {
      "type": "array",
      "description": "The tenant-level navigation facts that the member holds now (XM-554; F-WSP-01.R02, R04): each one says that the page of one shell entry opens for the member, decided by the page's owner with the gate that authorises the page (access §8 `TenantNavigationSource`). `clients` — Relationships available ∧ `relationships_view`; `documents` — the docs scope is not `none` (the shell also needs `availability.collaborativeDocs`); `reports` — the Reports flag ∧ plan; `finance` — Finance available ∧ a finance capability (F-FIN-01 §6); `finance-admin` — Finance available ∧ `administer`; `finance-cashflow` — Finance available ∧ `view_cashflow` (the Cashflow and Invoices pages, F-FIN-16 §6); `memory-admin` — memory's flag ∧ plan ∧ `administer` on Projects & boards. An absent fact hides its entry (fail closed). An affordance only — the server decides every request again (R09). The SPA drops a value it does not know.",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
       "$ref": "#/components/schemas/TenantNavigationFactKey"
      }
     },
     "timesheetsAccess": {
      "description": "The Team timesheets right (XM-946; register §225 item 3, add. 1; access §8 `TimesheetRightsQuery`): null when the role does not hold `view_team_timesheets`; otherwise its scope, the team ids it reaches (the member's own teams, or the selected teams; empty for `all`) and whether the member may close and reopen logging periods (`close_logging_periods`, XM-947). An affordance only (R09).",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "type": "object",
        "required": [
         "scope",
         "teamIds",
         "closePeriods"
        ],
        "additionalProperties": false,
        "properties": {
         "scope": {
          "$ref": "#/components/schemas/TimesheetScopeKey"
         },
         "teamIds": {
          "type": "array",
          "maxItems": 200,
          "uniqueItems": true,
          "items": {
           "$ref": "#/components/schemas/Uuid"
          }
         },
         "closePeriods": {
          "type": "boolean"
         }
        }
       }
      ]
     },
     "logOnBehalfAccess": {
      "description": "The right \"Log time on behalf of others\" (XM-959; register §225 add. 3): null when the role does not hold `log_time_on_behalf`; otherwise its scope and the team ids it reaches (empty for `all`). Not null = the Log time dialog shows \"For\". An affordance only (R09).",
      "oneOf": [
       {
        "type": "null"
       },
       {
        "type": "object",
        "required": [
         "scope",
         "teamIds"
        ],
        "additionalProperties": false,
        "properties": {
         "scope": {
          "$ref": "#/components/schemas/TimesheetScopeKey"
         },
         "teamIds": {
          "type": "array",
          "maxItems": 200,
          "uniqueItems": true,
          "items": {
           "$ref": "#/components/schemas/Uuid"
          }
         }
        }
       }
      ]
     },
     "availability": {
      "type": "object",
      "description": "Feature availability at tenant level (flag ∧ plan) — clientPortal, projectChat, messaging, relationships, automation, collaborativeDocs, customFields, productDiscovery, timeline, jiraCsvImport, gitConnections. A new key joins this list with its feature (XM-1088 typed the object); the SPA keeps a key it does not know and reads a missing key as unavailable.",
      "required": [
       "clientPortal",
       "projectChat",
       "messaging",
       "relationships",
       "automation",
       "collaborativeDocs",
       "customFields",
       "productDiscovery",
       "timeline",
       "jiraCsvImport",
       "gitConnections"
      ],
      "properties": {
       "clientPortal": {
        "type": "boolean"
       },
       "projectChat": {
        "type": "boolean"
       },
       "messaging": {
        "type": "boolean"
       },
       "relationships": {
        "type": "boolean"
       },
       "automation": {
        "type": "boolean"
       },
       "collaborativeDocs": {
        "type": "boolean"
       },
       "customFields": {
        "type": "boolean"
       },
       "productDiscovery": {
        "type": "boolean"
       },
       "timeline": {
        "type": "boolean"
       },
       "jiraCsvImport": {
        "type": "boolean",
        "description": "The Jira CSV import (XM-1088; F-INT-09, F-PLT-15): true only while the global `jira_csv_import` beta flag is on and the member holds `administer` on Administration › Integrations — the rule that authorises the import's requests. False for a member without that right, the same answer as an off or unset flag (hidden ≡ missing). Administration › Integrations and the backlog's \"Import from Jira\" entry (XM-1204) show the import only while it is true. An affordance only — the server decides every import request again (R09)."
       },
       "gitConnections": {
        "type": "boolean",
        "description": "Git repository connections (G421; F-INT-02, F-INT-03, F-PLT-15; owner, 3 Dec 2026: \"Jira import on, git - off.\"): true only while the global `git_connections` flag is on. The flag is off at the start. While it is false, Administration › Integrations shows the Connect repository controls as not available. An affordance only — the server refuses the token check, connect and webhook intake with `403 feature.unavailable` (`reason: flag`) while the flag is off."
       }
      },
      "additionalProperties": false
     },
     "features": {
      "description": "XM-1331 (F-PLT-15.R13): the console feature switches the signed-in account may see — the rail areas, sidebar sections and pages, the features (F- IDs) and the F-PLT-15 flags — never a console or portal key (XM-1356). Every menu and page of the workspace, administration, account and project shells shows an item only while its key is in the list (hidden ≡ missing). Platform's `FeatureSwitchQuery` answers it; an affordance only (R09): a switched-off feature is NOT refused by the API until XM-1333.",
      "allOf": [
       {
        "$ref": "#/components/schemas/VisibleFeatureList"
       }
      ]
     },
     "realtime": {
      "type": "object",
      "required": [
       "key",
       "host",
       "port",
       "scheme"
      ],
      "properties": {
       "key": {
        "type": "string",
        "maxLength": 64
       },
       "host": {
        "type": "string",
        "maxLength": 200
       },
       "port": {
        "type": "integer",
        "minimum": 1,
        "maximum": 65535
       },
       "scheme": {
        "type": "string",
        "enum": [
         "wss",
         "ws"
        ],
        "description": "`wss` in every deployed environment; `ws` only for the local Reverb (12-operations §10.4). Derived from the deployment configuration (`REVERB_SCHEME`), never from the request (CG-15)."
       }
      }
     },
     "viewAsClient": {
      "type": "object",
      "properties": {
       "projectId": {
        "description": "Names the client channel the preview subscribes to (F-POR-01.R09; 08 §6.2).",
        "allOf": [
         {
          "$ref": "#/components/schemas/Uuid"
         }
        ]
       },
       "projectKey": {
        "type": "string",
        "maxLength": 10
       },
       "roleName": {
        "type": "string",
        "maxLength": 80
       },
       "until": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "support": {
      "type": "object",
      "description": "For an operator under a support grant — the granted section and its end.",
      "properties": {
       "section": {
        "type": "string",
        "maxLength": 40
       },
       "until": {
        "$ref": "#/components/schemas/Instant"
       }
      }
     },
     "tutorialEnabled": {
      "type": "boolean"
     },
     "settings": {
      "type": "object",
      "description": "Effective values of the keys the registry marks for the SPA (timesheet week start, comment edit window, the tour switch, the help centre's address).",
      "properties": {
       "workspace.helpCentreUrl": {
        "description": "The help centre's https address that the account menu's \"Help & docs\" opens (F-WSP-11.R01; owner, register §230 add. 101 Q4): the platform setting `workspace.helpCentreUrl` that an Owner sets on the console (group `help`). Null while it is not set; the item then shows \"Not connected yet\". It carries no tenant or user data.",
        "type": [
         "string",
         "null"
        ],
        "maxLength": 300,
        "pattern": "^https://",
        "example": "https://help.example.com/"
       }
      },
      "additionalProperties": true
     },
     "settingsValidUntil": {
      "$ref": "#/components/schemas/Instant"
     }
    }
   },
   "WorkspaceTeamRef": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "$ref": "#/components/schemas/Uuid"
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "example": "Product team"
     }
    }
   },
   "YearMonth": {
    "type": "string",
    "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$",
    "example": "2026-11"
   }
  },
  "securitySchemes": {
   "agentToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "The service token of an agent identity (prefix kanso_agt_; F-IDN-28). It acts only as its identity, within its owner's current access, never as a person, and only on operations that declare x-principal: agent_identity."
   },
   "personalAccessToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "Sanctum personal access token of one member of one tenant, narrowed by abilities (05-api.md §8.2)."
   },
   "serviceToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "The service token of a help-desk connection (prefix kanso_hdt_; F-IDN-27). It acts only as its connection, never as a person, and only on operations that declare x-principal: help_desk_connection (CFL-538)."
   },
   "spaSession": {
    "type": "apiKey",
    "in": "cookie",
    "name": "__Host-kanso_session",
    "description": "Sanctum stateful SPA session on app.<apex>; unsafe methods also need X-XSRF-TOKEN (05-api.md §8.1). The XSRF-TOKEN cookie changes at sign-in, at a step-up, at a re-authentication, at a password change, at the exit grant of a suspended tenant and at sign-out, and the response of that step sets the new cookie: read it at each call (06-identity-and-sessions.md §3.2, §6.6; XM-529). Local development uses the cookie name kanso_session."
   }
  }
 }
}
