{
  "openapi": "3.1.0",
  "info": {
    "title": "Clams API",
    "description": "Bitcoin accounting API — manage connections, journals, metadata, reports and more.\n## Authentication\nMost endpoints require `Authorization: Bearer <token>` (JWT access token).\n- Auth quickstart: [authentication.md](../auth/authentication.md)\n- Auth API (Swagger UI): [docs](../auth/)\n- Auth OpenAPI JSON: [openapi.json](../auth/openapi.json)\nBasic flow: login in browser, exchange the `aud=svc` token for an audience-scoped access token + refresh token, then refresh as needed.",
    "license": {
      "name": ""
    },
    "version": "0.1.0"
  },
  "paths": {
    "/v1/feedback": {
      "post": {
        "tags": [
          "Feedback"
        ],
        "operationId": "submit_feedback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitFeedbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Feedback accepted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v1/notifications/stream": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "operationId": "notification_stream_docs",
        "parameters": [
          {
            "name": "operation_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OperationId"
            },
            "example": "01890bfa-1111-7000-8000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "Server-sent notification stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationEvent"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too many streams",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "501": {
            "description": "Notifications unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/operations/{operation_id}": {
      "get": {
        "tags": [
          "Operations"
        ],
        "operationId": "get_operation",
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/OperationId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Operation not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/operations/{operation_id}/cancel": {
      "post": {
        "tags": [
          "Operations"
        ],
        "operationId": "cancel_operation",
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/OperationId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "204": {
            "description": "Operation canceled",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Operation not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/profiles": {
      "get": {
        "tags": [
          "Profiles"
        ],
        "operationId": "list_profiles_for_subject",
        "responses": {
          "200": {
            "description": "Profiles for subject",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProfileRecord"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/profiles/resolve": {
      "get": {
        "tags": [
          "Profiles"
        ],
        "operationId": "resolve_profile_scope",
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved profile scope",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileScope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/user-settings": {
      "get": {
        "tags": [
          "Settings"
        ],
        "operationId": "get_user_settings",
        "responses": {
          "200": {
            "description": "User settings",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettings"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "operationId": "set_user_settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "User settings updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettings"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspace-invites/accept": {
      "post": {
        "tags": [
          "Workspace Invites"
        ],
        "operationId": "accept_workspace_invite",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptWorkspaceInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Invite accepted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptWorkspaceInviteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Invite not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspace-invites/{invite_id}": {
      "delete": {
        "tags": [
          "Workspace Invites"
        ],
        "operationId": "revoke_workspace_invite",
        "parameters": [
          {
            "name": "invite_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceInviteId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "204": {
            "description": "Invite revoked",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Invite not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "operationId": "list_workspaces",
        "responses": {
          "200": {
            "description": "Workspace list",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceRecord"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Workspaces"
        ],
        "operationId": "create_workspace",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Workspace created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "operationId": "get_workspace",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Workspace not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Delete a workspace",
        "description": "Deletes a workspace and performs best-effort cleanup of related profiles, memberships, invites, settings, and storage.",
        "operationId": "delete_workspace",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "204": {
            "description": "Workspace deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Workspace not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/invites": {
      "get": {
        "tags": [
          "Workspace Invites"
        ],
        "operationId": "list_workspace_invites",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace invites page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_WorkspaceInviteView"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Workspace Invites"
        ],
        "operationId": "create_workspace_invite",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Invite created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceInviteView"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/members": {
      "get": {
        "tags": [
          "Workspace Members"
        ],
        "operationId": "list_workspace_members",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace members page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_WorkspaceMemberView"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/members/{member_subject_id}": {
      "put": {
        "tags": [
          "Workspace Members"
        ],
        "operationId": "set_workspace_member_access",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "member_subject_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SubjectId"
            },
            "example": "00000000-0000-5000-8000-000000000000"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetWorkspaceMemberAccessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workspace member updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceMemberView"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Member not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Workspace Members"
        ],
        "operationId": "remove_workspace_member",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "member_subject_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SubjectId"
            },
            "example": "00000000-0000-5000-8000-000000000000"
          }
        ],
        "responses": {
          "204": {
            "description": "Workspace member removed",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Member not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles": {
      "post": {
        "tags": [
          "Profiles"
        ],
        "operationId": "create_profile",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProfileBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Profile created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/setup": {
      "post": {
        "tags": [
          "Profiles"
        ],
        "operationId": "setup_profile",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileSetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Profile created with settings",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}": {
      "get": {
        "tags": [
          "Profiles"
        ],
        "operationId": "get_profile",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Profile record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Profiles"
        ],
        "summary": "Delete a profile",
        "description": "Deletes a profile and performs best-effort cleanup of related memberships, invites, settings, and storage.",
        "operationId": "delete_profile",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "204": {
            "description": "Profile deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Profiles"
        ],
        "summary": "Update a profile label",
        "description": "Use this endpoint for label-only edits. Clients that need to change both the label and profile settings in one serialized backend mutation should call `/v1/workspaces/{workspace_id}/profiles/{profile_id}/updates` instead.",
        "operationId": "update_profile_label",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Profile updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/accounts": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "operationId": "list_accounts",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_AccountRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "operationId": "create_account",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Account created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/accounts/{account_id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "operationId": "get_account",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Account record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Account not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Accounts"
        ],
        "operationId": "delete_account",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Account deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Account not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Accounts"
        ],
        "operationId": "update_account",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Account updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Account not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/assets": {
      "get": {
        "tags": [
          "Assets"
        ],
        "operationId": "list_assets",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Asset list",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AssetRecord"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections": {
      "get": {
        "tags": [
          "Connections"
        ],
        "operationId": "list_connections",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connections page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_ConnectionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Connections"
        ],
        "operationId": "create_connection",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Connection created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "412": {
            "description": "Precondition failed",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/kinds": {
      "get": {
        "tags": [
          "Connections"
        ],
        "operationId": "list_connection_kinds",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Connection kinds",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConnectionKind"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/kinds/{kind}/validate": {
      "post": {
        "tags": [
          "Connections"
        ],
        "operationId": "validate_connection_config",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateConfigBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Configuration validated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NormalizedConfigurationBody"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/resolve": {
      "get": {
        "tags": [
          "Connections"
        ],
        "operationId": "resolve_connection_id",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "label",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved connection id",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveConnectionBody"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/sync": {
      "post": {
        "tags": [
          "Operations"
        ],
        "operationId": "start_sync_all_connections",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "connection_sync_timeout_secs",
            "in": "query",
            "description": "Override per-connection timeout in seconds for this sync operation.\nWhen omitted, the engine uses its configured default timeout.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "sync_parallelism",
            "in": "query",
            "description": "Override bulk sync parallelism for this operation.\nValid values are >=1 and must not exceed the engine's configured maximum.\nWhen omitted, the engine default is used.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Sync started",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Sync already running",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many active sync operations queued",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/{connection_id}": {
      "delete": {
        "tags": [
          "Connections"
        ],
        "operationId": "delete_connection",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "204": {
            "description": "Connection deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Connections"
        ],
        "operationId": "update_connection",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateConnectionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Connection updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/{connection_id}/imports/csv": {
      "post": {
        "tags": [
          "Connections"
        ],
        "operationId": "import_connection_csv",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CsvImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "CSV import accepted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionCsvImportResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/{connection_id}/imports/json": {
      "post": {
        "tags": [
          "Connections"
        ],
        "operationId": "import_connection_json",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportJsonBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Connection data imported",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/connections/{connection_id}/sync": {
      "post": {
        "tags": [
          "Operations"
        ],
        "operationId": "start_sync_connection",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "connection_sync_timeout_secs",
            "in": "query",
            "description": "Override per-connection timeout in seconds for this sync operation.\nWhen omitted, the engine uses its configured default timeout.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Sync started",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Sync already running",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too many active sync operations queued",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/journals/events": {
      "get": {
        "tags": [
          "Journals"
        ],
        "operationId": "list_journal_events",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 10
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Optional start timestamp in RFC3339.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Optional end timestamp in RFC3339.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_kind",
            "in": "query",
            "description": "Optional journal event kind filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag_id",
            "in": "query",
            "description": "Optional tag identifiers (repeatable).",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "note_contains",
            "in": "query",
            "description": "Optional case-insensitive note substring.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "description": "Optional account identifier filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection_id",
            "in": "query",
            "description": "Optional connection identifier filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Journal event list page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_JournalEventListItem"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/journals/events/{event_id}": {
      "get": {
        "tags": [
          "Journals"
        ],
        "operationId": "get_event_details",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "description": "Event identifier present in the journals snapshot.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "evt-123"
          }
        ],
        "responses": {
          "200": {
            "description": "Journal event details",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalEventDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Journal event not found in latest snapshot (or canonical record missing)",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/journals/process": {
      "post": {
        "tags": [
          "Journals"
        ],
        "operationId": "process_journal",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Journal processed",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalRunOutcome"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/journals/quarantine-resolutions": {
      "get": {
        "tags": [
          "Journals"
        ],
        "operationId": "list_quarantine_resolutions",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quarantine resolutions page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalQuarantineResolutionPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/journals/quarantines": {
      "get": {
        "tags": [
          "Journals"
        ],
        "operationId": "list_quarantines",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Journal quarantines page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalQuarantinePage"
                }
              }
            }
          },
          "204": {
            "description": "No journals run exists yet",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/journals/quarantines/{event_kind}/{event_id}": {
      "get": {
        "tags": [
          "Journals"
        ],
        "operationId": "get_quarantine_event",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "transaction"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "tx-123"
          }
        ],
        "responses": {
          "200": {
            "description": "Single journal quarantine event",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalQuarantineEvent"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Quarantine event not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/journals/quarantines/{event_kind}/{event_id}/resolution": {
      "put": {
        "tags": [
          "Journals"
        ],
        "operationId": "put_quarantine_resolution",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "transaction"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "tx-123"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetJournalQuarantineResolutionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Quarantine resolution upserted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JournalQuarantineResolutionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Quarantine event not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Journals"
        ],
        "operationId": "delete_quarantine_resolution",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "transaction"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "tx-123"
          }
        ],
        "responses": {
          "204": {
            "description": "Quarantine resolution deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "operationId": "list_metadata",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataPage_MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Metadata"
        ],
        "operationId": "create_metadata",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetadataCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Metadata record created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "operationId": "get_metadata",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Metadata"
        ],
        "operationId": "update_metadata",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetadataUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Metadata record updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "operationId": "delete_metadata",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata record deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}/adjustments": {
      "post": {
        "tags": [
          "Metadata"
        ],
        "operationId": "add_metadata_adjustment",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMetadataAdjustment"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Metadata adjustment added",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}/adjustments/{entry_signature}": {
      "delete": {
        "tags": [
          "Metadata"
        ],
        "operationId": "remove_metadata_adjustment",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry_signature",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata adjustment removed",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}/btc-fiat-override": {
      "put": {
        "tags": [
          "Metadata"
        ],
        "operationId": "set_metadata_btc_fiat_override",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetMetadataBtcFiatOverride"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Metadata BTC-fiat override set",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}/btc-fiat-rate": {
      "put": {
        "tags": [
          "Metadata"
        ],
        "operationId": "set_metadata_btc_fiat_rate",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetMetadataBtcFiatRate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Metadata BTC-fiat rate set",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "operationId": "clear_metadata_btc_fiat_rate",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata BTC-fiat rate cleared",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}/excluded": {
      "put": {
        "tags": [
          "Metadata"
        ],
        "operationId": "set_metadata_excluded",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetMetadataExcluded"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Metadata excluded flag set",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}/note": {
      "put": {
        "tags": [
          "Metadata"
        ],
        "operationId": "set_metadata_note",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetMetadataNote"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Metadata note set",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "operationId": "clear_metadata_note",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata note cleared",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/records/{event_id}/tags/{tag_id}": {
      "post": {
        "tags": [
          "Metadata"
        ],
        "operationId": "add_metadata_tag",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TagId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata tag added",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "operationId": "remove_metadata_tag",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TagId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata tag removed",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Metadata record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/tags": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "operationId": "list_tags",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metadata tags page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Tag"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Metadata"
        ],
        "operationId": "create_tag",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Tag created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tag"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/metadata/tags/{tag_id}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "operationId": "get_tag",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TagId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Tag record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tag"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Metadata"
        ],
        "operationId": "delete_tag",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TagId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Tag deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Metadata"
        ],
        "operationId": "update_tag",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "tag_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TagId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tag updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tag"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/onchain/sources": {
      "get": {
        "tags": [
          "Onchain"
        ],
        "operationId": "list_onchain_sources",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Onchain sources page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_OnchainDataSource"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Onchain"
        ],
        "operationId": "create_onchain_source",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertOnchainBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Onchain source created",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnchainDataSource"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/onchain/sources/{onchain_source_id}": {
      "put": {
        "tags": [
          "Onchain"
        ],
        "operationId": "update_onchain_source",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "onchain_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertOnchainBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Onchain source updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnchainDataSource"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Onchain source not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Onchain"
        ],
        "operationId": "delete_onchain_source",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "onchain_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Onchain source deleted",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Onchain source not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Onchain"
        ],
        "operationId": "update_onchain_source_with_input",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "onchain_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnchainUpdateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Onchain source updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnchainDataSource"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Onchain source not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/onchain/sources/{onchain_source_id}/select": {
      "put": {
        "tags": [
          "Onchain"
        ],
        "operationId": "select_onchain_source",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "onchain_source_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Onchain source selected",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Onchain source not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/profile-settings": {
      "get": {
        "tags": [
          "Settings"
        ],
        "operationId": "get_profile_settings",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Profile settings",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileSettings"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Profile settings not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "operationId": "set_profile_settings",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Profile settings updated",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileSettings"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Profile settings not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/channels": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_channels",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Channel records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Channel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/channels/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_channel",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Channel record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Channel"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Channel record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/deposits": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_deposits",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deposit records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Deposit"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/deposits/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_deposit",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deposit record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Deposit"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Deposit record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/forwards": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_forwards",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forward records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Forward"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/forwards/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_forward",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forward record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Forward"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Forward record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/invoices": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_invoices",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/invoices/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_invoice",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Invoice"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Invoice record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/pays": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_pays",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Pay"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/pays/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_pay",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Pay"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Payment record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/trades": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_trades",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trade records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Trade"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/trades/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_trade",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trade record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Trade"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Trade record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/transactions": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_transactions",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Transaction"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/transactions/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_transaction",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Transaction"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Transaction record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/utxos": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_utxos",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          },
          {
            "name": "spent_filter",
            "in": "query",
            "description": "Filter for UTXO spent state when listing records.\nWhen omitted, the default is `all`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UtxoSpentFilter"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Utxo records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Utxo"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/utxos/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_utxo",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Utxo record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Utxo"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Utxo record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/withdrawals": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "list_withdrawals",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connection",
            "in": "query",
            "description": "Optional connection filter (UUID v7) to restrict results to a single connection.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConnectionId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Withdrawal records page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPage_Withdrawal"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/records/withdrawals/{canonical_id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "operationId": "get_withdrawal",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "canonical_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Withdrawal record",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRecord_Withdrawal"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Withdrawal record not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/reports/balance-sheet": {
      "get": {
        "tags": [
          "Reports"
        ],
        "operationId": "balance_sheet",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1
            },
            "example": 100
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Balance sheet report page",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceSheetReportPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/reports/capital-gains": {
      "get": {
        "tags": [
          "Reports"
        ],
        "operationId": "capital_gains_download",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Capital gains CSV export",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "text/csv": {}
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/reports/journal-entries": {
      "get": {
        "tags": [
          "Reports"
        ],
        "operationId": "journal_entries_download",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Journal entries CSV export",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "text/csv": {}
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/reports/portfolio-summary": {
      "get": {
        "tags": [
          "Reports"
        ],
        "operationId": "portfolio_summary",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "responses": {
          "200": {
            "description": "Portfolio summary report",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioSummaryReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspace_id}/profiles/{profile_id}/updates": {
      "patch": {
        "tags": [
          "Profiles"
        ],
        "summary": "Update a profile label and settings under one mutation lock",
        "description": "Use this endpoint when a caller needs the label change and settings patch application to be serialized under the same profile mutation lock. The server applies the patch against the current stored settings while holding that lock, preventing stale client snapshots from overwriting concurrent profile-settings mutations.",
        "operationId": "update_profile_with_settings",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/WorkspaceId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          },
          {
            "name": "profile_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ProfileId"
            },
            "example": "018f7d3c-5a3b-7c2b-9c8a-cc5a0e2f1a2b"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileWithSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Combined profile update outcome",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProfileWithSettingsResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Profile not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                },
                "description": "Request identifier for correlating logs"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptWorkspaceInviteRequest": {
        "type": "object",
        "description": "Request payload for accepting a workspace invite.",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "Invite token received by the user."
          }
        }
      },
      "AcceptWorkspaceInviteResponse": {
        "type": "object",
        "description": "Response payload returned after accepting a workspace invite.",
        "required": [
          "workspace_id",
          "workspace_label",
          "access",
          "profiles"
        ],
        "properties": {
          "access": {
            "$ref": "#/components/schemas/WorkspaceInviteAccess",
            "description": "Access level granted by the invite."
          },
          "profiles": {
            "$ref": "#/components/schemas/WorkspaceInviteProfiles",
            "description": "Profile selection granted by the invite."
          },
          "workspace_id": {
            "$ref": "#/components/schemas/WorkspaceId",
            "description": "Workspace identifier that was joined."
          },
          "workspace_label": {
            "type": "string",
            "description": "Workspace label for display."
          }
        }
      },
      "AccountAdjustment": {
        "type": "object",
        "description": "Manual account adjustment linked to a metadata record.",
        "required": [
          "entry_signature",
          "account_id",
          "timestamp"
        ],
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Override account identifier."
          },
          "entry_signature": {
            "type": "string",
            "description": "Entry signature from the journals snapshot."
          },
          "timestamp": {
            "type": "string",
            "description": "RFC3339 timestamp for the adjustment."
          }
        }
      },
      "AccountCreate": {
        "type": "object",
        "description": "Account creation request payload.",
        "required": [
          "parent_id",
          "label"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional ASCII description for the new account."
          },
          "label": {
            "type": "string",
            "description": "Human-readable label for the new account."
          },
          "parent_id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Parent identifier under which the new account will be linked."
          }
        }
      },
      "AccountId": {
        "type": "string",
        "format": "uuid",
        "description": "Canonical identifier used for all accounts ensuring UUID v7 semantics."
      },
      "AccountKind": {
        "type": "string",
        "description": "Enumerates the supported account categories aligned with root taxonomy.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted [`AccountRecord`] values.",
        "enum": [
          "assets",
          "liabilities",
          "equity",
          "income",
          "expenses"
        ]
      },
      "AccountRecord": {
        "type": "object",
        "description": "Canonical record representation persisted across all APIs.",
        "required": [
          "id",
          "root_id",
          "role",
          "kind",
          "label",
          "immutable"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional description."
          },
          "id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Unique account identifier."
          },
          "immutable": {
            "type": "boolean",
            "description": "Whether the account is immutable."
          },
          "kind": {
            "$ref": "#/components/schemas/AccountKind",
            "description": "Account category (Assets, Liabilities, etc.)."
          },
          "label": {
            "type": "string",
            "description": "Human-readable label."
          },
          "parent_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AccountId",
                "description": "Parent account identifier (None for root accounts)."
              }
            ]
          },
          "role": {
            "$ref": "#/components/schemas/AccountRole",
            "description": "Account role (Root, Default, Custom)."
          },
          "root_id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Root category account identifier."
          }
        }
      },
      "AccountRole": {
        "type": "string",
        "description": "Enumerates account roles used to derive immutability rules.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted [`AccountRecord`] values.",
        "enum": [
          "root",
          "default",
          "custom"
        ]
      },
      "AccountUpdate": {
        "type": "object",
        "description": "Mutable update payload for an existing account.",
        "properties": {
          "description": {
            "$ref": "#/components/schemas/DescriptionUpdate",
            "description": "Update instructions for the description."
          },
          "label": {
            "$ref": "#/components/schemas/LabelUpdate",
            "description": "Update instructions for the label."
          },
          "parent": {
            "$ref": "#/components/schemas/ParentUpdate",
            "description": "Update instructions for the parent linkage."
          }
        }
      },
      "AddMetadataAdjustment": {
        "type": "object",
        "description": "Request body used to add or replace an account adjustment.",
        "required": [
          "entry_signature",
          "account_id"
        ],
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Override account identifier."
          },
          "entry_signature": {
            "type": "string",
            "description": "Entry signature from the journals snapshot."
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ],
            "description": "RFC3339 timestamp for the adjustment (defaults to now when omitted)."
          }
        }
      },
      "ApiErrorBody": {
        "type": "object",
        "description": "Error payload returned by REST handlers.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable error code for programmatic handling."
          },
          "details": {
            "description": "Optional error details for debugging."
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message."
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional request identifier for support."
          },
          "retry_after_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optional retry hint in seconds.",
            "minimum": 0
          }
        }
      },
      "ArchiveType": {
        "type": "string",
        "description": "Fixed archive type enumeration scoped to replay domains.\nValues follow the naming used throughout the workspace (e.g. `Invoices`, `Pays`).",
        "enum": [
          "Invoices",
          "Pays",
          "Transactions",
          "Utxos",
          "Forwards",
          "OpenChannels",
          "ClosedChannels",
          "Deposits",
          "Withdrawals",
          "Imports"
        ]
      },
      "AssetCode": {
        "type": "string",
        "description": "Enumerates the supported asset codes with canonical uppercase representation.",
        "enum": [
          "Btc",
          "Usd",
          "Eur",
          "Jpy",
          "Gbp",
          "Cny",
          "Aud",
          "Cad",
          "Chf",
          "Hkd",
          "Nzd",
          "Sek",
          "Krw",
          "Sgd",
          "Mxn",
          "Inr",
          "Brl",
          "Nok",
          "Zar",
          "Dkk"
        ]
      },
      "AssetId": {
        "type": "string",
        "format": "uuid",
        "description": "Canonical asset identifier backed by a UUID v7 value."
      },
      "AssetRecord": {
        "type": "object",
        "description": "Canonical asset record exposed by the engine API.",
        "required": [
          "id",
          "code"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/AssetCode",
            "description": "Canonical asset code."
          },
          "id": {
            "$ref": "#/components/schemas/AssetId",
            "description": "Canonical asset identifier (UUID v7)."
          }
        }
      },
      "BalanceSheetAmount": {
        "type": "object",
        "description": "Per asset balance aggregates for a single account or ledger section.",
        "required": [
          "asset_id",
          "asset_code",
          "debit_total",
          "credit_total",
          "net"
        ],
        "properties": {
          "asset_code": {
            "$ref": "#/components/schemas/AssetCode",
            "description": "Canonical asset code (e.g., BTC, USD) for display purposes."
          },
          "asset_id": {
            "$ref": "#/components/schemas/AssetId",
            "description": "Asset in which the balance is denominated."
          },
          "credit_total": {
            "type": "string",
            "description": "Total credits summed from all postings for this asset."
          },
          "debit_total": {
            "type": "string",
            "description": "Total debits summed from all postings for this asset."
          },
          "net": {
            "type": "string",
            "description": "Net balance computed as `debit_total` minus `credit_total`."
          }
        }
      },
      "BalanceSheetIssues": {
        "type": "object",
        "description": "Issues detected while computing the balance sheet.",
        "required": [
          "unknown_account_rows",
          "unknown_account_ids_sample"
        ],
        "properties": {
          "unknown_account_ids_sample": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountId"
            },
            "description": "Sample of offending account identifiers capped at a small fixed size."
          },
          "unknown_account_rows": {
            "type": "integer",
            "description": "Number of journal rows that referenced unknown or deleted accounts.",
            "minimum": 0
          }
        }
      },
      "BalanceSheetReportPage": {
        "type": "object",
        "description": "Paginated balance sheet response with flattened rows.",
        "required": [
          "workspace_id",
          "profile_id",
          "snapshot_path",
          "snapshot_timestamp",
          "non_final",
          "included_kinds",
          "totals",
          "issues",
          "items"
        ],
        "properties": {
          "included_kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountKind"
            },
            "description": "Account kinds that were included when computing this report."
          },
          "issues": {
            "$ref": "#/components/schemas/BalanceSheetIssues",
            "description": "Metadata describing data quality issues encountered during computation."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceSheetRow"
            },
            "description": "Flattened account rows in pre-order traversal."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor token for the next page, when present."
          },
          "non_final": {
            "type": "boolean",
            "description": "Flag indicating whether the underlying snapshot is marked non final."
          },
          "profile_id": {
            "type": "string",
            "format": "uuid",
            "description": "Profile within the workspace."
          },
          "snapshot_path": {
            "type": "string",
            "description": "Path to the underlying journals snapshot file."
          },
          "snapshot_timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp derived from the snapshot path or metadata."
          },
          "totals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceSheetAmount"
            },
            "description": "Per asset totals for the entire ledger given the included kinds."
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid",
            "description": "Workspace that owns the report."
          }
        }
      },
      "BalanceSheetRow": {
        "type": "object",
        "description": "Flattened balance sheet row emitted in pre-order traversal for pagination.",
        "required": [
          "account_id",
          "kind",
          "label",
          "depth",
          "balances"
        ],
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Identifier of the account represented by this row."
          },
          "balances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceSheetAmount"
            },
            "description": "Per asset balances for this account including all postings attributed to it."
          },
          "depth": {
            "type": "integer",
            "description": "Depth in the pre-order traversal where 0 represents a root node.",
            "minimum": 0
          },
          "kind": {
            "$ref": "#/components/schemas/AccountKind",
            "description": "Root category of the account."
          },
          "label": {
            "type": "string",
            "description": "Human readable account label."
          },
          "parent_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AccountId",
                "description": "Optional parent account identifier."
              }
            ]
          }
        }
      },
      "BitcoinRpcArgs": {
        "type": "object",
        "description": "Configuration parameters for Bitcoin Core RPC connections.",
        "required": [
          "url",
          "rpc_cookie"
        ],
        "properties": {
          "rpc_cookie": {
            "type": "string",
            "description": "Path to Bitcoin Core's authentication cookie file."
          },
          "rpc_password": {
            "type": [
              "string",
              "null"
            ],
            "description": "RPC password (alternative to cookie)."
          },
          "rpc_user": {
            "type": [
              "string",
              "null"
            ],
            "description": "RPC username (alternative to cookie)."
          },
          "url": {
            "type": "string",
            "description": "Bitcoin Core RPC endpoint URL (e.g., `<http://localhost:8332>`)."
          }
        }
      },
      "CanonicalPage_Channel": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Channel"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Deposit": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Deposit"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Forward": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Forward"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Invoice": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Invoice"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Pay": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Pay"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Trade": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Trade"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Transaction": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Transaction"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Utxo": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Utxo"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalPage_Withdrawal": {
        "type": "object",
        "description": "Canonical page returned from list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRecord_Withdrawal"
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CanonicalRecord_Channel": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical channel payload that surfaces the funding outpoint for secondary indexing.",
            "required": [
              "id",
              "connection_id",
              "capacity",
              "funding_outpoint",
              "opener"
            ],
            "properties": {
              "anchor_output": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Total anchor output amount attributable to the local node, in sats using the msat 3-decimal encoding."
              },
              "capacity": {
                "type": "string",
                "description": "Total channel capacity in sats (msats encoding, must end with \".000\")."
              },
              "close_to_address": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Address funds will be sent to on channel close (any network/format)."
              },
              "close_type": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ChannelCloseType",
                    "description": "Channel close classification when available."
                  }
                ]
              },
              "closing_tx_hash": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Closing txid (lowercase hex if present)."
              },
              "commitment_type": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CommitmentType",
                    "description": "Commitment type describing script behavior and fee model when known."
                  }
                ]
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Connection that owns this channel (UUID v7, lower-case hyphenated)."
              },
              "funding_outpoint": {
                "type": "string",
                "description": "On-chain funding outpoint in `<txid>:<vout>` format."
              },
              "id": {
                "type": "string",
                "description": "Opaque external channel identifier (typically 8-byte hex string)."
              },
              "is_dual_funded": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Hint indicating whether the channel was established using dual funding."
              },
              "local_contribution": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Local node funding contribution in sats using the msat 3-decimal encoding when known."
              },
              "opener": {
                "type": "boolean",
                "description": "Whether this node initiated the channel opening."
              },
              "pushed": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Amount pushed to counterparty during channel opening."
              },
              "settle_amount": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Final settlement amount owed to user (if channel is closed). For CLN this is sourced from\n`final_to_us_msat` on closed channels, falling back to `to_us_msat` for compatibility."
              }
            }
          }
        }
      },
      "CanonicalRecord_Deposit": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical deposit payload capturing inbound fiat or bitcoin transfers to a custodial wallet.",
            "required": [
              "id",
              "connection_id",
              "timestamp",
              "amount",
              "asset_id"
            ],
            "properties": {
              "amount": {
                "type": "string",
                "description": "Gross amount (btc or fiat) stored in msats (exactly three fractional digits).\nNet custodial impact = amount - fee."
              },
              "asset_id": {
                "$ref": "#/components/schemas/AssetId",
                "description": "Asset identifier derived from the `assets` crate."
              },
              "btc_destination": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "On-chain address or LN payment hash; equality-based secondary index."
              },
              "btc_txid": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional on-chain transaction id (lowercase 64-char hex)."
              },
              "btc_vout": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int32",
                "description": "Optional on-chain output index within the transaction (0..=65535).",
                "minimum": 0
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Connection identifier (UUID v7, lowercase hyphenated)."
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional human-readable description or memo associated with the deposit."
              },
              "fee": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional fee in the same asset using the msat encoding."
              },
              "id": {
                "type": "string",
                "description": "Opaque external identifier from the source system."
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "Event timestamp (seconds since Unix epoch)."
              }
            }
          }
        }
      },
      "CanonicalRecord_Forward": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical routing forward event capturing fees earned for a hop.",
            "required": [
              "id",
              "connection_id",
              "amount",
              "timestamp"
            ],
            "properties": {
              "amount": {
                "type": "string",
                "description": "Routing fee earned (msats encoding)."
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Connection identifier (UUID v7, lowercase hyphenated)."
              },
              "id": {
                "type": "string",
                "description": "Opaque external identifier from the source system."
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "When the forwarding event occurred (seconds since Unix epoch)."
              }
            }
          }
        }
      },
      "CanonicalRecord_Invoice": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical invoice payload representing inbound settlements.",
            "required": [
              "id",
              "connection_id",
              "timestamp",
              "amount"
            ],
            "properties": {
              "amount": {
                "type": "string",
                "description": "Base invoice amount requested from the payer (msats encoding)."
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Connection identifier (UUID v7, lowercase hyphenated)."
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional description or memo provided with the invoice."
              },
              "id": {
                "type": "string",
                "description": "Payment hash or external identifier from the source system."
              },
              "settled_amount": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Actual amount settled across all HTLCs when it differs from the base amount (msats encoding)."
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "Settlement timestamp expressed in whole seconds."
              },
              "zap": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Indicates whether this invoice represents a Nostr zap."
              }
            }
          }
        }
      },
      "CanonicalRecord_Pay": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical payment payload encapsulating Lightning or on-chain spend events.",
            "required": [
              "id",
              "connection_id",
              "timestamp",
              "amount",
              "fee"
            ],
            "properties": {
              "amount": {
                "type": "string",
                "description": "Amount sent excluding fees (msats encoding)."
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Connection identifier (UUID v7, lowercase hyphenated)."
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional description or memo associated with the payment."
              },
              "destination": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Destination node pubkey; 66-character lowercase hex when present."
              },
              "fee": {
                "type": "string",
                "description": "Total routing fees paid (msats encoding)."
              },
              "id": {
                "type": "string",
                "description": "Payment hash or external identifier from the source system."
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "Completion timestamp expressed in whole seconds."
              },
              "zap": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Indicates whether this payment was a Nostr zap."
              }
            }
          }
        }
      },
      "CanonicalRecord_Trade": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical trade execution payload capturing asset conversions and fees.",
            "required": [
              "id",
              "connection_id",
              "timestamp",
              "from_asset_id",
              "from_amount",
              "to_asset_id",
              "to_amount"
            ],
            "properties": {
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Exchange/connection identifier (UUID v7, lowercase hyphenated)."
              },
              "fee_amount": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Fee amount using the msat encoding."
              },
              "fee_asset_id": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AssetId",
                    "description": "Asset used to pay fees, if distinct."
                  }
                ]
              },
              "from_amount": {
                "type": "string",
                "description": "Amount of the \"from\" asset (msats encoding)."
              },
              "from_asset_id": {
                "$ref": "#/components/schemas/AssetId",
                "description": "Asset being sold."
              },
              "id": {
                "type": "string",
                "description": "Opaque trade execution identifier from the source system."
              },
              "order_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional exchange order identifier."
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "Execution timestamp expressed in whole seconds."
              },
              "to_amount": {
                "type": "string",
                "description": "Amount of the \"to\" asset (msats encoding)."
              },
              "to_asset_id": {
                "$ref": "#/components/schemas/AssetId",
                "description": "Asset being bought."
              },
              "trade_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Exchange-specific identifiers."
              }
            }
          }
        }
      },
      "CanonicalRecord_Transaction": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical on-chain transaction capturing confirmed inputs and outputs.",
            "required": [
              "id",
              "connection_id",
              "timestamp",
              "block_height",
              "inputs",
              "outputs"
            ],
            "properties": {
              "block_height": {
                "type": "integer",
                "format": "int32",
                "description": "Confirmed block height where this transaction was included.",
                "minimum": 0
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Wallet/connection that detected this transaction (UUID v7)."
              },
              "id": {
                "type": "string",
                "description": "Transaction txid (lowercase hex on emit)."
              },
              "inputs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OnchainInput"
                },
                "description": "Previous outputs being spent."
              },
              "ln_tx_type": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LnTransactionType",
                    "description": "Lightning transaction classification when available."
                  }
                ]
              },
              "outputs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OnchainOutput"
                },
                "description": "New outputs being created."
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "Confirmation timestamp expressed in whole seconds."
              }
            }
          }
        }
      },
      "CanonicalRecord_Utxo": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical unspent transaction output payload captured by accounting connections.",
            "required": [
              "id",
              "connection_id",
              "amount",
              "address"
            ],
            "properties": {
              "address": {
                "type": "string",
                "description": "Address or script associated with the UTXO (any network/format)."
              },
              "amount": {
                "type": "string",
                "description": "Amount in sats stored using the msat encoding (must end with `.000`)."
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Wallet/connection identifier (UUID v7, lowercase hyphenated)."
              },
              "id": {
                "type": "string",
                "description": "Outpoint formatted as `<txid>:<vout>` and serving as the primary identifier."
              },
              "linked_channel_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Channel identifier this UTXO is associated with when known."
              },
              "origin": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/UtxoOrigin",
                    "description": "Describes how this UTXO entered the wallet when known (sweep, close, etc.)."
                  }
                ]
              }
            }
          }
        }
      },
      "CanonicalRecord_Withdrawal": {
        "type": "object",
        "description": "Canonical record envelope that binds a caller-supplied canonical identifier, the owning\nconnection, ordering metadata, and a typed payload together for serialization.",
        "required": [
          "canonical_id",
          "connection_id",
          "ordering_key",
          "payload"
        ],
        "properties": {
          "canonical_id": {
            "type": "string"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "ordering_key": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "payload": {
            "type": "object",
            "description": "Canonical withdrawal payload capturing outbound fiat or bitcoin transfers from a custodial wallet.",
            "required": [
              "id",
              "connection_id",
              "timestamp",
              "amount",
              "asset_id"
            ],
            "properties": {
              "amount": {
                "type": "string",
                "description": "Amount (btc or fiat) stored using the msat encoding (exactly three fractional digits)."
              },
              "asset_id": {
                "$ref": "#/components/schemas/AssetId",
                "description": "Asset identifier derived from the `assets` crate."
              },
              "btc_destination": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "On-chain address or LN payment hash; equality-based secondary index."
              },
              "btc_txid": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional on-chain transaction id (lowercase 64-char hex)."
              },
              "btc_vout": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int32",
                "description": "Optional on-chain output index within the transaction (0..=65535).",
                "minimum": 0
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "description": "Connection identifier (UUID v7, lowercase hyphenated)."
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional human-readable description or memo associated with the withdrawal."
              },
              "fee": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional fee in the same asset using the msat encoding."
              },
              "id": {
                "type": "string",
                "description": "Opaque external identifier from the source system."
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "Event timestamp expressed in whole seconds."
              }
            }
          }
        }
      },
      "Channel": {
        "type": "object",
        "description": "Canonical channel payload that surfaces the funding outpoint for secondary indexing.",
        "required": [
          "id",
          "connection_id",
          "capacity",
          "funding_outpoint",
          "opener"
        ],
        "properties": {
          "anchor_output": {
            "type": [
              "string",
              "null"
            ],
            "description": "Total anchor output amount attributable to the local node, in sats using the msat 3-decimal encoding."
          },
          "capacity": {
            "type": "string",
            "description": "Total channel capacity in sats (msats encoding, must end with \".000\")."
          },
          "close_to_address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Address funds will be sent to on channel close (any network/format)."
          },
          "close_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ChannelCloseType",
                "description": "Channel close classification when available."
              }
            ]
          },
          "closing_tx_hash": {
            "type": [
              "string",
              "null"
            ],
            "description": "Closing txid (lowercase hex if present)."
          },
          "commitment_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CommitmentType",
                "description": "Commitment type describing script behavior and fee model when known."
              }
            ]
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Connection that owns this channel (UUID v7, lower-case hyphenated)."
          },
          "funding_outpoint": {
            "type": "string",
            "description": "On-chain funding outpoint in `<txid>:<vout>` format."
          },
          "id": {
            "type": "string",
            "description": "Opaque external channel identifier (typically 8-byte hex string)."
          },
          "is_dual_funded": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Hint indicating whether the channel was established using dual funding."
          },
          "local_contribution": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local node funding contribution in sats using the msat 3-decimal encoding when known."
          },
          "opener": {
            "type": "boolean",
            "description": "Whether this node initiated the channel opening."
          },
          "pushed": {
            "type": [
              "string",
              "null"
            ],
            "description": "Amount pushed to counterparty during channel opening."
          },
          "settle_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Final settlement amount owed to user (if channel is closed). For CLN this is sourced from\n`final_to_us_msat` on closed channels, falling back to `to_us_msat` for compatibility."
          }
        }
      },
      "ChannelCloseType": {
        "type": "string",
        "description": "Channel closure classification derived from upstream node semantics.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted canonical channel records.",
        "enum": [
          "mutual",
          "local_force",
          "remote_force",
          "breach",
          "funding_canceled",
          "abandoned",
          "unknown"
        ]
      },
      "CollaborativeMode": {
        "type": "string",
        "description": "Operator-selected mode for collaborative wallet quarantine reconciliation.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted journals state.",
        "enum": [
          "send",
          "transfer"
        ]
      },
      "CommitmentType": {
        "type": "string",
        "description": "Commitment type describing channel script behavior and fee model.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted canonical channel records.",
        "enum": [
          "legacy",
          "static_remote_key",
          "anchors",
          "lease",
          "unknown"
        ]
      },
      "ConnectionCsvImportResult": {
        "type": "object",
        "description": "CSV import response payload including the updated connection record and skipped rows.",
        "required": [
          "connection",
          "skipped_rows"
        ],
        "properties": {
          "connection": {
            "$ref": "#/components/schemas/ConnectionRecord",
            "description": "Updated connection record."
          },
          "skipped_rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CsvImportSkippedRow"
            },
            "description": "Details for rows ignored during the import."
          }
        }
      },
      "ConnectionId": {
        "type": "string",
        "format": "uuid",
        "description": "Connection identifier backed by UUID v7."
      },
      "ConnectionKind": {
        "type": "string",
        "description": "Canonical set of supported connection kinds persisted in connection records.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of existing stored records.",
        "enum": [
          "CoreLn",
          "Lnd",
          "Nwc",
          "XPub",
          "Descriptor",
          "Address",
          "Phoenix",
          "Custom",
          "River"
        ]
      },
      "ConnectionRecord": {
        "type": "object",
        "description": "Domain model persisted to storage.\nConfiguration remains optional to allow manual-only connections.",
        "required": [
          "id",
          "label",
          "kind"
        ],
        "properties": {
          "checkpoint": {
            "type": [
              "string",
              "null"
            ]
          },
          "configuration": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "$ref": "#/components/schemas/ConnectionId"
          },
          "kind": {
            "$ref": "#/components/schemas/ConnectionKind"
          },
          "label": {
            "type": "string"
          },
          "last_sync_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ConnectionSyncFailure": {
        "type": "object",
        "description": "Records a per-connection failure surfaced by [`OperationResult::SyncAllConnections`].",
        "required": [
          "id",
          "label",
          "kind",
          "error_code",
          "reason"
        ],
        "properties": {
          "error_code": {
            "type": "string",
            "description": "Stable string code for the underlying error."
          },
          "id": {
            "$ref": "#/components/schemas/ConnectionId",
            "description": "Connection identifier that failed to sync."
          },
          "kind": {
            "$ref": "#/components/schemas/ConnectionKind",
            "description": "Connection kind."
          },
          "label": {
            "type": "string",
            "description": "Connection label at the time of the sync attempt."
          },
          "reason": {
            "type": "string",
            "description": "Transport-safe, user-facing reason (best-effort redacted)."
          }
        }
      },
      "CreateConnectionBody": {
        "type": "object",
        "description": "Payload for creating a connection.",
        "required": [
          "label",
          "kind"
        ],
        "properties": {
          "configuration": {},
          "kind": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "CreateProfileBody": {
        "type": "object",
        "description": "Payload for creating a profile under a workspace.",
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string"
          }
        }
      },
      "CreateWorkspaceBody": {
        "type": "object",
        "description": "Payload for creating a workspace.",
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string"
          }
        }
      },
      "CreateWorkspaceInviteRequest": {
        "type": "object",
        "description": "Request payload for creating a workspace invite.",
        "required": [
          "invited_email",
          "access",
          "profiles"
        ],
        "properties": {
          "access": {
            "$ref": "#/components/schemas/WorkspaceInviteAccess",
            "description": "Access level granted by the invite."
          },
          "invited_email": {
            "type": "string",
            "description": "Email address the invite should be sent to."
          },
          "profiles": {
            "$ref": "#/components/schemas/WorkspaceInviteProfiles",
            "description": "Profile selection for the invite."
          }
        }
      },
      "CsvImportRequest": {
        "type": "object",
        "description": "Multipart payload for CSV imports.",
        "required": [
          "file"
        ],
        "properties": {
          "content_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional MIME type override."
          },
          "file": {
            "type": "string",
            "description": "CSV file contents."
          },
          "filename": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional filename override."
          }
        }
      },
      "CsvImportSkippedRow": {
        "type": "object",
        "description": "Row metadata for CSV rows skipped during import.",
        "required": [
          "row_idx",
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "description": "Reason the row was skipped during import."
          },
          "row_idx": {
            "type": "integer",
            "format": "int64",
            "description": "1-based data row index from the CSV (header excluded).",
            "minimum": 0
          }
        }
      },
      "DataSourceId": {
        "type": "string",
        "format": "uuid",
        "description": "Strongly typed onchain data source identifier guaranteeing UUID v7 semantics."
      },
      "Deposit": {
        "type": "object",
        "description": "Canonical deposit payload capturing inbound fiat or bitcoin transfers to a custodial wallet.",
        "required": [
          "id",
          "connection_id",
          "timestamp",
          "amount",
          "asset_id"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Gross amount (btc or fiat) stored in msats (exactly three fractional digits).\nNet custodial impact = amount - fee."
          },
          "asset_id": {
            "$ref": "#/components/schemas/AssetId",
            "description": "Asset identifier derived from the `assets` crate."
          },
          "btc_destination": {
            "type": [
              "string",
              "null"
            ],
            "description": "On-chain address or LN payment hash; equality-based secondary index."
          },
          "btc_txid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional on-chain transaction id (lowercase 64-char hex)."
          },
          "btc_vout": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Optional on-chain output index within the transaction (0..=65535).",
            "minimum": 0
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Connection identifier (UUID v7, lowercase hyphenated)."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional human-readable description or memo associated with the deposit."
          },
          "fee": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional fee in the same asset using the msat encoding."
          },
          "id": {
            "type": "string",
            "description": "Opaque external identifier from the source system."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Event timestamp (seconds since Unix epoch)."
          }
        }
      },
      "DescriptionUpdate": {
        "oneOf": [
          {
            "type": "object",
            "description": "Preserve the existing description.",
            "required": [
              "action"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "keep_existing"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Replace the description with the supplied value.",
            "required": [
              "value",
              "action"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "replace"
                ]
              },
              "value": {
                "type": "string",
                "description": "Replace the description with the supplied value."
              }
            }
          },
          {
            "type": "object",
            "description": "Clear the description entirely.",
            "required": [
              "action"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "clear"
                ]
              }
            }
          }
        ],
        "description": "Update strategy for an account description."
      },
      "EngineError": {
        "oneOf": [
          {
            "type": "string",
            "description": "Engine has not been initialized yet.",
            "enum": [
              "NotInitialized"
            ]
          },
          {
            "type": "object",
            "description": "Caller failed authentication or provided invalid credentials.",
            "required": [
              "Unauthenticated"
            ],
            "properties": {
              "Unauthenticated": {
                "type": "string",
                "description": "Caller failed authentication or provided invalid credentials."
              }
            }
          },
          {
            "type": "string",
            "description": "Caller is not authorized to perform the requested operation on the target scope.",
            "enum": [
              "NotAuthorized"
            ]
          },
          {
            "type": "string",
            "description": "Workspace/profile context could not be resolved from inputs or defaults.",
            "enum": [
              "MissingProfileContext"
            ]
          },
          {
            "type": "string",
            "description": "Requested resource does not exist within the caller's permitted scopes.",
            "enum": [
              "NotFound"
            ]
          },
          {
            "type": "string",
            "description": "Request conflicts with existing state.",
            "enum": [
              "Conflict"
            ]
          },
          {
            "type": "object",
            "description": "Request conflicts with existing state with a user-facing reason.",
            "required": [
              "ConflictWithReason"
            ],
            "properties": {
              "ConflictWithReason": {
                "type": "string",
                "description": "Request conflicts with existing state with a user-facing reason."
              }
            }
          },
          {
            "type": "object",
            "description": "Request exceeded rate limits.",
            "required": [
              "RateLimited"
            ],
            "properties": {
              "RateLimited": {
                "type": "string",
                "description": "Request exceeded rate limits."
              }
            }
          },
          {
            "type": "object",
            "description": "Request failed a precondition check.",
            "required": [
              "PreconditionFailed"
            ],
            "properties": {
              "PreconditionFailed": {
                "type": "string",
                "description": "Request failed a precondition check."
              }
            }
          },
          {
            "type": "object",
            "description": "Connection configuration is invalid or incomplete.",
            "required": [
              "InvalidConnectionConfig"
            ],
            "properties": {
              "InvalidConnectionConfig": {
                "type": "string",
                "description": "Connection configuration is invalid or incomplete."
              }
            }
          },
          {
            "type": "object",
            "description": "Onchain source configuration is invalid or incomplete.",
            "required": [
              "InvalidOnchainSource"
            ],
            "properties": {
              "InvalidOnchainSource": {
                "type": "string",
                "description": "Onchain source configuration is invalid or incomplete."
              }
            }
          },
          {
            "type": "object",
            "description": "Supplied data violates documented invariants or exceeds supported limits.",
            "required": [
              "InvalidInput"
            ],
            "properties": {
              "InvalidInput": {
                "type": "string",
                "description": "Supplied data violates documented invariants or exceeds supported limits."
              }
            }
          },
          {
            "type": "object",
            "description": "Supplied pagination cursor is malformed or incompatible with the target repository.",
            "required": [
              "InvalidCursor"
            ],
            "properties": {
              "InvalidCursor": {
                "type": "string",
                "description": "Supplied pagination cursor is malformed or incompatible with the target repository."
              }
            }
          },
          {
            "type": "object",
            "description": "Unexpected internal error surfaced from core services or storage.\nThe `reason` is intended to be user-facing and must avoid exposing secrets.",
            "required": [
              "Internal"
            ],
            "properties": {
              "Internal": {
                "type": "object",
                "description": "Unexpected internal error surfaced from core services or storage.\nThe `reason` is intended to be user-facing and must avoid exposing secrets.",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "User-facing reason (best-effort redacted).\nWhen deserializing older payloads, `message` is accepted as an alias for backward\ncompatibility."
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "description": "Error code not recognized by this build of the client/server.\nThis exists for forward compatibility: newer servers may return error codes that older\nclients do not understand.",
            "required": [
              "Unknown"
            ],
            "properties": {
              "Unknown": {
                "type": "object",
                "description": "Error code not recognized by this build of the client/server.\nThis exists for forward compatibility: newer servers may return error codes that older\nclients do not understand.",
                "required": [
                  "code",
                  "reason"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Stable string code as returned by the remote peer."
                  },
                  "reason": {
                    "type": "string",
                    "description": "User-facing reason (best-effort redacted)."
                  }
                }
              }
            }
          }
        ],
        "description": "Unified engine error surface shared by local and remote implementations.\nThis error is intentionally transport-stable: variants carry only data that\ncan be serialized and understood by remote clients."
      },
      "EntrySide": {
        "type": "string",
        "description": "Debit or credit marker.",
        "enum": [
          "debit",
          "credit"
        ]
      },
      "FeedbackType": {
        "type": "string",
        "description": "Supported feedback categories for support emails.\n# Examples\n```rust\nuse clams_engine_protocol::feedback::FeedbackType;\nlet kind = FeedbackType::Bug;\nassert_eq!(format!(\"{kind:?}\"), \"Bug\");\n```",
        "enum": [
          "bug",
          "feature",
          "general"
        ]
      },
      "FiatCurrency": {
        "type": "string",
        "description": "Closed set of fiat currency codes accepted by downstream settings and reporting flows.",
        "enum": [
          "USD",
          "EUR",
          "JPY",
          "GBP",
          "CNY",
          "AUD",
          "CAD",
          "CHF",
          "HKD",
          "NZD",
          "SEK",
          "KRW",
          "SGD",
          "MXN",
          "INR",
          "BRL",
          "NOK",
          "ZAR",
          "DKK"
        ]
      },
      "Forward": {
        "type": "object",
        "description": "Canonical routing forward event capturing fees earned for a hop.",
        "required": [
          "id",
          "connection_id",
          "amount",
          "timestamp"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Routing fee earned (msats encoding)."
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Connection identifier (UUID v7, lowercase hyphenated)."
          },
          "id": {
            "type": "string",
            "description": "Opaque external identifier from the source system."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "When the forwarding event occurred (seconds since Unix epoch)."
          }
        }
      },
      "GainsAlgorithm": {
        "type": "string",
        "description": "Enumerates the supported gains accounting algorithms persisted with each settings record.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted settings values.",
        "enum": [
          "FIFO",
          "LIFO",
          "HIFO",
          "LOFO",
          "AVG_COST"
        ]
      },
      "HealthBody": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "ImportJsonBody": {
        "type": "object",
        "description": "Payload for importing connection data from JSON archives.",
        "required": [
          "archive_type",
          "network",
          "data"
        ],
        "properties": {
          "archive_type": {
            "$ref": "#/components/schemas/ArchiveType"
          },
          "data": {},
          "network": {
            "type": "string"
          }
        }
      },
      "Invoice": {
        "type": "object",
        "description": "Canonical invoice payload representing inbound settlements.",
        "required": [
          "id",
          "connection_id",
          "timestamp",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Base invoice amount requested from the payer (msats encoding)."
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Connection identifier (UUID v7, lowercase hyphenated)."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional description or memo provided with the invoice."
          },
          "id": {
            "type": "string",
            "description": "Payment hash or external identifier from the source system."
          },
          "settled_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Actual amount settled across all HTLCs when it differs from the base amount (msats encoding)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Settlement timestamp expressed in whole seconds."
          },
          "zap": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether this invoice represents a Nostr zap."
          }
        }
      },
      "JournalEventBalanceChanges": {
        "type": "object",
        "description": "Summary of BTC balance changes for a journal event.",
        "required": [
          "btc_delta_sats"
        ],
        "properties": {
          "btc_delta_sats": {
            "type": "string",
            "description": "BTC delta in sats using the msat scale (three decimal places)."
          }
        }
      },
      "JournalEventCanonicalRecord": {
        "oneOf": [
          {
            "type": "object",
            "description": "Canonical invoice record.",
            "required": [
              "Invoice"
            ],
            "properties": {
              "Invoice": {
                "$ref": "#/components/schemas/CanonicalRecord_Invoice",
                "description": "Canonical invoice record."
              }
            }
          },
          {
            "type": "object",
            "description": "Canonical payment record.",
            "required": [
              "Pay"
            ],
            "properties": {
              "Pay": {
                "$ref": "#/components/schemas/CanonicalRecord_Pay",
                "description": "Canonical payment record."
              }
            }
          },
          {
            "type": "object",
            "description": "Canonical deposit record.",
            "required": [
              "Deposit"
            ],
            "properties": {
              "Deposit": {
                "$ref": "#/components/schemas/CanonicalRecord_Deposit",
                "description": "Canonical deposit record."
              }
            }
          },
          {
            "type": "object",
            "description": "Canonical withdrawal record.",
            "required": [
              "Withdrawal"
            ],
            "properties": {
              "Withdrawal": {
                "$ref": "#/components/schemas/CanonicalRecord_Withdrawal",
                "description": "Canonical withdrawal record."
              }
            }
          },
          {
            "type": "object",
            "description": "Canonical trade record.",
            "required": [
              "Trade"
            ],
            "properties": {
              "Trade": {
                "$ref": "#/components/schemas/CanonicalRecord_Trade",
                "description": "Canonical trade record."
              }
            }
          },
          {
            "type": "object",
            "description": "Canonical transaction record.",
            "required": [
              "Transaction"
            ],
            "properties": {
              "Transaction": {
                "$ref": "#/components/schemas/CanonicalRecord_Transaction",
                "description": "Canonical transaction record."
              }
            }
          },
          {
            "type": "object",
            "description": "Canonical forward record.",
            "required": [
              "Forward"
            ],
            "properties": {
              "Forward": {
                "$ref": "#/components/schemas/CanonicalRecord_Forward",
                "description": "Canonical forward record."
              }
            }
          }
        ],
        "description": "Canonical record variants associated with journal events."
      },
      "JournalEventDetails": {
        "type": "object",
        "description": "Full journal event detail payload returned by engine APIs.",
        "required": [
          "timestamp",
          "connection_id",
          "connection_label",
          "connections",
          "event_id",
          "event_kind",
          "canonical_record",
          "excluded",
          "tags",
          "entries"
        ],
        "properties": {
          "balance_changes": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JournalEventBalanceChanges",
                "description": "BTC balance changes derived from the journal entries."
              }
            ]
          },
          "canonical_record": {
            "$ref": "#/components/schemas/JournalEventCanonicalRecord",
            "description": "Canonical record associated with the event."
          },
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId",
            "description": "Connection identifier responsible for the event."
          },
          "connection_label": {
            "type": "string",
            "description": "Human-readable connection label."
          },
          "connections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalEventListConnection"
            },
            "description": "All connections associated with the event group."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Canonical description derived from the record payload when available."
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalEventEntry"
            },
            "description": "Journal postings with resolved labels and adjusted account ids."
          },
          "event_id": {
            "type": "string",
            "description": "Event identifier from the journals snapshot."
          },
          "event_kind": {
            "$ref": "#/components/schemas/JournalEventKind",
            "description": "Canonical event kind inferred from the snapshot rows."
          },
          "excluded": {
            "type": "boolean",
            "description": "Whether the event is excluded from reporting."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional metadata note."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "description": "Tags resolved for the metadata record."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Canonical timestamp for the event (UTC)."
          },
          "valuation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JournalEventValuation",
                "description": "Fiat valuation summary when exchange rates are available."
              }
            ]
          }
        }
      },
      "JournalEventEntry": {
        "type": "object",
        "description": "Journal entry enriched with resolved labels and adjusted account identifiers.",
        "required": [
          "entry_signature",
          "account_id",
          "account_label",
          "account_kind",
          "asset_id",
          "asset_code",
          "side",
          "amount_sats",
          "is_fee"
        ],
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Account identifier after applying metadata adjustments."
          },
          "account_kind": {
            "$ref": "#/components/schemas/AccountKind",
            "description": "Account kind associated with the posting."
          },
          "account_label": {
            "type": "string",
            "description": "Human-readable account label."
          },
          "amount_sats": {
            "type": "string",
            "description": "Absolute amount in sats using the msat scale (three decimal places)."
          },
          "asset_code": {
            "$ref": "#/components/schemas/AssetCode",
            "description": "Human-readable asset code."
          },
          "asset_id": {
            "$ref": "#/components/schemas/AssetId",
            "description": "Asset identifier for the posting."
          },
          "entry_signature": {
            "type": "string",
            "description": "Stable per-posting identifier from the journals snapshot."
          },
          "is_fee": {
            "type": "boolean",
            "description": "Whether the posting represents a fee."
          },
          "side": {
            "$ref": "#/components/schemas/EntrySide",
            "description": "Posting side (debit/credit)."
          }
        }
      },
      "JournalEventKind": {
        "type": "string",
        "description": "Supported canonical fund-movement event kinds.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted journals state.",
        "enum": [
          "deposit",
          "forward",
          "invoice",
          "pay",
          "trade",
          "transaction",
          "withdrawal"
        ]
      },
      "JournalEventListAccount": {
        "type": "object",
        "description": "Account summary for journal event list rendering.",
        "required": [
          "account_id",
          "account_label"
        ],
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountId",
            "description": "Account identifier included in the event list row."
          },
          "account_label": {
            "type": "string",
            "description": "Human-readable account label."
          }
        }
      },
      "JournalEventListConnection": {
        "type": "object",
        "description": "Connection summary for journal event list rendering.",
        "required": [
          "connection_id",
          "connection_label"
        ],
        "properties": {
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId",
            "description": "Connection identifier associated with the event."
          },
          "connection_label": {
            "type": "string",
            "description": "Human-readable connection label."
          }
        }
      },
      "JournalEventListItem": {
        "type": "object",
        "description": "Journal event summary row for list endpoints.",
        "required": [
          "timestamp",
          "connections",
          "event_id",
          "event_kind",
          "excluded",
          "tags",
          "accounts"
        ],
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalEventListAccount"
            },
            "description": "Accounts referenced by the event after applying metadata adjustments."
          },
          "connections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalEventListConnection"
            },
            "description": "Connections associated with the event group."
          },
          "event_id": {
            "type": "string",
            "description": "Event identifier from the journals snapshot."
          },
          "event_kind": {
            "$ref": "#/components/schemas/JournalEventKind",
            "description": "Canonical event kind inferred from the snapshot rows."
          },
          "excluded": {
            "type": "boolean",
            "description": "Whether the event is excluded from reporting."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional metadata note."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tag"
            },
            "description": "Tags resolved for the metadata record."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Canonical timestamp for the event (UTC)."
          }
        }
      },
      "JournalEventValuation": {
        "type": "object",
        "description": "Fiat valuation summary derived from BTC delta and exchange rates.",
        "required": [
          "fiat_currency",
          "exchange_rate_at_event",
          "exchange_rate_now",
          "cost_basis_fiat",
          "current_market_value_fiat"
        ],
        "properties": {
          "cost_basis_fiat": {
            "type": "string",
            "description": "Fiat value at the event exchange rate."
          },
          "current_market_value_fiat": {
            "type": "string",
            "description": "Fiat value at the current exchange rate."
          },
          "exchange_rate_at_event": {
            "type": "string",
            "description": "Exchange rate at the event timestamp (fiat per BTC)."
          },
          "exchange_rate_now": {
            "type": "string",
            "description": "Exchange rate at the current timestamp (fiat per BTC)."
          },
          "fiat_currency": {
            "$ref": "#/components/schemas/FiatCurrency",
            "description": "Fiat currency used for valuation."
          },
          "percent_change": {
            "type": [
              "string",
              "null"
            ],
            "description": "Percent change expressed as `(current - cost_basis) / cost_basis`."
          }
        }
      },
      "JournalQuarantineEvent": {
        "type": "object",
        "description": "Quarantined canonical event derived from the latest journals run.",
        "required": [
          "event_id",
          "event_kind",
          "timestamp",
          "reasons",
          "reason_guidance",
          "resolution_status"
        ],
        "properties": {
          "event_id": {
            "type": "string",
            "description": "Canonical fund-movement event identifier."
          },
          "event_kind": {
            "$ref": "#/components/schemas/JournalEventKind",
            "description": "Canonical event kind (invoice, pay, transaction, etc.)."
          },
          "reason_guidance": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JournalQuarantineGuidance"
            },
            "description": "Remediation guidance aligned with `reasons` order."
          },
          "reasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuarantineReason"
            },
            "description": "Stable, de-duplicated quarantine reasons for the event."
          },
          "resolution_status": {
            "$ref": "#/components/schemas/JournalQuarantineResolutionStatus",
            "description": "Status of any persisted resolution attached to this event."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Canonical timestamp for the event (UTC)."
          }
        }
      },
      "JournalQuarantineFlowClass": {
        "type": "string",
        "description": "Guidance flow classification for quarantine remediation.",
        "enum": [
          "manual_reconcile",
          "data_refresh",
          "data_correctness",
          "engine_triage"
        ]
      },
      "JournalQuarantineGuidance": {
        "type": "object",
        "description": "Suggested remediation guidance for a quarantine reason.",
        "required": [
          "flow",
          "suggested_command"
        ],
        "properties": {
          "flow": {
            "$ref": "#/components/schemas/JournalQuarantineFlowClass",
            "description": "Flow class used by CLI/API guidance output."
          },
          "suggested_command": {
            "type": "string",
            "description": "Suggested next command to remediate."
          }
        }
      },
      "JournalQuarantinePage": {
        "type": "object",
        "description": "Page of quarantined journal events for a specific journals run.",
        "required": [
          "run_timestamp",
          "snapshot_path",
          "items"
        ],
        "properties": {
          "items": {
            "$ref": "#/components/schemas/Page_JournalQuarantineEvent",
            "description": "Quarantined events page."
          },
          "run_timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of the journals run that produced this quarantine set."
          },
          "snapshot_path": {
            "type": "string",
            "description": "Snapshot path emitted by the run."
          }
        }
      },
      "JournalQuarantineResolutionPage": {
        "type": "object",
        "description": "Page of persisted quarantine resolutions.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "$ref": "#/components/schemas/Page_JournalQuarantineResolutionRecord",
            "description": "Resolution records page."
          }
        }
      },
      "JournalQuarantineResolutionRecord": {
        "type": "object",
        "description": "Persistent operator reconciliation record keyed by `(event_kind, event_id)`.",
        "required": [
          "event_kind",
          "event_id",
          "fingerprint",
          "strategy",
          "created_at_millis",
          "updated_at_millis"
        ],
        "properties": {
          "created_at_millis": {
            "type": "integer",
            "format": "int64",
            "description": "Creation timestamp in Unix milliseconds."
          },
          "event_id": {
            "type": "string",
            "description": "Canonical event identifier."
          },
          "event_kind": {
            "$ref": "#/components/schemas/JournalEventKind",
            "description": "Canonical event kind."
          },
          "fingerprint": {
            "type": "string",
            "description": "Deterministic fingerprint used to detect stale resolutions."
          },
          "last_applied_run_timestamp_millis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Journals run timestamp where this resolution was last auto-applied."
          },
          "strategy": {
            "$ref": "#/components/schemas/JournalQuarantineResolutionStrategy",
            "description": "Operator-selected reconciliation strategy."
          },
          "updated_at_millis": {
            "type": "integer",
            "format": "int64",
            "description": "Last update timestamp in Unix milliseconds."
          }
        }
      },
      "JournalQuarantineResolutionStatus": {
        "type": "string",
        "description": "Resolution activity state for a quarantined event.",
        "enum": [
          "none",
          "active",
          "stale",
          "applied_last_run"
        ]
      },
      "JournalQuarantineResolutionStrategy": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "fee_sats",
              "mode",
              "type"
            ],
            "properties": {
              "fee_sats": {
                "type": "string",
                "description": "Fee paid by the wallet owner, in sats with fixed scale `3`."
              },
              "mode": {
                "$ref": "#/components/schemas/CollaborativeMode",
                "description": "Collaborative reconciliation mode."
              },
              "type": {
                "type": "string",
                "enum": [
                  "collaborative"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "mode",
              "type"
            ],
            "properties": {
              "mode": {
                "$ref": "#/components/schemas/MissingAddressMode",
                "description": "Missing-address reconciliation mode."
              },
              "type": {
                "type": "string",
                "enum": [
                  "missing_address"
                ]
              }
            }
          }
        ],
        "description": "Persisted strategy describing how a quarantined event should be reconciled."
      },
      "JournalRunOutcome": {
        "type": "object",
        "description": "Summary outcome for a journals run.",
        "required": [
          "snapshot_path",
          "quarantined_events",
          "quarantined_events_unresolved",
          "quarantined_events_resolved",
          "quarantined_event_details",
          "non_final"
        ],
        "properties": {
          "non_final": {
            "type": "boolean",
            "description": "True when at least one quarantine occurred."
          },
          "quarantined_event_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuarantinedEvent"
            },
            "description": "Full detail for each quarantined canonical event for diagnostics."
          },
          "quarantined_events": {
            "type": "integer",
            "description": "Number of canonical events that were quarantined.",
            "minimum": 0
          },
          "quarantined_events_resolved": {
            "type": "integer",
            "description": "Number of quarantined events that were resolved and posted in the run.",
            "minimum": 0
          },
          "quarantined_events_unresolved": {
            "type": "integer",
            "description": "Number of quarantines that remain unresolved for the run.",
            "minimum": 0
          },
          "snapshot_path": {
            "type": "string",
            "description": "Full path to the snapshot written for this run."
          }
        }
      },
      "LabelUpdate": {
        "oneOf": [
          {
            "type": "object",
            "description": "Preserve the existing label.",
            "required": [
              "action"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "keep_existing"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Replace the label with the supplied value.",
            "required": [
              "value",
              "action"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "replace"
                ]
              },
              "value": {
                "type": "string",
                "description": "Replace the label with the supplied value."
              }
            }
          }
        ],
        "description": "Update strategy for an account label."
      },
      "LnTransactionType": {
        "type": "string",
        "description": "Lightning-aware transaction classification used for journal semantics.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted canonical transaction records.",
        "enum": [
          "funding_tx",
          "commitment_tx_local",
          "commitment_tx_remote",
          "closing_tx_mutual",
          "closing_tx_legacy",
          "htlc_timeout_tx",
          "htlc_success_tx",
          "penalty_tx",
          "anchor_spend_tx",
          "sweep_tx"
        ]
      },
      "LogAttachment": {
        "type": "object",
        "description": "Optional gzipped log attachment metadata for bug reports.\n# Examples\n```rust\nuse clams_engine_protocol::feedback::LogAttachment;\nlet attachment = LogAttachment {\nfilename: \"cli.log.gz\".to_owned(),\ncontent_type: \"application/gzip\".to_owned(),\ncontent_base64: \"H4sIAAAAAAAA...\".to_owned(),\ntruncated: true,\noriginal_bytes: 120_000,\nincluded_bytes: 32_000,\n};\nassert!(attachment.truncated);\n```",
        "required": [
          "filename",
          "content_type",
          "content_base64",
          "truncated",
          "original_bytes",
          "included_bytes"
        ],
        "properties": {
          "content_base64": {
            "type": "string",
            "description": "Base64-encoded gzipped log bytes."
          },
          "content_type": {
            "type": "string",
            "description": "MIME content type of the attachment (for example: `application/gzip`)."
          },
          "filename": {
            "type": "string",
            "description": "Filename presented to the email recipient (for example: `cli.log.gz`)."
          },
          "included_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Number of bytes included from the original log file before gzip.",
            "minimum": 0
          },
          "original_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Size of the original log file in bytes.",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean",
            "description": "Whether older log content was truncated before attachment."
          }
        }
      },
      "MetadataBtcFiatOverride": {
        "type": "object",
        "description": "Manual BTC-fiat override attached to metadata.",
        "required": [
          "rate",
          "pair"
        ],
        "properties": {
          "pair": {
            "type": "string",
            "description": "BTC-fiat pair identifying denomination (for example `BTC-USD`)."
          },
          "rate": {
            "type": "string",
            "description": "BTC-fiat rate quoted as fiat per 1 BTC."
          }
        }
      },
      "MetadataCreate": {
        "type": "object",
        "description": "Payload used to create a metadata record.",
        "required": [
          "event_id",
          "excluded",
          "tag_ids",
          "account_adjustments"
        ],
        "properties": {
          "account_adjustments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountAdjustment"
            },
            "description": "Attached account adjustments."
          },
          "btc_fiat_rate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional manual BTC-fiat override (fiat per 1 BTC)."
          },
          "event_id": {
            "type": "string",
            "description": "Canonical event identifier."
          },
          "excluded": {
            "type": "boolean",
            "description": "Whether the event is excluded from reporting."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional human-authored note."
          },
          "tag_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagId"
            },
            "description": "Attached tag identifiers."
          }
        }
      },
      "MetadataPage_MetadataRecord": {
        "type": "object",
        "description": "Generic page response for metadata list operations.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Metadata record associated with a canonical event.",
              "required": [
                "event_id",
                "excluded",
                "tag_ids",
                "account_adjustments"
              ],
              "properties": {
                "account_adjustments": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccountAdjustment"
                  },
                  "description": "Attached account adjustments."
                },
                "btc_fiat_override": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/MetadataBtcFiatOverride",
                      "description": "Optional manual BTC-fiat override."
                    }
                  ]
                },
                "event_id": {
                  "type": "string",
                  "description": "Canonical event identifier."
                },
                "excluded": {
                  "type": "boolean",
                  "description": "Whether the event is excluded from reporting."
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Optional human-authored note."
                },
                "tag_ids": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TagId"
                  },
                  "description": "Attached tag identifiers."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MetadataRecord": {
        "type": "object",
        "description": "Metadata record associated with a canonical event.",
        "required": [
          "event_id",
          "excluded",
          "tag_ids",
          "account_adjustments"
        ],
        "properties": {
          "account_adjustments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountAdjustment"
            },
            "description": "Attached account adjustments."
          },
          "btc_fiat_override": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MetadataBtcFiatOverride",
                "description": "Optional manual BTC-fiat override."
              }
            ]
          },
          "event_id": {
            "type": "string",
            "description": "Canonical event identifier."
          },
          "excluded": {
            "type": "boolean",
            "description": "Whether the event is excluded from reporting."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional human-authored note."
          },
          "tag_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagId"
            },
            "description": "Attached tag identifiers."
          }
        }
      },
      "MetadataUpdate": {
        "type": "object",
        "description": "Payload used to update a metadata record.",
        "required": [
          "event_id",
          "excluded",
          "tag_ids",
          "account_adjustments"
        ],
        "properties": {
          "account_adjustments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountAdjustment"
            },
            "description": "Attached account adjustments."
          },
          "btc_fiat_rate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional manual BTC-fiat override (fiat per 1 BTC)."
          },
          "event_id": {
            "type": "string",
            "description": "Canonical event identifier."
          },
          "excluded": {
            "type": "boolean",
            "description": "Whether the event is excluded from reporting."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional human-authored note."
          },
          "tag_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagId"
            },
            "description": "Attached tag identifiers."
          }
        }
      },
      "MissingAddressMode": {
        "type": "string",
        "description": "Operator-selected mode for missing-address wallet reconciliation.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted journals state.",
        "enum": [
          "balance_only"
        ]
      },
      "NormalizedConfigurationBody": {
        "type": "object",
        "description": "Response body for normalized connection configurations.",
        "required": [
          "normalized_configuration"
        ],
        "properties": {
          "normalized_configuration": {}
        }
      },
      "NotificationEvent": {
        "type": "object",
        "description": "Notification emitted for a long-running operation.",
        "required": [
          "operation_id",
          "phase",
          "level",
          "message"
        ],
        "properties": {
          "connection_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConnectionId",
                "description": "Connection context when applicable."
              }
            ]
          },
          "level": {
            "$ref": "#/components/schemas/NotificationLevel",
            "description": "Severity level for the event."
          },
          "message": {
            "type": "string",
            "description": "Human-readable message for display."
          },
          "operation_id": {
            "$ref": "#/components/schemas/OperationId",
            "description": "Correlates the notification to an operation."
          },
          "phase": {
            "$ref": "#/components/schemas/NotificationPhase",
            "description": "Lifecycle phase for the event."
          },
          "profile_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileId",
                "description": "Profile scope when available."
              }
            ]
          },
          "progress": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NotificationProgress",
                "description": "Progress payload when available."
              }
            ]
          },
          "workspace_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkspaceId",
                "description": "Workspace scope when available."
              }
            ]
          }
        }
      },
      "NotificationLevel": {
        "type": "string",
        "description": "Severity for a notification event, aligned with tracing levels.",
        "enum": [
          "Trace",
          "Debug",
          "Info",
          "Warn",
          "Error"
        ]
      },
      "NotificationPhase": {
        "type": "string",
        "description": "High-level lifecycle phase for an operation notification.",
        "enum": [
          "Started",
          "Progress",
          "Completed",
          "Failed"
        ]
      },
      "NotificationProgress": {
        "type": "object",
        "description": "Optional progress payload attached to a notification event.",
        "required": [
          "source",
          "scope"
        ],
        "properties": {
          "current": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Completed work units so far (0-based allowed).",
            "minimum": 0
          },
          "phase": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProgressPhase",
                "description": "Current phase of work (for adapter progress)."
              }
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/ProgressScope",
            "description": "Scope of the progress event."
          },
          "source": {
            "$ref": "#/components/schemas/ProgressSource",
            "description": "Origin of the progress event."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Total work units if known.",
            "minimum": 0
          },
          "unit": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProgressUnit",
                "description": "Unit for current/total semantics."
              }
            ]
          }
        }
      },
      "OnchainDataSource": {
        "type": "object",
        "description": "Canonical configuration for Bitcoin onchain data sources.",
        "required": [
          "id",
          "label",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Hyphenated, lowercase UUID v7 string."
          },
          "label": {
            "type": "string",
            "description": "User-visible label for this configuration."
          },
          "source": {
            "$ref": "#/components/schemas/OnchainDataSourceType",
            "description": "Backend source configuration."
          }
        }
      },
      "OnchainDataSourceType": {
        "oneOf": [
          {
            "type": "object",
            "description": "Direct connection to Bitcoin Core RPC.",
            "required": [
              "BitcoinRpc"
            ],
            "properties": {
              "BitcoinRpc": {
                "$ref": "#/components/schemas/BitcoinRpcArgs",
                "description": "Direct connection to Bitcoin Core RPC."
              }
            }
          },
          {
            "type": "object",
            "description": "Electrum server protocol.",
            "required": [
              "Electrum"
            ],
            "properties": {
              "Electrum": {
                "$ref": "#/components/schemas/String",
                "description": "Electrum server protocol."
              }
            }
          },
          {
            "type": "object",
            "description": "Esplora (block explorer) HTTP API.",
            "required": [
              "Esplora"
            ],
            "properties": {
              "Esplora": {
                "$ref": "#/components/schemas/String",
                "description": "Esplora (block explorer) HTTP API."
              }
            }
          }
        ],
        "description": "Data source variants for on-chain synchronization.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted on-chain source records."
      },
      "OnchainInput": {
        "type": "object",
        "description": "Canonical on-chain transaction input referencing a previous output.",
        "required": [
          "outpoint"
        ],
        "properties": {
          "outpoint": {
            "type": "string",
            "description": "Previous output being spent, formatted as `<txid>:<vout>`."
          }
        }
      },
      "OnchainOutput": {
        "type": "object",
        "description": "Canonical on-chain transaction output capturing destination and amount.",
        "required": [
          "outpoint",
          "amount",
          "address"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Destination address or script (any network/format)."
          },
          "amount": {
            "type": "string",
            "description": "Amount in sats stored using the msat encoding (must end with `.000`)."
          },
          "linked_channel_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Channel identifier this output belongs to when known."
          },
          "outpoint": {
            "type": "string",
            "description": "Unique output identifier in `<txid>:<vout>` format."
          },
          "script_role": {
            "$ref": "#/components/schemas/OnchainScriptRole",
            "description": "Classification of the output script per `LIGHTNING_SPEC.md` §2.6–2.7."
          }
        }
      },
      "OnchainScriptRole": {
        "type": "string",
        "description": "Script classification for Lightning-aware on-chain outputs.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted canonical transaction records.",
        "enum": [
          "funding_output",
          "to_local",
          "to_remote",
          "to_local_anchor",
          "to_remote_anchor",
          "offered_htlc",
          "received_htlc",
          "htlc_timeout",
          "htlc_success",
          "closing_output",
          "wallet",
          "unknown"
        ]
      },
      "OnchainUpdateInput": {
        "type": "object",
        "description": "Onchain update inputs supplied by a caller.",
        "required": [
          "clear_rpc_cookie",
          "clear_rpc_credentials"
        ],
        "properties": {
          "clear_rpc_cookie": {
            "type": "boolean"
          },
          "clear_rpc_credentials": {
            "type": "boolean"
          },
          "kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "rpc_cookie": {
            "type": [
              "string",
              "null"
            ]
          },
          "rpc_password": {
            "type": [
              "string",
              "null"
            ]
          },
          "rpc_user": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OperationId": {
        "type": "string",
        "format": "uuid",
        "description": "Opaque identifier for a long-running engine operation."
      },
      "OperationKind": {
        "type": "string",
        "description": "Enumerates supported long-running operations.",
        "enum": [
          "SyncConnection",
          "SyncAllConnections"
        ]
      },
      "OperationRecord": {
        "type": "object",
        "description": "Operation record persisted in-memory for inspection by callers.",
        "required": [
          "id",
          "kind",
          "status"
        ],
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EngineError",
                "description": "Error payload populated when [`OperationStatus::Failed`] or [`OperationStatus::Canceled`]."
              }
            ]
          },
          "id": {
            "$ref": "#/components/schemas/OperationId",
            "description": "Unique identifier for the operation."
          },
          "kind": {
            "$ref": "#/components/schemas/OperationKind",
            "description": "Operation kind discriminant."
          },
          "result": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OperationResult",
                "description": "Successful result, populated when [`OperationStatus::Succeeded`] or\n[`OperationStatus::SucceededWithFailures`]."
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/OperationStatus",
            "description": "Current lifecycle status."
          }
        }
      },
      "OperationResponse": {
        "type": "object",
        "description": "Operation identifier wrapper for async workflow responses.",
        "required": [
          "operation_id"
        ],
        "properties": {
          "operation_id": {
            "$ref": "#/components/schemas/OperationId"
          }
        }
      },
      "OperationResult": {
        "oneOf": [
          {
            "type": "object",
            "description": "Result of `SyncConnection`.",
            "required": [
              "SyncConnection"
            ],
            "properties": {
              "SyncConnection": {
                "type": "object",
                "description": "Result of `SyncConnection`.",
                "required": [
                  "record"
                ],
                "properties": {
                  "record": {
                    "$ref": "#/components/schemas/ConnectionRecord"
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "description": "Result of `SyncAllConnections`.",
            "required": [
              "SyncAllConnections"
            ],
            "properties": {
              "SyncAllConnections": {
                "type": "object",
                "description": "Result of `SyncAllConnections`.",
                "required": [
                  "records",
                  "failures"
                ],
                "properties": {
                  "failures": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ConnectionSyncFailure"
                    },
                    "description": "Per-connection failures encountered during the bulk sync."
                  },
                  "records": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ConnectionRecord"
                    },
                    "description": "Successfully synced connection records."
                  }
                }
              }
            }
          }
        ],
        "description": "Successful result payloads for long-running operations."
      },
      "OperationStatus": {
        "type": "string",
        "description": "Tracks the lifecycle state of an operation.",
        "enum": [
          "Queued",
          "Running",
          "Succeeded",
          "SucceededWithFailures",
          "Failed",
          "Canceled"
        ]
      },
      "Page_AccountRecord": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Canonical record representation persisted across all APIs.",
              "required": [
                "id",
                "root_id",
                "role",
                "kind",
                "label",
                "immutable"
              ],
              "properties": {
                "description": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Optional description."
                },
                "id": {
                  "$ref": "#/components/schemas/AccountId",
                  "description": "Unique account identifier."
                },
                "immutable": {
                  "type": "boolean",
                  "description": "Whether the account is immutable."
                },
                "kind": {
                  "$ref": "#/components/schemas/AccountKind",
                  "description": "Account category (Assets, Liabilities, etc.)."
                },
                "label": {
                  "type": "string",
                  "description": "Human-readable label."
                },
                "parent_id": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/AccountId",
                      "description": "Parent account identifier (None for root accounts)."
                    }
                  ]
                },
                "role": {
                  "$ref": "#/components/schemas/AccountRole",
                  "description": "Account role (Root, Default, Custom)."
                },
                "root_id": {
                  "$ref": "#/components/schemas/AccountId",
                  "description": "Root category account identifier."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_ConnectionRecord": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Domain model persisted to storage.\nConfiguration remains optional to allow manual-only connections.",
              "required": [
                "id",
                "label",
                "kind"
              ],
              "properties": {
                "checkpoint": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "configuration": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "$ref": "#/components/schemas/ConnectionId"
                },
                "kind": {
                  "$ref": "#/components/schemas/ConnectionKind"
                },
                "label": {
                  "type": "string"
                },
                "last_sync_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_JournalEventListItem": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Journal event summary row for list endpoints.",
              "required": [
                "timestamp",
                "connections",
                "event_id",
                "event_kind",
                "excluded",
                "tags",
                "accounts"
              ],
              "properties": {
                "accounts": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JournalEventListAccount"
                  },
                  "description": "Accounts referenced by the event after applying metadata adjustments."
                },
                "connections": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JournalEventListConnection"
                  },
                  "description": "Connections associated with the event group."
                },
                "event_id": {
                  "type": "string",
                  "description": "Event identifier from the journals snapshot."
                },
                "event_kind": {
                  "$ref": "#/components/schemas/JournalEventKind",
                  "description": "Canonical event kind inferred from the snapshot rows."
                },
                "excluded": {
                  "type": "boolean",
                  "description": "Whether the event is excluded from reporting."
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Optional metadata note."
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Tag"
                  },
                  "description": "Tags resolved for the metadata record."
                },
                "timestamp": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Canonical timestamp for the event (UTC)."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_JournalQuarantineEvent": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Quarantined canonical event derived from the latest journals run.",
              "required": [
                "event_id",
                "event_kind",
                "timestamp",
                "reasons",
                "reason_guidance",
                "resolution_status"
              ],
              "properties": {
                "event_id": {
                  "type": "string",
                  "description": "Canonical fund-movement event identifier."
                },
                "event_kind": {
                  "$ref": "#/components/schemas/JournalEventKind",
                  "description": "Canonical event kind (invoice, pay, transaction, etc.)."
                },
                "reason_guidance": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JournalQuarantineGuidance"
                  },
                  "description": "Remediation guidance aligned with `reasons` order."
                },
                "reasons": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuarantineReason"
                  },
                  "description": "Stable, de-duplicated quarantine reasons for the event."
                },
                "resolution_status": {
                  "$ref": "#/components/schemas/JournalQuarantineResolutionStatus",
                  "description": "Status of any persisted resolution attached to this event."
                },
                "timestamp": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Canonical timestamp for the event (UTC)."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_JournalQuarantineResolutionRecord": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Persistent operator reconciliation record keyed by `(event_kind, event_id)`.",
              "required": [
                "event_kind",
                "event_id",
                "fingerprint",
                "strategy",
                "created_at_millis",
                "updated_at_millis"
              ],
              "properties": {
                "created_at_millis": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Creation timestamp in Unix milliseconds."
                },
                "event_id": {
                  "type": "string",
                  "description": "Canonical event identifier."
                },
                "event_kind": {
                  "$ref": "#/components/schemas/JournalEventKind",
                  "description": "Canonical event kind."
                },
                "fingerprint": {
                  "type": "string",
                  "description": "Deterministic fingerprint used to detect stale resolutions."
                },
                "last_applied_run_timestamp_millis": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64",
                  "description": "Journals run timestamp where this resolution was last auto-applied."
                },
                "strategy": {
                  "$ref": "#/components/schemas/JournalQuarantineResolutionStrategy",
                  "description": "Operator-selected reconciliation strategy."
                },
                "updated_at_millis": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Last update timestamp in Unix milliseconds."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_OnchainDataSource": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Canonical configuration for Bitcoin onchain data sources.",
              "required": [
                "id",
                "label",
                "source"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Hyphenated, lowercase UUID v7 string."
                },
                "label": {
                  "type": "string",
                  "description": "User-visible label for this configuration."
                },
                "source": {
                  "$ref": "#/components/schemas/OnchainDataSourceType",
                  "description": "Backend source configuration."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_Tag": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Tag record returned by metadata APIs.",
              "required": [
                "id",
                "code",
                "label",
                "is_system"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Canonical tag code (lowercase)."
                },
                "id": {
                  "$ref": "#/components/schemas/TagId",
                  "description": "Tag identifier."
                },
                "is_system": {
                  "type": "boolean",
                  "description": "True when the tag is system-managed and immutable."
                },
                "label": {
                  "type": "string",
                  "description": "Display label for the tag."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_WorkspaceInviteView": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "API-safe representation of a workspace invite.",
              "required": [
                "id",
                "workspace_id",
                "invited_email",
                "access",
                "profiles",
                "status",
                "created_at",
                "expires_at"
              ],
              "properties": {
                "access": {
                  "$ref": "#/components/schemas/WorkspaceInviteAccess",
                  "description": "Access level granted by the invite."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Timestamp when the invite was created."
                },
                "expires_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Timestamp when the invite expires."
                },
                "id": {
                  "$ref": "#/components/schemas/WorkspaceInviteId",
                  "description": "Invite identifier."
                },
                "invited_email": {
                  "type": "string",
                  "description": "Normalized invitee email captured for display."
                },
                "profiles": {
                  "$ref": "#/components/schemas/WorkspaceInviteProfiles",
                  "description": "Profile selection bound to the invite."
                },
                "redeemed_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "Timestamp when the invite was redeemed."
                },
                "redeemed_subject_id": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/SubjectId",
                      "description": "Subject that redeemed the invite."
                    }
                  ]
                },
                "revoked_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "Timestamp when the invite was revoked."
                },
                "status": {
                  "$ref": "#/components/schemas/WorkspaceInviteStatus",
                  "description": "Derived status for the invite."
                },
                "workspace_id": {
                  "$ref": "#/components/schemas/WorkspaceId",
                  "description": "Workspace to which the invite grants access."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Page_WorkspaceMemberView": {
        "type": "object",
        "description": "Page response for list operations.\nPagination is cursor-based; callers can pass the returned `next` cursor\nto resume listing after the last item in the current page.",
        "required": [
          "items",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Access policy view for a workspace member.\n# Examples\n```\nuse clams_engine_protocol::{\nSubjectId, WorkspaceInviteAccess, WorkspaceInviteProfiles, WorkspaceMemberView,\n};\nuse uuid::Uuid;\nlet subject_id = SubjectId::from_namespaced(&Uuid::NAMESPACE_URL, b\"member\");\nlet view = WorkspaceMemberView {\nsubject_id,\naccess: WorkspaceInviteAccess::Read,\nprofiles: WorkspaceInviteProfiles::All,\n};\nassert!(matches!(view.access, WorkspaceInviteAccess::Read));\n```",
              "required": [
                "subject_id",
                "access",
                "profiles"
              ],
              "properties": {
                "access": {
                  "$ref": "#/components/schemas/WorkspaceInviteAccess",
                  "description": "Effective access level for the member."
                },
                "profiles": {
                  "$ref": "#/components/schemas/WorkspaceInviteProfiles",
                  "description": "Effective profile selection for the member."
                },
                "subject_id": {
                  "$ref": "#/components/schemas/SubjectId",
                  "description": "Subject identifier for the member."
                }
              }
            }
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ParentUpdate": {
        "oneOf": [
          {
            "type": "object",
            "description": "Preserve the existing parent linkage.",
            "required": [
              "action"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "keep_existing"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Move the account beneath the supplied parent.",
            "required": [
              "value",
              "action"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "move_to"
                ]
              },
              "value": {
                "$ref": "#/components/schemas/AccountId",
                "description": "Move the account beneath the supplied parent."
              }
            }
          }
        ],
        "description": "Update strategy for an account parent."
      },
      "Pay": {
        "type": "object",
        "description": "Canonical payment payload encapsulating Lightning or on-chain spend events.",
        "required": [
          "id",
          "connection_id",
          "timestamp",
          "amount",
          "fee"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount sent excluding fees (msats encoding)."
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Connection identifier (UUID v7, lowercase hyphenated)."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional description or memo associated with the payment."
          },
          "destination": {
            "type": [
              "string",
              "null"
            ],
            "description": "Destination node pubkey; 66-character lowercase hex when present."
          },
          "fee": {
            "type": "string",
            "description": "Total routing fees paid (msats encoding)."
          },
          "id": {
            "type": "string",
            "description": "Payment hash or external identifier from the source system."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Completion timestamp expressed in whole seconds."
          },
          "zap": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Indicates whether this payment was a Nostr zap."
          }
        }
      },
      "PortfolioAssetBalance": {
        "type": "object",
        "description": "Per-asset net position for the portfolio summary (Assets + Liabilities only).",
        "required": [
          "asset_id",
          "asset_code",
          "net"
        ],
        "properties": {
          "asset_code": {
            "$ref": "#/components/schemas/AssetCode"
          },
          "asset_id": {
            "$ref": "#/components/schemas/AssetId"
          },
          "net": {
            "type": "string",
            "description": "Net amount in the asset's native units (msat scale for BTC)."
          }
        }
      },
      "PortfolioBtcCapitalGains": {
        "type": "object",
        "description": "Aggregate BTC capital gains summary for the portfolio.",
        "required": [
          "fiat_currency",
          "algorithm",
          "sale_count",
          "total_quantity_sold",
          "total_proceeds_fiat",
          "total_cost_basis_fiat",
          "realized_gain_fiat",
          "realized_gain_percentage",
          "unrealized_gain_fiat",
          "unrealized_gain_percentage",
          "unrealized_cost_basis_fiat",
          "total_cost_basis_fiat_including_open",
          "total_gain_fiat",
          "disposals",
          "open_lots"
        ],
        "properties": {
          "algorithm": {
            "$ref": "#/components/schemas/GainsAlgorithm"
          },
          "average_cost_basis_fiat_per_btc": {
            "type": [
              "string",
              "null"
            ],
            "description": "Average fiat cost basis per BTC across all BTC acquisitions, including fees.\nRounded to three fractional digits; `None` when no BTC acquisitions exist."
          },
          "disposals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioBtcDisposal"
            }
          },
          "fiat_currency": {
            "$ref": "#/components/schemas/FiatCurrency"
          },
          "open_lots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioBtcLot"
            }
          },
          "realized_gain_fiat": {
            "type": "string"
          },
          "realized_gain_percentage": {
            "type": "string"
          },
          "sale_count": {
            "type": "integer",
            "minimum": 0
          },
          "total_cost_basis_fiat": {
            "type": "string"
          },
          "total_cost_basis_fiat_including_open": {
            "type": "string",
            "description": "Total fiat cost basis (`total_cost_basis_fiat` + `unrealized_cost_basis_fiat`)."
          },
          "total_gain_fiat": {
            "type": "string",
            "description": "Total gain/loss (`realized_gain_fiat` + `unrealized_gain_fiat`)."
          },
          "total_proceeds_fiat": {
            "type": "string"
          },
          "total_quantity_sold": {
            "type": "string",
            "description": "Sum of principal BTC quantities sold or spent across disposals."
          },
          "unrealized_cost_basis_fiat": {
            "type": "string",
            "description": "Sum of fiat cost basis across remaining open lots."
          },
          "unrealized_gain_fiat": {
            "type": "string",
            "description": "Unrealized gain/loss for remaining open lots priced at the snapshot timestamp."
          },
          "unrealized_gain_percentage": {
            "type": "string"
          }
        }
      },
      "PortfolioBtcDisposal": {
        "type": "object",
        "description": "Single BTC disposal processed for capital gains.",
        "required": [
          "event_kind",
          "event_id",
          "timestamp",
          "quantity_disposed",
          "btc_fee_quantity",
          "principal_quantity",
          "proceeds_fiat",
          "cost_basis_fiat",
          "realized_gain_fiat",
          "selections"
        ],
        "properties": {
          "btc_fee_quantity": {
            "type": "string",
            "description": "Estimated BTC-denominated fee quantity inferred from fee entries."
          },
          "cost_basis_fiat": {
            "type": "string",
            "description": "Fiat cost basis for `quantity_disposed` based on selected lots."
          },
          "event_id": {
            "type": "string"
          },
          "event_kind": {
            "$ref": "#/components/schemas/JournalEventKind"
          },
          "principal_quantity": {
            "type": "string",
            "description": "BTC principal quantity sold or spent (`quantity_disposed` - `btc_fee_quantity`, clamped at zero)."
          },
          "proceeds_fiat": {
            "type": "string",
            "description": "Fiat proceeds estimated at spot for `principal_quantity`, net of fiat-denominated fees."
          },
          "quantity_disposed": {
            "type": "string",
            "description": "Total BTC quantity removed from holdings (includes BTC-denominated fees)."
          },
          "realized_gain_fiat": {
            "type": "string",
            "description": "Realized gain/loss (`proceeds_fiat` - `cost_basis_fiat`)."
          },
          "selections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioBtcLotSelection"
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PortfolioBtcLot": {
        "type": "object",
        "description": "Single open BTC lot tracked for capital gains.",
        "required": [
          "lot_id",
          "acquired_at",
          "quantity",
          "cost_basis_fiat"
        ],
        "properties": {
          "acquired_at": {
            "type": "string",
            "format": "date-time",
            "description": "Acquisition timestamp used for deterministic tie-breaking."
          },
          "cost_basis_fiat": {
            "type": "string",
            "description": "Remaining fiat cost basis for this lot in the selected fiat currency."
          },
          "lot_id": {
            "type": "integer",
            "format": "int64",
            "description": "Stable lot identifier for audit trails (deterministic within a run).",
            "minimum": 0
          },
          "quantity": {
            "type": "string",
            "description": "Remaining BTC quantity in sats with msat scale."
          }
        }
      },
      "PortfolioBtcLotSelection": {
        "type": "object",
        "description": "Portion of a BTC lot consumed by a disposal.",
        "required": [
          "lot_id",
          "acquired_at",
          "quantity",
          "cost_basis_fiat"
        ],
        "properties": {
          "acquired_at": {
            "type": "string",
            "format": "date-time"
          },
          "cost_basis_fiat": {
            "type": "string"
          },
          "lot_id": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "quantity": {
            "type": "string"
          }
        }
      },
      "PortfolioBtcValuation": {
        "type": "object",
        "description": "Summarizes portfolio value normalized to BTC.",
        "required": [
          "total_btc",
          "excluded_assets"
        ],
        "properties": {
          "excluded_assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioExcludedAsset"
            }
          },
          "total_btc": {
            "type": "string",
            "description": "Total value expressed in BTC sats with msat scale."
          }
        }
      },
      "PortfolioExcludedAsset": {
        "type": "object",
        "description": "Records an asset excluded from a normalized valuation along with a stable reason string.",
        "required": [
          "asset_id",
          "asset_code",
          "reason"
        ],
        "properties": {
          "asset_code": {
            "$ref": "#/components/schemas/AssetCode"
          },
          "asset_id": {
            "$ref": "#/components/schemas/AssetId"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "PortfolioFiatValuation": {
        "type": "object",
        "description": "Summarizes portfolio value normalized to fiat currency.",
        "required": [
          "fiat_currency",
          "total",
          "excluded_assets"
        ],
        "properties": {
          "excluded_assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioExcludedAsset"
            }
          },
          "fiat_currency": {
            "$ref": "#/components/schemas/FiatCurrency"
          },
          "total": {
            "type": "string",
            "description": "Total value in the selected fiat currency with three fractional digits."
          }
        }
      },
      "PortfolioSummaryReport": {
        "type": "object",
        "description": "Portfolio summary report aggregating balances, valuations, and BTC capital gains.",
        "required": [
          "workspace_id",
          "profile_id",
          "snapshot_path",
          "snapshot_timestamp",
          "non_final",
          "included_kinds",
          "balances",
          "fiat_valuation",
          "btc_valuation",
          "btc_balance",
          "btc_capital_gains"
        ],
        "properties": {
          "balances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioAssetBalance"
            },
            "description": "Net positions per asset (Assets + Liabilities)."
          },
          "btc_balance": {
            "type": "string",
            "description": "Net BTC position (Assets + Liabilities) expressed in sats with msat scale."
          },
          "btc_balance_fiat": {
            "type": [
              "string",
              "null"
            ],
            "description": "`btc_balance` valued in the selected fiat when BTC appears in balances."
          },
          "btc_capital_gains": {
            "$ref": "#/components/schemas/PortfolioBtcCapitalGains"
          },
          "btc_valuation": {
            "$ref": "#/components/schemas/PortfolioBtcValuation"
          },
          "fiat_valuation": {
            "$ref": "#/components/schemas/PortfolioFiatValuation"
          },
          "included_kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountKind"
            },
            "description": "Account kinds included in the net position calculation (fixed to Assets and Liabilities)."
          },
          "non_final": {
            "type": "boolean"
          },
          "profile_id": {
            "type": "string",
            "format": "uuid"
          },
          "snapshot_path": {
            "type": "string"
          },
          "snapshot_timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "workspace_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ProfileId": {
        "type": "string",
        "format": "uuid",
        "description": "Unique profile identifier scoped under a parent workspace."
      },
      "ProfileRecord": {
        "type": "object",
        "description": "Canonical profile record nested beneath a workspace.",
        "required": [
          "id",
          "workspace_id",
          "label"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProfileId",
            "description": "Server-assigned UUID v7 identifier for the profile."
          },
          "label": {
            "type": "string",
            "description": "Human-readable label for the profile."
          },
          "workspace_id": {
            "$ref": "#/components/schemas/WorkspaceId",
            "description": "Parent workspace the profile is bound to."
          }
        }
      },
      "ProfileScope": {
        "type": "object",
        "description": "Explicit profile scope combining workspace and profile identifiers to avoid implicit defaults.",
        "required": [
          "workspace_id",
          "profile_id"
        ],
        "properties": {
          "profile_id": {
            "$ref": "#/components/schemas/ProfileId"
          },
          "workspace_id": {
            "$ref": "#/components/schemas/WorkspaceId"
          }
        }
      },
      "ProfileSettings": {
        "type": "object",
        "description": "Canonical snapshot of persisted settings returned to consumers for the current profile.",
        "required": [
          "fiat_currency",
          "gains_algorithm"
        ],
        "properties": {
          "fiat_currency": {
            "type": "string",
            "description": "Canonical uppercase fiat currency code from `crate::assets::FiatCurrency`."
          },
          "gains_algorithm": {
            "$ref": "#/components/schemas/GainsAlgorithm",
            "description": "Supported capital gains algorithm."
          },
          "onchain_data_source_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DataSourceId",
                "description": "Optional onchain data source identifier."
              }
            ]
          },
          "tor_proxy": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional Tor proxy endpoint string used by callers to route traffic over Tor when configured.\nAbsence disables proxying."
          }
        }
      },
      "ProfileSettingsPatchInput": {
        "type": "object",
        "description": "User-facing patch input for profile settings updates.",
        "properties": {
          "clear_onchain_source_id": {
            "type": "boolean",
            "description": "Clears the current onchain source association.",
            "default": false
          },
          "fiat_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requested fiat currency replacement when provided.",
            "default": null
          },
          "gains_algorithm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requested gains algorithm replacement when provided.",
            "default": null
          },
          "no_tor_proxy": {
            "type": "boolean",
            "description": "Clears the current Tor proxy.",
            "default": false
          },
          "onchain_source_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requested onchain source association when provided.",
            "default": null
          },
          "tor_proxy": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requested Tor proxy replacement when provided.",
            "default": null
          }
        },
        "additionalProperties": false
      },
      "ProfileSetupRequest": {
        "type": "object",
        "description": "Inputs required to create a profile with an onchain source and initial settings.",
        "required": [
          "profile_label",
          "fiat_currency",
          "gains_algorithm",
          "onchain_label",
          "onchain_kind",
          "onchain_url",
          "select_as_default"
        ],
        "properties": {
          "fiat_currency": {
            "type": "string"
          },
          "gains_algorithm": {
            "type": "string"
          },
          "onchain_kind": {
            "type": "string"
          },
          "onchain_label": {
            "type": "string"
          },
          "onchain_url": {
            "type": "string"
          },
          "profile_label": {
            "type": "string"
          },
          "rpc_cookie": {
            "type": [
              "string",
              "null"
            ]
          },
          "rpc_password": {
            "type": [
              "string",
              "null"
            ]
          },
          "rpc_user": {
            "type": [
              "string",
              "null"
            ]
          },
          "select_as_default": {
            "type": "boolean"
          },
          "tor_proxy": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProgressPhase": {
        "type": "string",
        "description": "Phases of adapter work for progress reporting.",
        "enum": [
          "Validating",
          "Connecting",
          "Planning",
          "Fetching",
          "Processing",
          "Persisting"
        ]
      },
      "ProgressScope": {
        "type": "string",
        "description": "Scope of a progress event.",
        "enum": [
          "Operation",
          "Connection"
        ]
      },
      "ProgressSource": {
        "type": "string",
        "description": "Source of a progress event.",
        "enum": [
          "Operation",
          "Adapter"
        ]
      },
      "ProgressUnit": {
        "type": "string",
        "description": "Unit for progress `current/total` semantics.",
        "enum": [
          "Connections",
          "Steps",
          "Pages",
          "Blocks",
          "Wallets",
          "Records",
          "Bytes"
        ]
      },
      "QuarantineReason": {
        "type": "object",
        "description": "Machine readable reason describing why an event was quarantined.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable code suitable for metrics and automated handling."
          },
          "message": {
            "type": "string",
            "description": "Human-readable context useful during debugging and tests."
          }
        }
      },
      "QuarantinedEvent": {
        "type": "object",
        "description": "Canonical event paired with its quarantine diagnostics.",
        "required": [
          "event_id",
          "event_kind",
          "reason"
        ],
        "properties": {
          "event_id": {
            "type": "string",
            "description": "Canonical identifier for the rejected event."
          },
          "event_kind": {
            "$ref": "#/components/schemas/JournalEventKind",
            "description": "Canonical event kind used for diagnostics."
          },
          "reason": {
            "$ref": "#/components/schemas/QuarantineReason",
            "description": "Machine-readable quarantine reason."
          }
        }
      },
      "ResolveConnectionBody": {
        "type": "object",
        "description": "Response body for resolved connection identifiers.",
        "required": [
          "connection_id"
        ],
        "properties": {
          "connection_id": {
            "$ref": "#/components/schemas/ConnectionId"
          }
        }
      },
      "SetJournalQuarantineResolutionRequest": {
        "type": "object",
        "description": "Request payload for setting/updating a persisted quarantine resolution.",
        "required": [
          "strategy"
        ],
        "properties": {
          "strategy": {
            "$ref": "#/components/schemas/JournalQuarantineResolutionStrategy",
            "description": "Operator-selected reconciliation strategy."
          }
        }
      },
      "SetMetadataBtcFiatOverride": {
        "type": "object",
        "description": "Request body used to set a metadata BTC-fiat override (pair + rate).",
        "required": [
          "rate",
          "pair"
        ],
        "properties": {
          "pair": {
            "type": "string",
            "description": "BTC-fiat pair identifying denomination (for example `BTC-USD`)."
          },
          "rate": {
            "type": "string",
            "description": "BTC-fiat rate quoted as fiat per 1 BTC."
          }
        }
      },
      "SetMetadataBtcFiatRate": {
        "type": "object",
        "description": "Request body used to set a metadata BTC-fiat rate override.",
        "required": [
          "btc_fiat_rate"
        ],
        "properties": {
          "btc_fiat_rate": {
            "type": "string",
            "description": "BTC-fiat rate quoted as fiat per 1 BTC."
          }
        }
      },
      "SetMetadataExcluded": {
        "type": "object",
        "description": "Request body used to set a metadata excluded flag.",
        "required": [
          "excluded"
        ],
        "properties": {
          "excluded": {
            "type": "boolean",
            "description": "New excluded value."
          }
        }
      },
      "SetMetadataNote": {
        "type": "object",
        "description": "Request body used to set a metadata note.",
        "required": [
          "note"
        ],
        "properties": {
          "note": {
            "type": "string",
            "description": "Note content."
          }
        }
      },
      "SetSettings": {
        "type": "object",
        "description": "Represents a caller request to replace the stored settings record for the current profile.",
        "properties": {
          "fiat_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Required fiat currency code (ASCII, canonicalized via `crate::assets::FiatCurrency`); `None` is rejected."
          },
          "gains_algorithm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Required capital gains algorithm (accepted: FIFO, LIFO, HIFO, LOFO, `AVG_COST`); `None` is rejected."
          },
          "onchain_data_source_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DataSourceId",
                "description": "Optional onchain data source identifier associated to the settings."
              }
            ]
          },
          "tor_proxy": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional Tor proxy endpoint string used by callers to route traffic over Tor when configured.\nAbsence disables proxying."
          }
        }
      },
      "SetWorkspaceMemberAccessRequest": {
        "type": "object",
        "description": "Request payload for updating a workspace member's access.\n# Examples\n```\nuse clams_engine_protocol::{\nSetWorkspaceMemberAccessRequest, WorkspaceInviteAccess, WorkspaceInviteProfiles,\n};\nlet request = SetWorkspaceMemberAccessRequest {\naccess: WorkspaceInviteAccess::ReadWrite,\nprofiles: WorkspaceInviteProfiles::All,\n};\nassert!(matches!(request.access, WorkspaceInviteAccess::ReadWrite));\n```",
        "required": [
          "access",
          "profiles"
        ],
        "properties": {
          "access": {
            "$ref": "#/components/schemas/WorkspaceInviteAccess",
            "description": "Access level to apply to the member."
          },
          "profiles": {
            "$ref": "#/components/schemas/WorkspaceInviteProfiles",
            "description": "Profile selection to apply to the member."
          }
        }
      },
      "String": {
        "type": "string"
      },
      "SubjectId": {
        "type": "string",
        "format": "uuid",
        "description": "External subject identifier supplied by upstream systems and validated as UUID v5 for\ndeterministic derivation."
      },
      "SubmitFeedbackRequest": {
        "type": "object",
        "description": "Payload submitted by clients to report feedback.\nBackends populate `backend_kind` and `backend_url` before forwarding to the\nauth server; clients should not set these fields.\n# Examples\n```rust\nuse clams_engine_protocol::feedback::{FeedbackType, SubmitFeedbackRequest};\nlet request = SubmitFeedbackRequest {\nfeedback_type: FeedbackType::General,\ntitle: \"Thanks\".to_owned(),\nmessage: \"Love the new reports view.\".to_owned(),\nreply_to_email: None,\napp_version: \"clams/0.1.0\".to_owned(),\nos: Some(\"macos\".to_owned()),\narch: Some(\"aarch64\".to_owned()),\nlogs: None,\n};\nassert!(request.logs.is_none());\n```",
        "required": [
          "feedback_type",
          "title",
          "message",
          "app_version"
        ],
        "properties": {
          "app_version": {
            "type": "string",
            "description": "Application version string (for example: `clams/0.1.0`)."
          },
          "arch": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional CPU architecture identifier reported by the client."
          },
          "feedback_type": {
            "$ref": "#/components/schemas/FeedbackType",
            "description": "Feedback category selected by the user."
          },
          "logs": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LogAttachment",
                "description": "Optional log attachment for bug reports."
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Full feedback message body."
          },
          "os": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional operating system identifier reported by the client."
          },
          "reply_to_email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional reply-to email address; omit for anonymous submissions."
          },
          "title": {
            "type": "string",
            "description": "Short title shown in the email subject."
          }
        }
      },
      "Tag": {
        "type": "object",
        "description": "Tag record returned by metadata APIs.",
        "required": [
          "id",
          "code",
          "label",
          "is_system"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Canonical tag code (lowercase)."
          },
          "id": {
            "$ref": "#/components/schemas/TagId",
            "description": "Tag identifier."
          },
          "is_system": {
            "type": "boolean",
            "description": "True when the tag is system-managed and immutable."
          },
          "label": {
            "type": "string",
            "description": "Display label for the tag."
          }
        }
      },
      "TagCreate": {
        "type": "object",
        "description": "Tag payload used to create a new tag.",
        "required": [
          "code",
          "label"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Canonical tag code."
          },
          "label": {
            "type": "string",
            "description": "Display label for the tag."
          }
        }
      },
      "TagId": {
        "type": "string",
        "format": "uuid",
        "description": "Canonical identifier for metadata tags."
      },
      "TagUpdate": {
        "type": "object",
        "description": "Tag payload used to update an existing tag label.",
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string",
            "description": "Display label for the tag."
          }
        }
      },
      "Trade": {
        "type": "object",
        "description": "Canonical trade execution payload capturing asset conversions and fees.",
        "required": [
          "id",
          "connection_id",
          "timestamp",
          "from_asset_id",
          "from_amount",
          "to_asset_id",
          "to_amount"
        ],
        "properties": {
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Exchange/connection identifier (UUID v7, lowercase hyphenated)."
          },
          "fee_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fee amount using the msat encoding."
          },
          "fee_asset_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AssetId",
                "description": "Asset used to pay fees, if distinct."
              }
            ]
          },
          "from_amount": {
            "type": "string",
            "description": "Amount of the \"from\" asset (msats encoding)."
          },
          "from_asset_id": {
            "$ref": "#/components/schemas/AssetId",
            "description": "Asset being sold."
          },
          "id": {
            "type": "string",
            "description": "Opaque trade execution identifier from the source system."
          },
          "order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional exchange order identifier."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Execution timestamp expressed in whole seconds."
          },
          "to_amount": {
            "type": "string",
            "description": "Amount of the \"to\" asset (msats encoding)."
          },
          "to_asset_id": {
            "$ref": "#/components/schemas/AssetId",
            "description": "Asset being bought."
          },
          "trade_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exchange-specific identifiers."
          }
        }
      },
      "Transaction": {
        "type": "object",
        "description": "Canonical on-chain transaction capturing confirmed inputs and outputs.",
        "required": [
          "id",
          "connection_id",
          "timestamp",
          "block_height",
          "inputs",
          "outputs"
        ],
        "properties": {
          "block_height": {
            "type": "integer",
            "format": "int32",
            "description": "Confirmed block height where this transaction was included.",
            "minimum": 0
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Wallet/connection that detected this transaction (UUID v7)."
          },
          "id": {
            "type": "string",
            "description": "Transaction txid (lowercase hex on emit)."
          },
          "inputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnchainInput"
            },
            "description": "Previous outputs being spent."
          },
          "ln_tx_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LnTransactionType",
                "description": "Lightning transaction classification when available."
              }
            ]
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnchainOutput"
            },
            "description": "New outputs being created."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Confirmation timestamp expressed in whole seconds."
          }
        }
      },
      "UpdateConnectionBody": {
        "type": "object",
        "description": "Payload for updating a connection.",
        "properties": {
          "configuration": {},
          "label": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UpdateProfileBody": {
        "type": "object",
        "description": "Payload for updating a profile label.",
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UpdateProfileWithSettingsRequest": {
        "type": "object",
        "description": "Inputs required to update a profile label and settings while holding one profile mutation lock.\nProtocol consumers should prefer this request when both pieces of state change together.\nLabel-only edits should continue to use the dedicated label mutation.",
        "required": [
          "label",
          "settings"
        ],
        "properties": {
          "label": {
            "type": "string",
            "description": "Replacement human-readable label for the profile."
          },
          "settings": {
            "$ref": "#/components/schemas/ProfileSettingsPatchInput",
            "description": "Settings patch to apply after the label update while the same lock is still held."
          }
        }
      },
      "UpdateProfileWithSettingsResult": {
        "type": "object",
        "description": "Outcome of a combined profile label/settings mutation.\nExactly one of `settings` or `settings_error` should be populated by conforming\nimplementations. This shape lets transports preserve the \"label updated, settings failed\"\npartial-success contract without splitting the mutation into separate backend calls.",
        "required": [
          "profile"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/ProfileRecord",
            "description": "Persisted profile record after the label update."
          },
          "settings": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileSettings",
                "description": "Persisted settings snapshot when the settings write succeeded."
              }
            ]
          },
          "settings_error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EngineError",
                "description": "Settings write failure captured after the label update succeeded."
              }
            ]
          }
        }
      },
      "UpsertOnchainBody": {
        "type": "object",
        "description": "Payload for creating or updating onchain sources.",
        "required": [
          "label",
          "kind",
          "source"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/OnchainDataSourceType"
          }
        }
      },
      "UserSettings": {
        "type": "object",
        "description": "Subject-scoped settings persisted for engine consumers.",
        "properties": {
          "selected_profile_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileId",
                "description": "The last profile the subject interacted with, if any."
              }
            ]
          }
        }
      },
      "Utxo": {
        "type": "object",
        "description": "Canonical unspent transaction output payload captured by accounting connections.",
        "required": [
          "id",
          "connection_id",
          "amount",
          "address"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Address or script associated with the UTXO (any network/format)."
          },
          "amount": {
            "type": "string",
            "description": "Amount in sats stored using the msat encoding (must end with `.000`)."
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Wallet/connection identifier (UUID v7, lowercase hyphenated)."
          },
          "id": {
            "type": "string",
            "description": "Outpoint formatted as `<txid>:<vout>` and serving as the primary identifier."
          },
          "linked_channel_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Channel identifier this UTXO is associated with when known."
          },
          "origin": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UtxoOrigin",
                "description": "Describes how this UTXO entered the wallet when known (sweep, close, etc.)."
              }
            ]
          }
        }
      },
      "UtxoOrigin": {
        "type": "string",
        "description": "Origin of a wallet UTXO for Lightning-aware reconciliation.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted canonical UTXO records.",
        "enum": [
          "ln_sweep",
          "closing_output",
          "penalty_income",
          "regular_payment",
          "change",
          "unknown"
        ]
      },
      "UtxoSpentFilter": {
        "type": "string",
        "description": "Filter for UTXO spent state when listing records.\nUsed to control whether a UTXO listing should return all UTXOs\nor only those that have not been spent (i.e., not consumed as\nan input in any Transaction record).",
        "enum": [
          "all",
          "unspent_only"
        ]
      },
      "ValidateConfigBody": {
        "type": "object",
        "description": "Payload for validating a connection configuration.",
        "required": [
          "configuration"
        ],
        "properties": {
          "configuration": {}
        }
      },
      "Withdrawal": {
        "type": "object",
        "description": "Canonical withdrawal payload capturing outbound fiat or bitcoin transfers from a custodial wallet.",
        "required": [
          "id",
          "connection_id",
          "timestamp",
          "amount",
          "asset_id"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount (btc or fiat) stored using the msat encoding (exactly three fractional digits)."
          },
          "asset_id": {
            "$ref": "#/components/schemas/AssetId",
            "description": "Asset identifier derived from the `assets` crate."
          },
          "btc_destination": {
            "type": [
              "string",
              "null"
            ],
            "description": "On-chain address or LN payment hash; equality-based secondary index."
          },
          "btc_txid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional on-chain transaction id (lowercase 64-char hex)."
          },
          "btc_vout": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Optional on-chain output index within the transaction (0..=65535).",
            "minimum": 0
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "Connection identifier (UUID v7, lowercase hyphenated)."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional human-readable description or memo associated with the withdrawal."
          },
          "fee": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional fee in the same asset using the msat encoding."
          },
          "id": {
            "type": "string",
            "description": "Opaque external identifier from the source system."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Event timestamp expressed in whole seconds."
          }
        }
      },
      "WorkspaceId": {
        "type": "string",
        "format": "uuid",
        "description": "Canonical identifier backing every workspace record persisted by the module."
      },
      "WorkspaceInviteAccess": {
        "type": "string",
        "description": "Access levels granted by a workspace invite.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted [`WorkspaceInviteRecord`] values.",
        "enum": [
          "admin",
          "read",
          "read_write"
        ]
      },
      "WorkspaceInviteId": {
        "type": "string",
        "format": "uuid",
        "description": "Unique invite identifier scoped under a workspace."
      },
      "WorkspaceInviteProfiles": {
        "oneOf": [
          {
            "type": "string",
            "description": "Grants apply to all profiles in the workspace.",
            "enum": [
              "all"
            ]
          },
          {
            "type": "object",
            "description": "Grants apply to the selected profiles only.",
            "required": [
              "some"
            ],
            "properties": {
              "some": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProfileId"
                },
                "description": "Grants apply to the selected profiles only."
              }
            }
          }
        ],
        "description": "Profile selection associated with an invite.\nNew variants must be appended to the end of this enum. Reordering variants or inserting a new\nvariant before the end breaks bincode decoding of persisted [`WorkspaceInviteRecord`] values."
      },
      "WorkspaceInviteStatus": {
        "type": "string",
        "description": "Computed invite status derived from timestamp fields.",
        "enum": [
          "pending",
          "revoked",
          "redeemed",
          "expired"
        ]
      },
      "WorkspaceInviteView": {
        "type": "object",
        "description": "API-safe representation of a workspace invite.",
        "required": [
          "id",
          "workspace_id",
          "invited_email",
          "access",
          "profiles",
          "status",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "access": {
            "$ref": "#/components/schemas/WorkspaceInviteAccess",
            "description": "Access level granted by the invite."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the invite was created."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the invite expires."
          },
          "id": {
            "$ref": "#/components/schemas/WorkspaceInviteId",
            "description": "Invite identifier."
          },
          "invited_email": {
            "type": "string",
            "description": "Normalized invitee email captured for display."
          },
          "profiles": {
            "$ref": "#/components/schemas/WorkspaceInviteProfiles",
            "description": "Profile selection bound to the invite."
          },
          "redeemed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Timestamp when the invite was redeemed."
          },
          "redeemed_subject_id": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SubjectId",
                "description": "Subject that redeemed the invite."
              }
            ]
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Timestamp when the invite was revoked."
          },
          "status": {
            "$ref": "#/components/schemas/WorkspaceInviteStatus",
            "description": "Derived status for the invite."
          },
          "workspace_id": {
            "$ref": "#/components/schemas/WorkspaceId",
            "description": "Workspace to which the invite grants access."
          }
        }
      },
      "WorkspaceMemberView": {
        "type": "object",
        "description": "Access policy view for a workspace member.\n# Examples\n```\nuse clams_engine_protocol::{\nSubjectId, WorkspaceInviteAccess, WorkspaceInviteProfiles, WorkspaceMemberView,\n};\nuse uuid::Uuid;\nlet subject_id = SubjectId::from_namespaced(&Uuid::NAMESPACE_URL, b\"member\");\nlet view = WorkspaceMemberView {\nsubject_id,\naccess: WorkspaceInviteAccess::Read,\nprofiles: WorkspaceInviteProfiles::All,\n};\nassert!(matches!(view.access, WorkspaceInviteAccess::Read));\n```",
        "required": [
          "subject_id",
          "access",
          "profiles"
        ],
        "properties": {
          "access": {
            "$ref": "#/components/schemas/WorkspaceInviteAccess",
            "description": "Effective access level for the member."
          },
          "profiles": {
            "$ref": "#/components/schemas/WorkspaceInviteProfiles",
            "description": "Effective profile selection for the member."
          },
          "subject_id": {
            "$ref": "#/components/schemas/SubjectId",
            "description": "Subject identifier for the member."
          }
        }
      },
      "WorkspaceRecord": {
        "type": "object",
        "description": "Canonical workspace record.",
        "required": [
          "id",
          "label",
          "creator_subject_id"
        ],
        "properties": {
          "creator_subject_id": {
            "$ref": "#/components/schemas/SubjectId",
            "description": "Subject that created the workspace (UUID v5).\n\nThis identifier is retained for audit purposes only and is not used for authorization."
          },
          "id": {
            "$ref": "#/components/schemas/WorkspaceId",
            "description": "Server-assigned UUID v7 identifier for the workspace."
          },
          "label": {
            "type": "string",
            "description": "Human-readable label associated with the workspace."
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "tags": [
    {
      "name": "Health",
      "description": "Health checks"
    },
    {
      "name": "Feedback",
      "description": "Support feedback"
    },
    {
      "name": "Workspaces",
      "description": "Workspace management"
    },
    {
      "name": "Workspace Invites",
      "description": "Workspace invite management"
    },
    {
      "name": "Workspace Members",
      "description": "Workspace member management"
    },
    {
      "name": "Profiles",
      "description": "Profile management"
    },
    {
      "name": "Connections",
      "description": "Connection management"
    },
    {
      "name": "Assets",
      "description": "Asset catalog"
    },
    {
      "name": "Accounts",
      "description": "Account management"
    },
    {
      "name": "Operations",
      "description": "Async operations"
    },
    {
      "name": "Settings",
      "description": "User and profile settings"
    },
    {
      "name": "Onchain",
      "description": "Onchain sources"
    },
    {
      "name": "Records",
      "description": "Canonical records"
    },
    {
      "name": "Metadata",
      "description": "Metadata records and tags"
    },
    {
      "name": "Journals",
      "description": "Journal processing"
    },
    {
      "name": "Reports",
      "description": "Report generation"
    },
    {
      "name": "Notifications",
      "description": "Server-sent notifications stream"
    }
  ]
}
