{
  "components": {
    "examples": {},
    "headers": {},
    "parameters": {},
    "requestBodies": {},
    "responses": {},
    "schemas": {
      "AIFileDownloadInfo": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AIFileInfo"
          },
          {
            "properties": {
              "downloadUrl": {
                "type": "string"
              }
            },
            "required": [
              "downloadUrl"
            ],
            "type": "object"
          }
        ]
      },
      "AIFileInfo": {
        "properties": {
          "arch": {
            "enum": [
              "upper",
              "lower"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "numberingSystem": {
            "enum": [
              "FDI",
              "ADA"
            ],
            "type": "string"
          },
          "teethRange": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "type": {
            "enum": [
              "marginLine",
              "design",
              "scan",
              "scan-marginLine",
              "transformationMatrix",
              "other"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "name"
        ],
        "type": "object"
      },
      "AIFileUploadloadInfo": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AIFileInfo"
          },
          {
            "properties": {
              "uploadUrl": {
                "type": "string"
              }
            },
            "required": [
              "uploadUrl"
            ],
            "type": "object"
          }
        ]
      },
      "AccessLevel": {
        "enum": [
          "READ",
          "UPDATE_EXISTING",
          "MANAGE_CONTENT"
        ],
        "type": "string"
      },
      "AccessLevelDTO": {
        "description": "READ retrieves; UPDATE_EXISTING replaces/renames; MANAGE_CONTENT also adds/deletes.",
        "enum": [
          "READ",
          "UPDATE_EXISTING",
          "MANAGE_CONTENT"
        ],
        "type": "string"
      },
      "ActivityType": {
        "enum": [
          "purchase",
          "ingest",
          "transferCredits",
          "moveAllUsersPlan",
          "moveUserPlan",
          "updatePlan"
        ],
        "type": "string"
      },
      "AnalyticsEventRequestDTO": {
        "additionalProperties": {},
        "properties": {
          "event": {
            "type": "string"
          }
        },
        "required": [
          "event"
        ],
        "type": "object"
      },
      "AnalyticsUserRequestDTO": {
        "additionalProperties": {},
        "properties": {
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "email",
          "id"
        ],
        "type": "object"
      },
      "AuthorizationDecisionReason": {
        "enum": [
          "OWNER",
          "ALLOWED",
          "NO_AGREEMENT",
          "AGREEMENT_PENDING",
          "AGREEMENT_REVOKED",
          "IDENTITY_MISMATCH",
          "SCOPE_EXPIRED",
          "SCOPE_NOT_FOUND",
          "RESOURCE_ANCESTRY_MISMATCH"
        ],
        "type": "string"
      },
      "BalanceCheckFailure": {
        "properties": {
          "message": {
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "properties": {
                  "trialStarted": {
                    "enum": [
                      false
                    ],
                    "nullable": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "trialStarted"
                ],
                "type": "object"
              },
              {
                "$ref": "#/components/schemas/TransactionsBalanceDetails"
              }
            ]
          },
          "success": {
            "enum": [
              false
            ],
            "nullable": false,
            "type": "boolean"
          }
        },
        "required": [
          "reason",
          "message",
          "success"
        ],
        "type": "object"
      },
      "BalanceCheckRequestDTO": {
        "$ref": "#/components/schemas/Pick_IngestRequestDTO.transactions_"
      },
      "BalanceCheckResponseDTO": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/BalanceCheckSuccess"
          },
          {
            "$ref": "#/components/schemas/BalanceCheckFailure"
          }
        ]
      },
      "BalanceCheckSuccess": {
        "properties": {
          "inFreeTrial": {
            "type": "boolean"
          },
          "success": {
            "enum": [
              true
            ],
            "nullable": false,
            "type": "boolean"
          }
        },
        "required": [
          "inFreeTrial",
          "success"
        ],
        "type": "object"
      },
      "BaseActivity": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ActivityType"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "userEmail": {
            "format": "email",
            "pattern": "^(.+)@(.+)$",
            "type": "string"
          },
          "userFullName": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "userId",
          "userEmail",
          "userFullName"
        ],
        "type": "object"
      },
      "BaseFilterResponse_BaseActivity_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/BaseActivity"
            },
            "type": "array"
          },
          "totalCount": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "totalCount",
          "data"
        ],
        "type": "object"
      },
      "BaseFilterResponse_Patient_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Patient"
            },
            "type": "array"
          },
          "totalCount": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "totalCount",
          "data"
        ],
        "type": "object"
      },
      "BaseFilterResponse_UserAccountResponse_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/UserAccountResponse"
            },
            "type": "array"
          },
          "totalCount": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "totalCount",
          "data"
        ],
        "type": "object"
      },
      "BillingEvent": {
        "enum": [
          "surgical_guide_export",
          "stackable_guide_export",
          "crown_export",
          "crown_over_implant_export",
          "bridge_export",
          "inlay_onlay_export",
          "veneer_export",
          "splint_export"
        ],
        "type": "string"
      },
      "BillingPackage": {
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "cost": {
            "format": "double",
            "type": "number"
          },
          "discount": {
            "format": "double",
            "type": "number"
          },
          "isMostRecommended": {
            "type": "boolean"
          }
        },
        "required": [
          "discount",
          "amount",
          "cost"
        ],
        "type": "object"
      },
      "BillingPlan": {
        "additionalProperties": false,
        "properties": {
          "bridgePricingThreshold": {
            "format": "double",
            "type": "number"
          },
          "createdAt": {},
          "creditCost": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "key": {
            "$ref": "#/components/schemas/BillingPlanKey"
          },
          "name": {
            "type": "string"
          },
          "packages": {
            "items": {
              "$ref": "#/components/schemas/BillingPackage"
            },
            "type": "array"
          },
          "productsEventsPrices": {
            "items": {
              "$ref": "#/components/schemas/ProductsEventsPrice"
            },
            "type": "array"
          },
          "trialExpiryInDays": {
            "format": "double",
            "type": "number"
          },
          "updatedAt": {}
        },
        "required": [
          "id",
          "updatedAt",
          "createdAt",
          "name",
          "key",
          "productsEventsPrices",
          "bridgePricingThreshold",
          "trialExpiryInDays",
          "packages"
        ],
        "type": "object"
      },
      "BillingPlanKey": {
        "enum": [
          "armaCad",
          "tier1",
          "tier2",
          "tier3",
          "free"
        ],
        "type": "string"
      },
      "BillingPlanUpdate": {
        "$ref": "#/components/schemas/Partial_Omit_BillingPlanCreateInput.key__"
      },
      "BillingPlanWithCountries": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BillingPlan"
          },
          {
            "properties": {
              "countries": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "countries"
            ],
            "type": "object"
          }
        ]
      },
      "BillingProduct": {
        "additionalProperties": false,
        "properties": {
          "allowedEvents": {
            "items": {
              "$ref": "#/components/schemas/BillingEvent"
            },
            "type": "array"
          },
          "createdAt": {},
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "key": {
            "$ref": "#/components/schemas/BillingProductKey"
          },
          "name": {
            "type": "string"
          },
          "updatedAt": {}
        },
        "required": [
          "id",
          "updatedAt",
          "createdAt",
          "name",
          "key",
          "allowedEvents"
        ],
        "type": "object"
      },
      "BillingProductKey": {
        "enum": [
          "surgical_guide",
          "stackable_guide",
          "crown",
          "crown_over_implant",
          "bridge",
          "inlay_onlay",
          "veneer",
          "splint"
        ],
        "type": "string"
      },
      "BridgeExportTransaction": {
        "properties": {
          "bridgeTeethCount": {
            "format": "double",
            "type": "number"
          },
          "event": {
            "enum": [
              "bridge_export"
            ],
            "nullable": false,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "timeStamp": {
            "type": "string"
          }
        },
        "required": [
          "bridgeTeethCount",
          "event"
        ],
        "type": "object"
      },
      "CaseMetaData": {
        "properties": {
          "materialParameters": {
            "items": {
              "properties": {
                "name": {
                  "$ref": "#/components/schemas/MaterialParameter"
                },
                "value": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "value",
                "name"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "numberingSystem": {
            "$ref": "#/components/schemas/NumberingSystem"
          },
          "products": {
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "type": "array"
          },
          "transformationMatrices": {
            "properties": {
              "lower": {
                "items": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "type": "array"
              },
              "upper": {
                "items": {
                  "items": {
                    "format": "double",
                    "type": "number"
                  },
                  "type": "array"
                },
                "type": "array"
              }
            },
            "required": [
              "lower",
              "upper"
            ],
            "type": "object"
          }
        },
        "required": [
          "numberingSystem",
          "products",
          "transformationMatrices"
        ],
        "type": "object"
      },
      "Commit": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "$ref": "#/components/schemas/CommitAction"
          },
          "committer": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfo"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "latest": {
            "type": "boolean"
          },
          "patientId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "createdAt",
          "updatedAt",
          "patientId",
          "workspaceId",
          "committer",
          "action",
          "latest",
          "filesInfo"
        ],
        "type": "object"
      },
      "CommitAction": {
        "enum": [
          "Replace",
          "Merge",
          "AppendOnly"
        ],
        "type": "string"
      },
      "CommitUploadRequestDTO": {
        "$ref": "#/components/schemas/Omit_CommitCreateInput.committer_"
      },
      "CommitUploadResponseDTO": {
        "properties": {
          "commit": {
            "$ref": "#/components/schemas/Commit"
          },
          "failedFiles": {
            "items": {
              "properties": {
                "error": {
                  "type": "string"
                },
                "relativePath": {
                  "type": "string"
                }
              },
              "required": [
                "error",
                "relativePath"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "failedFiles",
          "commit"
        ],
        "type": "object"
      },
      "ConfirmPaymentPayloadRequestDTO": {
        "properties": {
          "cost": {
            "format": "double",
            "type": "number"
          },
          "credits": {
            "properties": {
              "quantity": {
                "format": "double",
                "type": "number"
              },
              "unitPrice": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "unitPrice",
              "quantity"
            ],
            "type": "object"
          },
          "paymentMethodId": {
            "type": "string"
          }
        },
        "required": [
          "credits",
          "cost",
          "paymentMethodId"
        ],
        "type": "object"
      },
      "ConfirmPaymentPayloadResponseDTO": {
        "properties": {
          "id": {
            "type": "string"
          },
          "noOfCredits": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "noOfCredits",
          "id"
        ],
        "type": "object"
      },
      "CreateCustomerDTO": {
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "CreateDraftOrderDTO": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Partial_OrderCore_"
          },
          {
            "$ref": "#/components/schemas/OrderIdentificationData"
          }
        ]
      },
      "CreateDraftOrderRequestDTO": {
        "$ref": "#/components/schemas/Partial_OrderCore_"
      },
      "CreateDraftOrderResponseDTO": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CreateDraftOrderDTO"
          },
          {
            "properties": {
              "draftId": {
                "type": "string"
              }
            },
            "required": [
              "draftId"
            ],
            "type": "object"
          }
        ]
      },
      "CreateIFFrameTokenDTO": {
        "properties": {
          "cost": {
            "format": "double",
            "type": "number"
          },
          "credits": {
            "properties": {
              "quantity": {
                "format": "double",
                "type": "number"
              },
              "unitPrice": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "unitPrice",
              "quantity"
            ],
            "type": "object"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "failURL": {
            "type": "string"
          },
          "okURL": {
            "type": "string"
          }
        },
        "required": [
          "credits",
          "cost",
          "failURL",
          "okURL"
        ],
        "type": "object"
      },
      "CreateShareAgreementDTO": {
        "additionalProperties": false,
        "description": "Request for creating or reactivating a share agreement.",
        "properties": {
          "policy": {
            "$ref": "#/components/schemas/SharingPolicyDTO",
            "description": "Workspace-wide or explicitly scoped access policy."
          },
          "recipientEmail": {
            "description": "Recipient email; it is trimmed and normalized to lowercase.",
            "example": "recipient@example.com",
            "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
            "type": "string"
          }
        },
        "required": [
          "recipientEmail",
          "policy"
        ],
        "type": "object"
      },
      "CreditGrant": {
        "properties": {
          "available": {
            "format": "double",
            "type": "number"
          },
          "cost": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "expired": {
            "type": "boolean"
          },
          "expiredAt": {
            "format": "date-time",
            "type": "string"
          },
          "issuedAt": {
            "format": "date-time",
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "total": {
            "format": "double",
            "type": "number"
          },
          "type": {
            "enum": [
              "purchased",
              "assigned"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "currency",
          "cost",
          "available",
          "total",
          "expiredAt",
          "issuedAt"
        ],
        "type": "object"
      },
      "Currency": {
        "enum": [
          "TL",
          "USD",
          "EUR",
          "GBP",
          "RUB"
        ],
        "type": "string"
      },
      "Exclude_BillingEvent.bridge_export_": {
        "description": "Exclude from T those types that are assignable to U",
        "enum": [
          "surgical_guide_export",
          "stackable_guide_export",
          "crown_export",
          "crown_over_implant_export",
          "inlay_onlay_export",
          "veneer_export",
          "splint_export"
        ],
        "type": "string"
      },
      "ExportTransaction": {
        "properties": {
          "event": {
            "$ref": "#/components/schemas/Exclude_BillingEvent.bridge_export_"
          },
          "id": {
            "type": "string"
          },
          "timeStamp": {
            "type": "string"
          }
        },
        "required": [
          "event"
        ],
        "type": "object"
      },
      "FDITooth": {
        "enum": [
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          31,
          32,
          33,
          34,
          35,
          36,
          37,
          38,
          41,
          42,
          43,
          44,
          45,
          46,
          47,
          48
        ],
        "type": "number"
      },
      "FileData": {
        "properties": {
          "bucket": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "uploadUrl": {
            "type": "string"
          }
        },
        "required": [
          "uploadUrl",
          "key",
          "bucket",
          "name"
        ],
        "type": "object"
      },
      "FileInfo": {
        "additionalProperties": false,
        "properties": {
          "fileId": {
            "type": "string"
          },
          "flags": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "lastUpdated": {
            "format": "date-time",
            "type": "string"
          },
          "relativePath": {
            "type": "string"
          },
          "size": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "hash",
          "relativePath"
        ],
        "type": "object"
      },
      "FileInfoCreateInput": {
        "$ref": "#/components/schemas/Omit_FileInfo.lastUpdated-or-size_"
      },
      "FileOperationCapabilitiesDTO": {
        "additionalProperties": false,
        "properties": {
          "delete": {
            "type": "boolean"
          },
          "download": {
            "type": "boolean"
          },
          "rename": {
            "type": "boolean"
          },
          "replace": {
            "type": "boolean"
          }
        },
        "required": [
          "download",
          "replace",
          "rename",
          "delete"
        ],
        "type": "object"
      },
      "FileScopeDTO": {
        "additionalProperties": false,
        "description": "Grants access to one stable file ID within a patient.",
        "properties": {
          "access": {
            "$ref": "#/components/schemas/AccessLevelDTO",
            "description": "Access granted for this file.",
            "example": "READ"
          },
          "expiresAt": {
            "description": "Optional ISO 8601 expiry. Access is denied at and after this instant.",
            "example": "2030-01-01T00:00:00.000Z",
            "type": "string"
          },
          "fileId": {
            "description": "Stable file identifier returned by the shared-content APIs.",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "type": "string"
          }
        },
        "required": [
          "fileId",
          "access"
        ],
        "type": "object"
      },
      "FilterActivitiesRequestDTO": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "format": "int32",
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "planId": {
            "type": "string"
          },
          "q": {
            "maxLength": 100,
            "type": "string"
          },
          "skip": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "sort.field": {
            "enum": [
              "createdAt"
            ],
            "nullable": false,
            "type": "string"
          },
          "sort.order": {
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PurchaseStatus"
          },
          "type": {
            "$ref": "#/components/schemas/ActivityType"
          },
          "userEmail": {
            "format": "email",
            "pattern": "^(.+)@(.+)$",
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "FilterActivitiesResponseDTO": {
        "$ref": "#/components/schemas/BaseFilterResponse_BaseActivity_"
      },
      "FilterUsersRequestDTO": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "limit": {
            "format": "int32",
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "planId": {
            "type": "string"
          },
          "q": {
            "maxLength": 100,
            "type": "string"
          },
          "registrationInfo.country": {
            "type": "string"
          },
          "registrationInfo.countryCode": {
            "type": "string"
          },
          "registrationInfo.origin": {
            "type": "string"
          },
          "registrationInfo.phone": {
            "type": "string"
          },
          "skip": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "sort.field": {
            "enum": [
              "createdAt"
            ],
            "nullable": false,
            "type": "string"
          },
          "sort.order": {
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "FilterUsersResponseDTO": {
        "$ref": "#/components/schemas/BaseFilterResponse_UserAccountResponse_"
      },
      "Gender": {
        "enum": [
          "Male",
          "Female",
          "Other"
        ],
        "type": "string"
      },
      "GetAIFilesUploadUrlsResponseDTO": {
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/FileData"
            },
            "type": "array"
          },
          "taskId": {
            "type": "string"
          }
        },
        "required": [
          "files",
          "taskId"
        ],
        "type": "object"
      },
      "GetCaseDataResponse": {
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/AIFileDownloadInfo"
            },
            "type": "array"
          },
          "metaData": {
            "$ref": "#/components/schemas/CaseMetaData"
          }
        },
        "required": [
          "files",
          "metaData"
        ],
        "type": "object"
      },
      "GetCustomerBillingInfoResponseDTO": {
        "properties": {
          "creditCost": {
            "format": "double",
            "type": "number"
          },
          "credits": {
            "properties": {
              "available": {
                "format": "double",
                "type": "number"
              },
              "consumed": {
                "format": "double",
                "type": "number"
              },
              "total": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "total",
              "consumed",
              "available"
            ],
            "type": "object"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "packages": {
            "items": {
              "$ref": "#/components/schemas/BillingPackage"
            },
            "type": "array"
          },
          "products": {
            "items": {
              "properties": {
                "credits": {
                  "format": "double",
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "credits",
                "name",
                "id"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "products",
          "packages",
          "credits",
          "creditCost",
          "currency"
        ],
        "type": "object"
      },
      "GetCustomerBillingSettingsResponseDTO": {
        "properties": {
          "creditsTransferExpiryInDays": {
            "format": "double",
            "type": "number"
          },
          "defaultNumberingSystem": {
            "$ref": "#/components/schemas/NumberingSystem"
          },
          "isBillingDisabled": {
            "type": "boolean"
          },
          "paymentMethodSaveLimit": {
            "format": "double",
            "type": "number"
          },
          "paymentPlatform": {
            "enum": [
              "stripe",
              "paytr",
              "none"
            ],
            "type": "string"
          },
          "planDetails": {
            "properties": {
              "bridgePricingThreshold": {
                "format": "double",
                "type": "number"
              },
              "id": {
                "type": "string"
              },
              "key": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "bridgePricingThreshold",
              "key",
              "id",
              "name"
            ],
            "type": "object"
          },
          "trialExpiryInDays": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "paymentPlatform",
          "trialExpiryInDays",
          "creditsTransferExpiryInDays",
          "defaultNumberingSystem"
        ],
        "type": "object"
      },
      "GetDownloadUrlsRequestDTO": {
        "properties": {
          "patientId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "relativePaths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "relativePaths",
          "patientId",
          "workspaceId"
        ],
        "type": "object"
      },
      "GetDownloadUrlsResponseDTO": {
        "properties": {
          "error": {
            "type": "string"
          },
          "flags": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "relativePath": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "relativePath"
        ],
        "type": "object"
      },
      "GetStatusResponseDTO": {
        "properties": {
          "errorCode": {
            "nullable": true,
            "type": "string"
          },
          "errorMessage": {
            "nullable": true,
            "type": "string"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/AIFileDownloadInfo"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "Processing",
              "Failed",
              "Success"
            ],
            "type": "string"
          },
          "taskId": {
            "type": "string"
          }
        },
        "required": [
          "files",
          "errorMessage",
          "errorCode",
          "status",
          "taskId"
        ],
        "type": "object"
      },
      "GetUploadUrlsRequestDTO": {
        "properties": {
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfoCreateInput"
            },
            "type": "array"
          },
          "patientId": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "filesInfo",
          "patientId",
          "workspaceId"
        ],
        "type": "object"
      },
      "GetUploadUrlsResponseDTO": {
        "properties": {
          "error": {
            "type": "string"
          },
          "relativePath": {
            "type": "string"
          },
          "uploadedBefore": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "relativePath"
        ],
        "type": "object"
      },
      "IngestEventCost": {
        "properties": {
          "count": {
            "format": "double",
            "type": "number"
          },
          "event": {
            "$ref": "#/components/schemas/BillingEvent"
          },
          "productName": {
            "type": "string"
          },
          "requiredCredits": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "requiredCredits",
          "count",
          "productName",
          "event"
        ],
        "type": "object"
      },
      "IngestRequestDTO": {
        "properties": {
          "transactions": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ExportTransaction"
                },
                {
                  "$ref": "#/components/schemas/BridgeExportTransaction"
                }
              ]
            },
            "type": "array"
          }
        },
        "required": [
          "transactions"
        ],
        "type": "object"
      },
      "IngestResponseDTO": {
        "properties": {
          "balanceAfter": {
            "format": "double",
            "type": "number"
          },
          "balanceBefore": {
            "format": "double",
            "type": "number"
          },
          "eventsCost": {
            "items": {
              "$ref": "#/components/schemas/IngestEventCost"
            },
            "type": "array"
          }
        },
        "required": [
          "eventsCost",
          "balanceAfter",
          "balanceBefore"
        ],
        "type": "object"
      },
      "InvitedUser": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "workspacesSharingWithMe": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "email",
          "workspacesSharingWithMe"
        ],
        "type": "object"
      },
      "MaterialParameter": {
        "enum": [
          "Mesial/Distal Contact",
          "Mesial/Distal Contact For Adjacent Restorations",
          "Occlusal Contact",
          "Thickness Margin",
          "Minimum Thickness",
          "Occlusal Thickness",
          "Cement Gap Margin",
          "Cement Gap Transition Start",
          "Cement Gap Transition",
          "Cement Gap Flat",
          "Cement Gap Flat Angle",
          "Cement Gap Vertical",
          "Cement Gap Vertical Angle",
          "Mesial/Distal Contact Area"
        ],
        "type": "string"
      },
      "MoveAllUsersToPlanRequestDTO": {
        "properties": {
          "sourcePlanId": {
            "type": "string"
          },
          "targetPlanId": {
            "type": "string"
          }
        },
        "required": [
          "targetPlanId",
          "sourcePlanId"
        ],
        "type": "object"
      },
      "MoveUsersToPlanRequestDTO": {
        "additionalProperties": false,
        "properties": {
          "emails": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "targetPlanId": {
            "type": "string"
          }
        },
        "required": [
          "emails",
          "targetPlanId"
        ],
        "type": "object"
      },
      "MySharedData": {
        "additionalProperties": false,
        "properties": {
          "anonymousPatient": {
            "type": "boolean"
          },
          "filesPaths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "receivers": {
            "items": {
              "$ref": "#/components/schemas/UserData"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "patientId",
          "anonymousPatient",
          "filesPaths",
          "receivers"
        ],
        "type": "object"
      },
      "NumberingSystem": {
        "enum": [
          "FDI",
          "Universal"
        ],
        "type": "string"
      },
      "Omit_CommitCreateInput.committer_": {
        "$ref": "#/components/schemas/Pick_CommitCreateInput.Exclude_keyofCommitCreateInput.committer__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_FileInfo.lastUpdated-or-size_": {
        "$ref": "#/components/schemas/Pick_FileInfo.Exclude_keyofFileInfo.lastUpdated-or-size__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_Patient.filesInfo-or-plans_": {
        "$ref": "#/components/schemas/Pick_Patient.Exclude_keyofPatient.filesInfo-or-plans__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_PatientCreateInput.plans-or-workspaceId_": {
        "$ref": "#/components/schemas/Pick_PatientCreateInput.Exclude_keyofPatientCreateInput.plans-or-workspaceId__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_Plan.createdAt-or-thumbnailUrl-or-filesInfo_": {
        "$ref": "#/components/schemas/Pick_Plan.Exclude_keyofPlan.createdAt-or-thumbnailUrl-or-filesInfo__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_Plan.createdAt-or-updatedAt-or-thumbnailUrl-or-filesInfo_": {
        "$ref": "#/components/schemas/Pick_Plan.Exclude_keyofPlan.createdAt-or-updatedAt-or-thumbnailUrl-or-filesInfo__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_Plan.filesInfo_": {
        "$ref": "#/components/schemas/Pick_Plan.Exclude_keyofPlan.filesInfo__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_PurchaseActivity.type-or-platform-or-userEmail-or-userFullName-or-userIp-or-reqOrigin_": {
        "$ref": "#/components/schemas/Pick_PurchaseActivity.Exclude_keyofPurchaseActivity.type-or-platform-or-userEmail-or-userFullName-or-userIp-or-reqOrigin__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "Omit_UserAccount.creditGrants_": {
        "$ref": "#/components/schemas/Pick_UserAccount.Exclude_keyofUserAccount.creditGrants__",
        "description": "Construct a type with the properties of T except for those in type K."
      },
      "OrderIdentificationData": {
        "properties": {
          "patient": {
            "properties": {
              "birthDate": {
                "format": "date-time",
                "type": "string"
              },
              "firstName": {
                "type": "string"
              },
              "gender": {
                "$ref": "#/components/schemas/Gender"
              },
              "id": {
                "type": "string"
              },
              "lastName": {
                "type": "string"
              }
            },
            "required": [
              "birthDate",
              "gender",
              "lastName",
              "firstName",
              "id"
            ],
            "type": "object"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "workspaceId",
          "patient"
        ],
        "type": "object"
      },
      "OrderOption": {
        "properties": {
          "displayName": {
            "type": "string"
          },
          "parentDisplayName": {
            "type": "string"
          },
          "parentKey": {
            "enum": [
              "kits",
              "implantSystems",
              "implantFamilies",
              "guideTypes",
              "softwares"
            ],
            "nullable": false,
            "type": "string"
          }
        },
        "required": [
          "displayName"
        ],
        "type": "object"
      },
      "OrderOptions": {
        "properties": {
          "guideTypes": {
            "items": {
              "$ref": "#/components/schemas/OrderOption"
            },
            "type": "array"
          },
          "implantFamilies": {
            "items": {
              "$ref": "#/components/schemas/OrderOption"
            },
            "type": "array"
          },
          "implantSystems": {
            "items": {
              "$ref": "#/components/schemas/OrderOption"
            },
            "type": "array"
          },
          "kits": {
            "items": {
              "$ref": "#/components/schemas/OrderOption"
            },
            "type": "array"
          },
          "softwares": {
            "items": {
              "$ref": "#/components/schemas/OrderOption"
            },
            "type": "array"
          }
        },
        "required": [
          "softwares",
          "guideTypes",
          "implantFamilies",
          "implantSystems",
          "kits"
        ],
        "type": "object"
      },
      "Partial_Omit_BillingPlanCreateInput.key__": {
        "description": "Make all properties in T optional",
        "properties": {
          "bridgePricingThreshold": {
            "format": "double",
            "type": "number"
          },
          "creditCost": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "packages": {
            "items": {
              "$ref": "#/components/schemas/BillingPackage"
            },
            "type": "array"
          },
          "productsEventsPrices": {
            "items": {
              "$ref": "#/components/schemas/ProductsEventsPrice"
            },
            "type": "array"
          },
          "trialExpiryInDays": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Partial_Omit_PatientCreateDTO.workspaceId__": {
        "description": "Make all properties in T optional",
        "properties": {
          "AssigneeId": {
            "type": "string"
          },
          "birthDate": {
            "format": "date-time",
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          },
          "lastName": {
            "type": "string"
          },
          "practicePatientId": {
            "type": "string"
          },
          "readableId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Partial_OrderCore_": {
        "description": "Make all properties in T optional",
        "properties": {
          "category": {
            "enum": [
              "implant_solutions"
            ],
            "nullable": false,
            "type": "string"
          },
          "guideType": {
            "type": "string"
          },
          "implantFamily": {
            "type": "string"
          },
          "implantSystem": {
            "type": "string"
          },
          "isCustomHealingAbutment": {
            "type": "boolean"
          },
          "isDiagnosticWaxUp": {
            "type": "boolean"
          },
          "isEssixRetainer": {
            "type": "boolean"
          },
          "isPMMADesign": {
            "type": "boolean"
          },
          "isPMMAFabrication": {
            "type": "boolean"
          },
          "isShellProsthesis": {
            "type": "boolean"
          },
          "isSurgeryDate": {
            "format": "date-time",
            "type": "string"
          },
          "lowerSupportType": {
            "enum": [
              "tooth_supported",
              "tissue_supported",
              "bone_supported",
              "bone_reduction_tooth",
              "bone_reduction_bone"
            ],
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "planOwner": {
            "enum": [
              "Lab",
              "Me"
            ],
            "type": "string"
          },
          "printOwner": {
            "enum": [
              "Lab",
              "Me"
            ],
            "type": "string"
          },
          "prosthesisProvider": {
            "enum": [
              "Lab",
              "Me"
            ],
            "type": "string"
          },
          "prosthesisType": {
            "enum": [
              "single_crown",
              "removable_over_denture",
              "bridge",
              "hybrid_denture",
              "fixed_denture"
            ],
            "type": "string"
          },
          "selectedTeethUniversal": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "software": {
            "type": "string"
          },
          "surgeryDate": {
            "format": "date-time",
            "type": "string"
          },
          "surgicalKit": {
            "type": "string"
          },
          "teethNumberingSystem": {
            "enum": [
              "FDI",
              "Universal"
            ],
            "type": "string"
          },
          "upperSupportType": {
            "enum": [
              "tooth_supported",
              "tissue_supported",
              "bone_supported",
              "bone_reduction_tooth",
              "bone_reduction_bone",
              "bone_reduction_nasal"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Patient": {
        "additionalProperties": false,
        "properties": {
          "AssigneeId": {
            "type": "string"
          },
          "age": {
            "format": "double",
            "type": "number"
          },
          "birthDate": {
            "format": "date-time",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfo"
            },
            "type": "array"
          },
          "firstName": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          },
          "id": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "plans": {
            "items": {
              "$ref": "#/components/schemas/Plan"
            },
            "type": "array"
          },
          "practicePatientId": {
            "type": "string"
          },
          "readableId": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "createdAt",
          "updatedAt",
          "firstName",
          "lastName",
          "gender",
          "birthDate",
          "AssigneeId",
          "workspaceId",
          "filesInfo",
          "plans",
          "age"
        ],
        "type": "object"
      },
      "PatientCreateDTO": {
        "$ref": "#/components/schemas/Omit_PatientCreateInput.plans-or-workspaceId_"
      },
      "PatientDisclosure": {
        "enum": [
          "FULL",
          "ANONYMOUS"
        ],
        "type": "string"
      },
      "PatientDisclosureDTO": {
        "description": "FULL includes demographics. ANONYMOUS redacts identifying and demographic fields.",
        "enum": [
          "FULL",
          "ANONYMOUS"
        ],
        "type": "string"
      },
      "PatientListQueryDTO": {
        "additionalProperties": false,
        "properties": {
          "birthDate": {
            "format": "date",
            "type": "string"
          },
          "firstName": {
            "maxLength": 30,
            "type": "string"
          },
          "lastName": {
            "maxLength": 30,
            "type": "string"
          },
          "limit": {
            "format": "int32",
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "q": {
            "maxLength": 100,
            "type": "string"
          },
          "skip": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "sort.field": {
            "$ref": "#/components/schemas/PatientSortField"
          },
          "sort.order": {
            "default": "desc",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PatientPolicyEntryDTO": {
        "additionalProperties": false,
        "description": "One patient entry in a PATIENTS policy.",
        "properties": {
          "disclosure": {
            "$ref": "#/components/schemas/PatientDisclosureDTO",
            "description": "Controls whether identifying fields are disclosed.",
            "example": "FULL"
          },
          "patientId": {
            "description": "Patient ID belonging to the workspace in the request path.",
            "example": "64f1c2a7e4b0f123456789ab",
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/PatientScopeDTO",
            "description": "Patient-wide or selected-file access definition."
          }
        },
        "required": [
          "patientId",
          "disclosure",
          "scope"
        ],
        "type": "object"
      },
      "PatientScope": {
        "anyOf": [
          {
            "properties": {
              "access": {
                "$ref": "#/components/schemas/AccessLevel"
              },
              "expiresAt": {
                "format": "date-time",
                "type": "string"
              },
              "mode": {
                "enum": [
                  "PATIENT"
                ],
                "nullable": false,
                "type": "string"
              }
            },
            "required": [
              "access",
              "mode"
            ],
            "type": "object"
          },
          {
            "properties": {
              "files": {
                "items": {
                  "properties": {
                    "access": {
                      "$ref": "#/components/schemas/AccessLevel"
                    },
                    "expiresAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "fileId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "access",
                    "fileId"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "mode": {
                "enum": [
                  "FILES"
                ],
                "nullable": false,
                "type": "string"
              }
            },
            "required": [
              "files",
              "mode"
            ],
            "type": "object"
          }
        ]
      },
      "PatientScopeDTO": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/WholePatientScopeDTO"
          },
          {
            "$ref": "#/components/schemas/SelectedFilesScopeDTO"
          }
        ],
        "description": "Patient-wide and selected-file scopes have different required fields."
      },
      "PatientSortField": {
        "enum": [
          "practicePatientId",
          "firstName",
          "birthDate",
          "updatedAt"
        ],
        "type": "string"
      },
      "PatientUpdateDTO": {
        "$ref": "#/components/schemas/Partial_Omit_PatientCreateDTO.workspaceId__"
      },
      "PatientsSharingPolicyDTO": {
        "additionalProperties": false,
        "description": "Shares only explicitly listed patients and files.",
        "properties": {
          "mode": {
            "enum": [
              "PATIENTS"
            ],
            "nullable": false,
            "type": "string"
          },
          "patients": {
            "description": "At least one patient entry is required. Duplicate entries are canonicalized.",
            "items": {
              "$ref": "#/components/schemas/PatientPolicyEntryDTO"
            },
            "type": "array"
          }
        },
        "required": [
          "mode",
          "patients"
        ],
        "type": "object"
      },
      "Pick_CommitCreateInput.Exclude_keyofCommitCreateInput.committer__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/CommitAction"
          },
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfoCreateInput"
            },
            "type": "array"
          },
          "patientId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "filesInfo",
          "patientId",
          "workspaceId",
          "action"
        ],
        "type": "object"
      },
      "Pick_FileInfo.Exclude_keyofFileInfo.lastUpdated-or-size__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "fileId": {
            "type": "string"
          },
          "flags": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "relativePath": {
            "type": "string"
          }
        },
        "required": [
          "hash",
          "relativePath"
        ],
        "type": "object"
      },
      "Pick_IngestRequestDTO.transactions_": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "transactions": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ExportTransaction"
                },
                {
                  "$ref": "#/components/schemas/BridgeExportTransaction"
                }
              ]
            },
            "type": "array"
          }
        },
        "required": [
          "transactions"
        ],
        "type": "object"
      },
      "Pick_Patient.Exclude_keyofPatient.filesInfo-or-plans__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "AssigneeId": {
            "type": "string"
          },
          "age": {
            "format": "double",
            "type": "number"
          },
          "birthDate": {
            "format": "date-time",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          },
          "id": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "practicePatientId": {
            "type": "string"
          },
          "readableId": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "updatedAt",
          "createdAt",
          "id",
          "firstName",
          "lastName",
          "gender",
          "birthDate",
          "AssigneeId",
          "workspaceId",
          "age"
        ],
        "type": "object"
      },
      "Pick_PatientCreateInput.Exclude_keyofPatientCreateInput.plans-or-workspaceId__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "AssigneeId": {
            "type": "string"
          },
          "birthDate": {
            "format": "date-time",
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          },
          "lastName": {
            "type": "string"
          },
          "practicePatientId": {
            "type": "string"
          },
          "readableId": {
            "type": "string"
          }
        },
        "required": [
          "firstName",
          "lastName",
          "gender",
          "birthDate",
          "AssigneeId"
        ],
        "type": "object"
      },
      "Pick_Plan.Exclude_keyofPlan.createdAt-or-thumbnailUrl-or-filesInfo__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "teethNumbers": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "thumbnailFile": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "updatedAt",
          "id",
          "name",
          "teethNumbers"
        ],
        "type": "object"
      },
      "Pick_Plan.Exclude_keyofPlan.createdAt-or-updatedAt-or-thumbnailUrl-or-filesInfo__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "teethNumbers": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "thumbnailFile": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "teethNumbers"
        ],
        "type": "object"
      },
      "Pick_Plan.Exclude_keyofPlan.filesInfo__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "teethNumbers": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "thumbnailFile": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "updatedAt",
          "createdAt",
          "id",
          "name",
          "teethNumbers"
        ],
        "type": "object"
      },
      "Pick_PurchaseActivity.Exclude_keyofPurchaseActivity.type-or-platform-or-userEmail-or-userFullName-or-userIp-or-reqOrigin__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "credits": {
            "properties": {
              "quantity": {
                "format": "double",
                "type": "number"
              },
              "unitPrice": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "unitPrice",
              "quantity"
            ],
            "type": "object"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "failureCode": {
            "format": "double",
            "type": "number"
          },
          "failureReason": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "referenceId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PurchaseStatus"
          },
          "totalCost": {
            "format": "double",
            "type": "number"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "userId",
          "status",
          "orderId",
          "referenceId",
          "currency",
          "totalCost",
          "credits"
        ],
        "type": "object"
      },
      "Pick_ShareInfo.Exclude_keyofShareInfo.receivers__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "anonymousPatient": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfo"
            },
            "type": "array"
          },
          "filesPaths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "patient": {
            "properties": {
              "age": {
                "format": "double",
                "type": "number"
              },
              "assigneeFullName": {
                "type": "string"
              },
              "birthDate": {
                "type": "string"
              },
              "firstName": {
                "type": "string"
              },
              "gender": {
                "type": "string"
              },
              "lastName": {
                "type": "string"
              }
            },
            "required": [
              "assigneeFullName",
              "birthDate",
              "gender",
              "age",
              "lastName",
              "firstName"
            ],
            "type": "object"
          },
          "patientId": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "anonymousPatient",
          "filesPaths"
        ],
        "type": "object"
      },
      "Pick_UserAccount.Exclude_keyofUserAccount.creditGrants__": {
        "description": "From T, pick a set of properties whose keys are in the union K",
        "properties": {
          "email": {
            "type": "string"
          },
          "freeTrialEnd": {
            "format": "date-time",
            "type": "string"
          },
          "freeTrialStart": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "registrationInfo": {
            "properties": {
              "country": {
                "type": "string"
              },
              "countryCode": {
                "type": "string"
              },
              "origin": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              }
            },
            "required": [
              "phone",
              "origin"
            ],
            "type": "object"
          }
        },
        "required": [
          "id",
          "email"
        ],
        "type": "object"
      },
      "Plan": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfo"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "teethNumbers": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "thumbnailFile": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "createdAt",
          "updatedAt",
          "name",
          "teethNumbers",
          "filesInfo"
        ],
        "type": "object"
      },
      "PlanCreateInput": {
        "$ref": "#/components/schemas/Omit_Plan.createdAt-or-updatedAt-or-thumbnailUrl-or-filesInfo_"
      },
      "PlanUpdateInput": {
        "$ref": "#/components/schemas/Omit_Plan.createdAt-or-thumbnailUrl-or-filesInfo_"
      },
      "ProcessEmailOutboxResponseDTO": {
        "additionalProperties": false,
        "description": "Result of an administrative invitation-delivery retry batch.",
        "properties": {
          "processed": {
            "description": "Number of invitation emails successfully sent in this batch.",
            "example": 3,
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "processed"
        ],
        "type": "object"
      },
      "ProcessRequestAdvancedDTO": {
        "properties": {
          "exportMarginOnly": {
            "type": "boolean"
          },
          "files": {
            "description": "If files are provided, then they are uploaded to to glidewell storages",
            "items": {
              "$ref": "#/components/schemas/ScanFileData"
            },
            "minItems": 2,
            "type": "array"
          },
          "materialParameters": {
            "items": {
              "properties": {
                "name": {
                  "$ref": "#/components/schemas/MaterialParameter"
                },
                "value": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "value",
                "name"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          },
          "parameters": {
            "deprecated": true,
            "properties": {
              "cementGapVertical": {
                "format": "double",
                "type": "number"
              },
              "minimumThickness": {
                "format": "double",
                "type": "number"
              }
            },
            "type": "object"
          },
          "products": {
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "maxItems": 32,
            "minItems": 1,
            "type": "array"
          },
          "referenceId": {
            "type": "string"
          }
        },
        "required": [
          "products",
          "referenceId"
        ],
        "type": "object"
      },
      "ProcessRequestDTO": {
        "properties": {
          "exportMarginOnly": {
            "type": "boolean"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/ScanFileData"
            },
            "type": "array"
          },
          "products": {
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "type": "array"
          },
          "referenceId": {
            "type": "string"
          },
          "taskId": {
            "type": "string"
          }
        },
        "required": [
          "files",
          "products",
          "taskId"
        ],
        "type": "object"
      },
      "Product": {
        "anyOf": [
          {
            "properties": {
              "tooth": {
                "$ref": "#/components/schemas/FDITooth"
              },
              "type": {
                "enum": [
                  "FullCrown",
                  "Inlay",
                  "Veneer",
                  "Implant"
                ],
                "type": "string"
              }
            },
            "required": [
              "tooth",
              "type"
            ],
            "type": "object"
          },
          {
            "properties": {
              "teeth": {
                "items": {
                  "properties": {
                    "number": {
                      "$ref": "#/components/schemas/FDITooth"
                    },
                    "type": {
                      "enum": [
                        "FullCrown",
                        "Pontic"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "number"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "type": {
                "enum": [
                  "Bridge"
                ],
                "nullable": false,
                "type": "string"
              }
            },
            "required": [
              "teeth",
              "type"
            ],
            "type": "object"
          }
        ]
      },
      "ProductsEventsPrice": {
        "properties": {
          "event": {
            "$ref": "#/components/schemas/BillingEvent"
          },
          "priceByCredits": {
            "format": "double",
            "type": "number"
          },
          "productId": {
            "type": "string"
          }
        },
        "required": [
          "priceByCredits",
          "event",
          "productId"
        ],
        "type": "object"
      },
      "PurchaseResponseDTO": {
        "$ref": "#/components/schemas/Omit_PurchaseActivity.type-or-platform-or-userEmail-or-userFullName-or-userIp-or-reqOrigin_"
      },
      "PurchaseStatus": {
        "enum": [
          "in-progress",
          "success",
          "failed"
        ],
        "type": "string"
      },
      "ReceiverShareInfo": {
        "additionalProperties": false,
        "properties": {
          "anonymousPatient": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfo"
            },
            "type": "array"
          },
          "filesPaths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "owner": {
            "properties": {
              "firstName": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "lastName": {
                "type": "string"
              },
              "workspaceId": {
                "type": "string"
              }
            },
            "required": [
              "workspaceId",
              "id"
            ],
            "type": "object"
          },
          "patient": {
            "properties": {
              "age": {
                "format": "double",
                "type": "number"
              },
              "assigneeFullName": {
                "type": "string"
              },
              "birthDate": {
                "type": "string"
              },
              "firstName": {
                "type": "string"
              },
              "gender": {
                "type": "string"
              },
              "lastName": {
                "type": "string"
              }
            },
            "required": [
              "assigneeFullName",
              "birthDate",
              "gender",
              "age",
              "lastName",
              "firstName"
            ],
            "type": "object"
          },
          "patientId": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "anonymousPatient",
          "filesPaths",
          "owner"
        ],
        "type": "object"
      },
      "Record_string.unknown_": {
        "additionalProperties": {},
        "description": "Construct a type with a set of properties K of type T",
        "properties": {},
        "type": "object"
      },
      "ScanFileData": {
        "properties": {
          "bucket": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "bucket",
          "name"
        ],
        "type": "object"
      },
      "SelectedFilesScopeDTO": {
        "additionalProperties": false,
        "description": "Grants access only to the listed stable file IDs.",
        "properties": {
          "files": {
            "description": "At least one file grant is required.",
            "items": {
              "$ref": "#/components/schemas/FileScopeDTO"
            },
            "type": "array"
          },
          "mode": {
            "description": "Selects per-file access.",
            "enum": [
              "FILES"
            ],
            "nullable": false,
            "type": "string"
          }
        },
        "required": [
          "mode",
          "files"
        ],
        "type": "object"
      },
      "SenderShareInfo": {
        "additionalProperties": false,
        "properties": {
          "anonymousPatient": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "filesInfo": {
            "items": {
              "$ref": "#/components/schemas/FileInfo"
            },
            "type": "array"
          },
          "filesPaths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "patient": {
            "properties": {
              "age": {
                "format": "double",
                "type": "number"
              },
              "assigneeFullName": {
                "type": "string"
              },
              "birthDate": {
                "type": "string"
              },
              "firstName": {
                "type": "string"
              },
              "gender": {
                "type": "string"
              },
              "lastName": {
                "type": "string"
              }
            },
            "required": [
              "assigneeFullName",
              "birthDate",
              "gender",
              "age",
              "lastName",
              "firstName"
            ],
            "type": "object"
          },
          "patientId": {
            "type": "string"
          },
          "receivers": {
            "items": {
              "$ref": "#/components/schemas/UserData"
            },
            "type": "array"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "patientId",
          "anonymousPatient",
          "filesPaths",
          "receivers"
        ],
        "type": "object"
      },
      "ShareAgreementListQueryDTO": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "default": 100,
            "description": "Maximum records to return.",
            "format": "int32",
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "skip": {
            "default": 0,
            "description": "Number of matching records to skip.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "sort.field": {
            "$ref": "#/components/schemas/ShareAgreementSortFieldDTO",
            "description": "Field used for sorting."
          },
          "sort.order": {
            "default": "desc",
            "description": "Sort direction.",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ShareAgreementStatus",
            "description": "Restrict results to one agreement status."
          }
        },
        "type": "object"
      },
      "ShareAgreementSortFieldDTO": {
        "enum": [
          "createdAt",
          "updatedAt",
          "status",
          "normalizedRecipientEmail"
        ],
        "type": "string"
      },
      "ShareAgreementStatus": {
        "description": "PENDING awaits recipient claim; ACTIVE grants policy access; REVOKED permanently denies access until reactivation.",
        "enum": [
          "PENDING",
          "ACTIVE",
          "REVOKED"
        ],
        "type": "string"
      },
      "ShareAgreementV2": {
        "additionalProperties": false,
        "properties": {
          "accessEndsAt": {
            "description": "Latest finite scope expiry, or null when any effective scope has no expiry.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "description": "Agreement creation time.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "Share agreement ID.",
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "invitationResendCount": {
            "format": "double",
            "type": "number"
          },
          "invitationSentAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastInvitationDeliveryId": {
            "type": "string"
          },
          "lastInvitationDeliveryStatus": {
            "enum": [
              "PENDING",
              "SENT",
              "FAILED"
            ],
            "type": "string"
          },
          "normalizedRecipientEmail": {
            "description": "Trimmed lowercase recipient email used for invitation matching.",
            "type": "string"
          },
          "ownerUserId": {
            "description": "User who owns and manages the agreement.",
            "type": "string"
          },
          "policy": {
            "$ref": "#/components/schemas/SharingPolicy",
            "description": "Canonical effective access policy."
          },
          "recipientUserId": {
            "description": "Bound recipient after registration/claim.",
            "type": "string"
          },
          "revokedAt": {
            "description": "Time of the latest revocation.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ShareAgreementStatus",
            "description": "Current lifecycle status."
          },
          "updatedAt": {
            "description": "Last lifecycle or policy mutation time.",
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "Optimistic-concurrency version required by policy replacement and revocation.",
            "format": "double",
            "type": "number"
          },
          "workspaceId": {
            "description": "Workspace whose content is being shared.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspaceId",
          "ownerUserId",
          "normalizedRecipientEmail",
          "status",
          "version",
          "policy",
          "accessEndsAt",
          "invitationResendCount",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "ShareFilesDTO": {
        "properties": {
          "anonymousPatient": {
            "type": "boolean"
          },
          "filesPaths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "notes": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "receiversEmails": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "senderName": {
            "type": "string"
          }
        },
        "required": [
          "senderName",
          "anonymousPatient",
          "filesPaths",
          "receiversEmails",
          "patientId"
        ],
        "type": "object"
      },
      "SharedFileDTO": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FileInfo"
          },
          {
            "properties": {
              "capabilities": {
                "$ref": "#/components/schemas/FileOperationCapabilitiesDTO"
              },
              "fileId": {
                "type": "string"
              }
            },
            "required": [
              "capabilities",
              "fileId"
            ],
            "type": "object"
          }
        ]
      },
      "SharedPatientDTO": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Omit_Patient.filesInfo-or-plans_"
          },
          {
            "properties": {
              "capabilities": {
                "properties": {
                  "addFile": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "addFile"
                ],
                "type": "object"
              },
              "filesInfo": {
                "items": {
                  "$ref": "#/components/schemas/SharedFileDTO"
                },
                "type": "array"
              },
              "plans": {
                "items": {
                  "$ref": "#/components/schemas/SharedPlanDTO"
                },
                "type": "array"
              }
            },
            "required": [
              "capabilities",
              "plans",
              "filesInfo"
            ],
            "type": "object"
          }
        ]
      },
      "SharedPatientListQueryDTO": {
        "additionalProperties": false,
        "properties": {
          "limit": {
            "default": 100,
            "description": "Maximum authorized patients to return.",
            "format": "int32",
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "skip": {
            "default": 0,
            "description": "Number of authorized patients to skip.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "sort.field": {
            "default": "updatedAt",
            "description": "Field used for sorting.",
            "enum": [
              "createdAt",
              "updatedAt",
              "firstName",
              "lastName",
              "practicePatientId"
            ],
            "type": "string"
          },
          "sort.order": {
            "default": "desc",
            "description": "Sort direction.",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SharedPlanDTO": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Omit_Plan.filesInfo_"
          },
          {
            "properties": {
              "capabilities": {
                "properties": {
                  "addFile": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "addFile"
                ],
                "type": "object"
              },
              "filesInfo": {
                "items": {
                  "$ref": "#/components/schemas/SharedFileDTO"
                },
                "type": "array"
              }
            },
            "required": [
              "capabilities",
              "filesInfo"
            ],
            "type": "object"
          }
        ]
      },
      "SharedWorkspaceSummary": {
        "additionalProperties": false,
        "properties": {
          "accessEndsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "agreementId": {
            "description": "Agreement used when calling shared-content endpoints.",
            "type": "string"
          },
          "ownerUserId": {
            "type": "string"
          },
          "policy": {
            "$ref": "#/components/schemas/SharingPolicy",
            "description": "Effective policy for this recipient."
          },
          "status": {
            "$ref": "#/components/schemas/ShareAgreementStatus"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "workspaceId": {
            "description": "Owner workspace containing the shared content.",
            "type": "string"
          }
        },
        "required": [
          "agreementId",
          "workspaceId",
          "ownerUserId",
          "status",
          "policy",
          "accessEndsAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "SharingAuditEventType": {
        "enum": [
          "AGREEMENT_CREATED",
          "AGREEMENT_REACTIVATED",
          "AGREEMENT_REVOKED",
          "INVITATION_CLAIMED",
          "INVITATION_RESENT",
          "INVITATION_DELIVERY_SENT",
          "INVITATION_DELIVERY_FAILED",
          "POLICY_UPDATED",
          "SCOPE_EXPIRED",
          "CONTENT_READ",
          "CONTENT_WRITE",
          "ACCESS_DENIED",
          "DOWNLOAD_URL_ISSUED",
          "UPLOAD_URL_ISSUED",
          "UPLOAD_COMMITTED",
          "UPLOAD_COMMIT_FAILED",
          "FILE_REPLACED",
          "FILE_RENAMED",
          "FILE_DELETED"
        ],
        "type": "string"
      },
      "SharingAuditEventV2": {
        "additionalProperties": false,
        "properties": {
          "actorUserId": {
            "type": "string"
          },
          "agreementId": {
            "type": "string"
          },
          "agreementVersion": {
            "format": "double",
            "type": "number"
          },
          "correlationId": {
            "type": "string"
          },
          "decision": {
            "description": "Authorization decision associated with the event.",
            "enum": [
              "ALLOW",
              "DENY"
            ],
            "type": "string"
          },
          "eventType": {
            "$ref": "#/components/schemas/SharingAuditEventType",
            "description": "Type of agreement, access, delivery, or content event."
          },
          "failureDetails": {
            "type": "string"
          },
          "fileId": {
            "type": "string"
          },
          "id": {
            "description": "Immutable audit-event ID.",
            "type": "string"
          },
          "ipAddress": {
            "type": "string"
          },
          "outcome": {
            "description": "SUCCESS when the requested action completed; FAILURE when it was denied or failed.",
            "enum": [
              "SUCCESS",
              "FAILURE"
            ],
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "policyDiff": {
            "$ref": "#/components/schemas/Record_string.unknown_"
          },
          "reasonCode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuthorizationDecisionReason"
              },
              {
                "type": "string"
              }
            ],
            "description": "Machine-readable authorization or outcome reason."
          },
          "recipientUserId": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "timestamp": {
            "description": "Server timestamp for the event.",
            "format": "date-time",
            "type": "string"
          },
          "transferId": {
            "type": "string"
          },
          "userAgent": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspaceId",
          "actorUserId",
          "eventType",
          "decision",
          "reasonCode",
          "timestamp",
          "outcome"
        ],
        "type": "object"
      },
      "SharingAuditListQueryDTO": {
        "additionalProperties": false,
        "properties": {
          "agreementId": {
            "type": "string"
          },
          "decision": {
            "enum": [
              "ALLOW",
              "DENY"
            ],
            "type": "string"
          },
          "eventType": {
            "$ref": "#/components/schemas/SharingAuditEventType"
          },
          "fileId": {
            "type": "string"
          },
          "from": {
            "description": "Inclusive ISO 8601 lower timestamp bound.",
            "example": "2026-08-01T00:00:00.000Z",
            "type": "string"
          },
          "limit": {
            "default": 100,
            "description": "Maximum events to return.",
            "format": "int32",
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "patientId": {
            "type": "string"
          },
          "recipientUserId": {
            "type": "string"
          },
          "skip": {
            "default": 0,
            "description": "Number of matching events to skip.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "sort.field": {
            "$ref": "#/components/schemas/SharingAuditSortFieldDTO",
            "description": "Field used for sorting."
          },
          "sort.order": {
            "default": "desc",
            "description": "Sort direction.",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          },
          "to": {
            "description": "Inclusive ISO 8601 upper timestamp bound.",
            "example": "2026-08-31T23:59:59.999Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SharingAuditSortFieldDTO": {
        "enum": [
          "timestamp",
          "eventType",
          "decision",
          "createdAt"
        ],
        "type": "string"
      },
      "SharingDataResponseDTO_Commit_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Commit",
            "description": "Operation result. Collections are always represented as arrays here."
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_GetDownloadUrlsResponseDTO-and-_fileId-string--transferId-string--expiresInSeconds-number__": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GetDownloadUrlsResponseDTO"
              },
              {
                "properties": {
                  "expiresInSeconds": {
                    "format": "double",
                    "type": "number"
                  },
                  "fileId": {
                    "type": "string"
                  },
                  "transferId": {
                    "type": "string"
                  }
                },
                "required": [
                  "expiresInSeconds",
                  "transferId",
                  "fileId"
                ],
                "type": "object"
              }
            ],
            "description": "Operation result. Collections are always represented as arrays here."
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_GetUploadUrlsResponseDTO-Array_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "description": "Operation result. Collections are always represented as arrays here.",
            "items": {
              "$ref": "#/components/schemas/GetUploadUrlsResponseDTO"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_ProcessEmailOutboxResponseDTO_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ProcessEmailOutboxResponseDTO",
            "description": "Operation result. Collections are always represented as arrays here."
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_ShareAgreementV2-Array_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "description": "Operation result. Collections are always represented as arrays here.",
            "items": {
              "$ref": "#/components/schemas/ShareAgreementV2"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_ShareAgreementV2_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ShareAgreementV2",
            "description": "Operation result. Collections are always represented as arrays here."
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_SharedPatientDTO_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SharedPatientDTO",
            "description": "Operation result. Collections are always represented as arrays here."
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_SharedPlanDTO-Array_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "description": "Operation result. Collections are always represented as arrays here.",
            "items": {
              "$ref": "#/components/schemas/SharedPlanDTO"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingDataResponseDTO_SharedWorkspaceSummary-Array_": {
        "additionalProperties": false,
        "description": "Every successful Sharing V2 response uses this envelope, including collections.",
        "properties": {
          "data": {
            "description": "Operation result. Collections are always represented as arrays here.",
            "items": {
              "$ref": "#/components/schemas/SharedWorkspaceSummary"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "SharingErrorResponseDTO": {
        "additionalProperties": false,
        "description": "Standard error envelope returned by validation and domain failures.",
        "properties": {
          "details": {
            "description": "Optional field or policy-validation details."
          },
          "error": {
            "description": "Optional machine-readable application error code."
          },
          "message": {
            "description": "Human-readable error summary.",
            "example": "Agreement version mismatch",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "SharingPaginatedResponseDTO_ShareAgreementV2_": {
        "additionalProperties": false,
        "description": "Successful response for a paginated Sharing V2 collection.",
        "properties": {
          "data": {
            "description": "Records in the current page.",
            "items": {
              "$ref": "#/components/schemas/ShareAgreementV2"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/SharingPaginationDTO",
            "description": "Page request and total-result metadata."
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "SharingPaginatedResponseDTO_SharedPatientDTO_": {
        "additionalProperties": false,
        "description": "Successful response for a paginated Sharing V2 collection.",
        "properties": {
          "data": {
            "description": "Records in the current page.",
            "items": {
              "$ref": "#/components/schemas/SharedPatientDTO"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/SharingPaginationDTO",
            "description": "Page request and total-result metadata."
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "SharingPaginatedResponseDTO_SharingAuditEventV2_": {
        "additionalProperties": false,
        "description": "Successful response for a paginated Sharing V2 collection.",
        "properties": {
          "data": {
            "description": "Records in the current page.",
            "items": {
              "$ref": "#/components/schemas/SharingAuditEventV2"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/SharingPaginationDTO",
            "description": "Page request and total-result metadata."
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "SharingPaginationDTO": {
        "additionalProperties": false,
        "description": "Stable pagination metadata for Sharing V2 collection endpoints.",
        "properties": {
          "limit": {
            "description": "Maximum number of records requested.",
            "format": "double",
            "type": "number"
          },
          "skip": {
            "description": "Number of matching records skipped.",
            "format": "double",
            "type": "number"
          },
          "totalCount": {
            "description": "Total number of matching records before pagination.",
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "skip",
          "limit",
          "totalCount"
        ],
        "type": "object"
      },
      "SharingPolicy": {
        "anyOf": [
          {
            "properties": {
              "access": {
                "$ref": "#/components/schemas/AccessLevel"
              },
              "disclosure": {
                "$ref": "#/components/schemas/PatientDisclosure"
              },
              "expiresAt": {
                "format": "date-time",
                "type": "string"
              },
              "mode": {
                "enum": [
                  "WORKSPACE"
                ],
                "nullable": false,
                "type": "string"
              }
            },
            "required": [
              "disclosure",
              "access",
              "mode"
            ],
            "type": "object"
          },
          {
            "properties": {
              "mode": {
                "enum": [
                  "PATIENTS"
                ],
                "nullable": false,
                "type": "string"
              },
              "patients": {
                "items": {
                  "properties": {
                    "disclosure": {
                      "$ref": "#/components/schemas/PatientDisclosure"
                    },
                    "patientId": {
                      "type": "string"
                    },
                    "scope": {
                      "$ref": "#/components/schemas/PatientScope"
                    }
                  },
                  "required": [
                    "scope",
                    "disclosure",
                    "patientId"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "patients",
              "mode"
            ],
            "type": "object"
          }
        ]
      },
      "SharingPolicyDTO": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/WorkspaceSharingPolicyDTO"
          },
          {
            "$ref": "#/components/schemas/PatientsSharingPolicyDTO"
          }
        ],
        "description": "Exactly one policy mode must be supplied."
      },
      "StartFreeTrialRequestDTO": {
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "name"
        ],
        "type": "object"
      },
      "StartFreeTrialResponseDTO": {
        "properties": {
          "freeTrialEnd": {
            "format": "date-time",
            "type": "string"
          },
          "freeTrialStart": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "freeTrialEnd",
          "freeTrialStart"
        ],
        "type": "object"
      },
      "StripePaymentCard": {
        "properties": {
          "displayBrand": {
            "nullable": true,
            "type": "string"
          },
          "expMonth": {
            "format": "double",
            "type": "number"
          },
          "expYear": {
            "format": "double",
            "type": "number"
          },
          "last4": {
            "type": "string"
          }
        },
        "required": [
          "last4",
          "expYear",
          "expMonth",
          "displayBrand"
        ],
        "type": "object"
      },
      "StripePaymentMethod": {
        "properties": {
          "card": {
            "$ref": "#/components/schemas/StripePaymentCard"
          },
          "createdAt": {
            "format": "double",
            "type": "number"
          },
          "customerId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "isExpired": {
            "type": "boolean"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "isExpired",
          "isDefault",
          "name",
          "card",
          "type",
          "createdAt",
          "customerId",
          "id"
        ],
        "type": "object"
      },
      "TransactionsBalanceDetails": {
        "properties": {
          "availableCredits": {
            "format": "double",
            "type": "number"
          },
          "eventsCost": {
            "items": {
              "$ref": "#/components/schemas/IngestEventCost"
            },
            "type": "array"
          },
          "requiredCredits": {
            "format": "double",
            "type": "number"
          },
          "uncoveredEvents": {
            "items": {
              "$ref": "#/components/schemas/IngestEventCost"
            },
            "type": "array"
          }
        },
        "required": [
          "uncoveredEvents",
          "eventsCost",
          "availableCredits",
          "requiredCredits"
        ],
        "type": "object"
      },
      "UpdateSharePolicyDTO": {
        "additionalProperties": false,
        "description": "Replaces the complete policy of an existing agreement.",
        "properties": {
          "policy": {
            "$ref": "#/components/schemas/SharingPolicyDTO"
          }
        },
        "required": [
          "policy"
        ],
        "type": "object"
      },
      "UserAccountResponse": {
        "$ref": "#/components/schemas/Omit_UserAccount.creditGrants_"
      },
      "UserData": {
        "properties": {
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "workspaceId": {
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "UserProfile": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string"
          },
          "familyName": {
            "type": "string"
          },
          "givenName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "profileCompleted": {
            "type": "boolean"
          },
          "registeredFrom": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "status",
          "profileCompleted"
        ],
        "type": "object"
      },
      "V2CommitFilesDTO": {
        "additionalProperties": false,
        "description": "Commits one or more authorized file changes as a new content version.",
        "properties": {
          "changes": {
            "description": "Non-empty ordered list of file operations.",
            "items": {
              "$ref": "#/components/schemas/V2FileChangeDTO"
            },
            "type": "array"
          },
          "patientId": {
            "description": "Patient receiving the changes.",
            "type": "string"
          },
          "planId": {
            "description": "Optional plan scope. Omit to modify patient-level files.",
            "type": "string"
          }
        },
        "required": [
          "patientId",
          "changes"
        ],
        "type": "object"
      },
      "V2FileChangeDTO": {
        "additionalProperties": false,
        "description": "One atomic metadata change in a V2 file commit.",
        "properties": {
          "fileId": {
            "description": "Required for REPLACE, RENAME, and DELETE. Omit for ADD.",
            "type": "string"
          },
          "hash": {
            "description": "Uploaded content hash; required for ADD and REPLACE.",
            "example": "4d967f...",
            "type": "string"
          },
          "newRelativePath": {
            "description": "Required destination path for RENAME.",
            "example": "scans/upper-final.stl",
            "type": "string"
          },
          "operation": {
            "$ref": "#/components/schemas/V2FileChangeOperationDTO",
            "description": "ADD creates a stable file ID; other operations target an existing file ID."
          },
          "relativePath": {
            "description": "ADD/REPLACE destination path; for RENAME this is the current/fallback path.",
            "example": "scans/upper.stl",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "relativePath"
        ],
        "type": "object"
      },
      "V2FileChangeOperationDTO": {
        "enum": [
          "ADD",
          "REPLACE",
          "RENAME",
          "DELETE"
        ],
        "type": "string"
      },
      "V2UploadFileDTO": {
        "additionalProperties": false,
        "description": "One file for which an upload URL may be issued.",
        "properties": {
          "hash": {
            "description": "SHA-256/content hash used as the blob key.",
            "example": "4d967f...",
            "type": "string"
          },
          "relativePath": {
            "description": "Client-visible relative path.",
            "example": "scans/upper.stl",
            "type": "string"
          }
        },
        "required": [
          "hash",
          "relativePath"
        ],
        "type": "object"
      },
      "V2UploadUrlsRequestDTO": {
        "additionalProperties": false,
        "description": "Requests short-lived upload URLs. Uploading does not change patient metadata until commit succeeds.",
        "properties": {
          "fileId": {
            "description": "Required for REPLACE and forbidden for ADD.",
            "type": "string"
          },
          "filesInfo": {
            "description": "Files to upload. An empty list returns an empty response.",
            "items": {
              "$ref": "#/components/schemas/V2UploadFileDTO"
            },
            "type": "array"
          },
          "operation": {
            "description": "ADD creates content and requires MANAGE_CONTENT; REPLACE requires UPDATE_EXISTING.",
            "enum": [
              "ADD",
              "REPLACE"
            ],
            "type": "string"
          },
          "planId": {
            "description": "Optional plan scope. Omit for patient-level files.",
            "type": "string"
          }
        },
        "required": [
          "operation",
          "filesInfo"
        ],
        "type": "object"
      },
      "WholePatientScopeDTO": {
        "additionalProperties": false,
        "description": "Grants access to the patient and all of the patient's current content.",
        "properties": {
          "access": {
            "$ref": "#/components/schemas/AccessLevelDTO",
            "description": "Access granted across the patient.",
            "example": "READ"
          },
          "expiresAt": {
            "description": "Optional ISO 8601 expiry for this patient scope.",
            "example": "2030-01-01T00:00:00.000Z",
            "type": "string"
          },
          "mode": {
            "description": "Selects patient-wide access.",
            "enum": [
              "PATIENT"
            ],
            "nullable": false,
            "type": "string"
          }
        },
        "required": [
          "mode",
          "access"
        ],
        "type": "object"
      },
      "Workspace": {
        "additionalProperties": false,
        "properties": {
          "allowVersioning": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "myShares": {
            "items": {
              "$ref": "#/components/schemas/MySharedData"
            },
            "type": "array"
          },
          "owner": {
            "type": "string"
          },
          "patientsCounter": {
            "format": "double",
            "type": "number"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "workspacesSharingWithMe": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "createdAt",
          "updatedAt",
          "owner",
          "patientsCounter"
        ],
        "type": "object"
      },
      "WorkspaceSharingPolicyDTO": {
        "additionalProperties": false,
        "description": "Shares every patient in the workspace, including patients created later.",
        "properties": {
          "access": {
            "$ref": "#/components/schemas/AccessLevelDTO",
            "description": "Access granted throughout the workspace.",
            "example": "READ"
          },
          "disclosure": {
            "$ref": "#/components/schemas/PatientDisclosureDTO",
            "description": "Disclosure applied to every patient.",
            "example": "FULL"
          },
          "expiresAt": {
            "description": "Optional ISO 8601 expiry for the workspace grant.",
            "example": "2030-01-01T00:00:00.000Z",
            "type": "string"
          },
          "mode": {
            "enum": [
              "WORKSPACE"
            ],
            "nullable": false,
            "type": "string"
          }
        },
        "required": [
          "mode",
          "access",
          "disclosure"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "jwt_auth": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "contact": {},
    "license": {
      "name": "ISC"
    },
    "title": "case-manager-server",
    "version": "1.0.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/v1/ai/info/{referenceId}/{taskId}": {
      "get": {
        "description": "Used to retrieve case information and scan and design files information",
        "operationId": "GetCaseInfo",
        "parameters": [
          {
            "description": "-case reference ID",
            "in": "path",
            "name": "referenceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "- case task ID",
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCaseDataResponse"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "description": "- Case still under processing, or \n - Missing or invalid desktop app info header"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "- Case is not owned by this user, or \n - Unauthorized desktop client app version"
          },
          "404": {
            "description": "- Couldn't find case meta data, or \n - Couldn't find any of scan files"
          },
          "500": {
            "description": "Unhandled internal server error"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "AI"
        ]
      }
    },
    "/v1/ai/meta-data/{referenceId}": {
      "post": {
        "operationId": "SetMetaData",
        "parameters": [
          {
            "in": "path",
            "name": "referenceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseMetaData"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "description": "Missing or invalid desktop app info header"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "Unauthorized desktop client app version"
          },
          "500": {
            "description": "Unhandled internal server error"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "AI"
        ]
      }
    },
    "/v1/ai/process": {
      "post": {
        "operationId": "Process",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "files": [
                  {
                    "bucket": "external-runner-prod",
                    "key": "ce7e16ac-4938-4bf9-b931-28ee805840b2/input/lower.ply",
                    "name": "lower.ply"
                  },
                  {
                    "bucket": "external-runner-prod",
                    "key": "ce7e16ac-4938-4bf9-b931-28ee805840b2/input/upper.ply",
                    "name": "upper.ply"
                  }
                ],
                "products": [
                  {
                    "tooth": 11,
                    "type": "FullCrown"
                  },
                  {
                    "tooth": 13,
                    "type": "FullCrown"
                  },
                  {
                    "tooth": 22,
                    "type": "Inlay"
                  },
                  {
                    "teeth": [
                      {
                        "number": 33,
                        "type": "FullCrown"
                      },
                      {
                        "number": 34,
                        "type": "Pontic"
                      },
                      {
                        "number": 35,
                        "type": "Pontic"
                      },
                      {
                        "number": 36,
                        "type": "FullCrown"
                      }
                    ],
                    "type": "Bridge"
                  }
                ],
                "taskId": "111111111111111111111111"
              },
              "schema": {
                "$ref": "#/components/schemas/ProcessRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "taskId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "taskId"
                  ],
                  "type": "object"
                }
              }
            },
            "description": ""
          },
          "400": {
            "description": "Missing or invalid desktop app info header"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "Unauthorized desktop client app version"
          },
          "500": {
            "description": "Unhandled internal server error"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "AI"
        ]
      }
    },
    "/v1/ai/status/{taskId}": {
      "get": {
        "operationId": "GetTaskStatus",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetStatusResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "description": "Missing or invalid desktop app info header"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "Unauthorized desktop client app version"
          },
          "500": {
            "description": "Unhandled internal server error"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "AI"
        ]
      }
    },
    "/v1/ai/upload-urls": {
      "post": {
        "description": "Used to upload scan and margin files to start the AI workflow",
        "operationId": "GetScanFilesURLs",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": [
                "lower.ply",
                "upper.ply",
                "margin_line_ADA14.pts"
              ],
              "schema": {
                "description": "- scan input files",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            }
          },
          "description": "- scan input files",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAIFilesUploadUrlsResponseDTO"
                }
              }
            },
            "description": ""
          },
          "400": {
            "description": "Missing or invalid desktop app info header"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "Unauthorized desktop client app version"
          },
          "500": {
            "description": "Unhandled internal server error"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "AI"
        ]
      }
    },
    "/v1/ai/upload-urls/scan/{referenceId}": {
      "post": {
        "description": "Used to upload any ai files temporary external of glidewell storage",
        "operationId": "GetScanFilesUploadInfo",
        "parameters": [
          {
            "description": "-case reference ID",
            "in": "path",
            "name": "referenceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "- scan input files",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            }
          },
          "description": "- scan input files",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/AIFileUploadloadInfo"
                      },
                      {
                        "properties": {
                          "error": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "error"
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          },
          "400": {
            "description": "Missing or invalid desktop app info header"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "Unauthorized desktop client app version"
          },
          "500": {
            "description": "Unhandled internal server error"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "AI"
        ]
      }
    },
    "/v1/analytics/global/identify": {
      "post": {
        "operationId": "GlobalIdentify",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsUserRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "type": "string"
                }
              }
            },
            "description": "User identified"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [],
        "tags": [
          "Analytics"
        ]
      }
    },
    "/v1/analytics/global/track": {
      "post": {
        "operationId": "GlobalTrackEvent",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsEventRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "type": "string"
                }
              }
            },
            "description": "Event tracked"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Analytics"
        ]
      }
    },
    "/v1/analytics/identify": {
      "post": {
        "operationId": "Identify",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsUserRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "type": "string"
                }
              }
            },
            "description": "User identified"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [],
        "tags": [
          "Analytics"
        ]
      }
    },
    "/v1/analytics/track": {
      "post": {
        "operationId": "TrackEvent",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsEventRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "type": "string"
                }
              }
            },
            "description": "Event tracked"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Analytics"
        ]
      }
    },
    "/v1/billings/admin/plans": {
      "get": {
        "operationId": "ListPlans",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/BillingPlanWithCountries"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/admin/plans/{planId}": {
      "put": {
        "operationId": "UpdatePlan",
        "parameters": [
          {
            "in": "path",
            "name": "planId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BillingPlanUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPlan"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          },
          "404": {
            "description": "BILLING:PLAN_IS_NOT_EXIST"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/admin/products": {
      "get": {
        "operationId": "ListProducts",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/BillingProduct"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/admin/users/credits": {
      "post": {
        "operationId": "GrantCreditsByUserEmail",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "credits": {
                    "format": "double",
                    "type": "number"
                  },
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "credits",
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "double",
                  "type": "number"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "description": "USER_ACCOUNT:INVALID_CREDITS_QUANTITY"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          },
          "404": {
            "description": "USE_PROFILE:USER_NOT_FOUND"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/credits": {
      "get": {
        "operationId": "ListCreditGrants",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CreditGrant"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Array of credit grants info"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "description": "USER_ACCOUNT:USER_NOT_FOUND"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/credits/balance-check": {
      "post": {
        "operationId": "CheckBalance",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BalanceCheckRequestDTO",
                "description": "Array of billable metrics event name"
              }
            }
          },
          "description": "Array of billable metrics event name",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceCheckResponseDTO"
                }
              }
            },
            "description": "Object containing status of the ingest check"
          },
          "400": {
            "description": "BILLING:INVALID_PLAN_EVENT"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "description": "BILLING:CUSTOMER_HAS_NO_PLAN"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/credits/ingest": {
      "put": {
        "operationId": "Ingest",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestRequestDTO",
                "description": "Array of billable metrics event name"
              }
            }
          },
          "description": "Array of billable metrics event name",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestResponseDTO"
                }
              }
            },
            "description": "Array of transactions Ids"
          },
          "400": {
            "description": "BILLING:INSUFFICIENT_BALANCE"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "description": "BILLING:CUSTOMER_HAS_NO_PLAN"
          },
          "500": {
            "description": "BILLING:FAILED_TO_DEDUCT"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/customers": {
      "post": {
        "description": "Creates new user account and add to the corresponding billing plan\nand add him to appropriate plan based on his country",
        "operationId": "GetOrCreateCustomer",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAccountResponse"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/info": {
      "get": {
        "description": "Gets the total credits of a customer including\n- available and consumed credits\n- trial credits and their expiry date",
        "operationId": "GetCustomerCreditsInfo",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCustomerBillingInfoResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "description": "BILLING:CUSTOMER_HAS_NO_PLAN"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/settings": {
      "get": {
        "description": "Gets the customer's current plan settings for the authenticated user.",
        "operationId": "GetCustomerBillingSettings",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCustomerBillingSettingsResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/billings/trial": {
      "post": {
        "description": "Start free trial period for a customer",
        "operationId": "StartFreeTrial",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartFreeTrialRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartFreeTrialResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "description": "USER_ACCOUNT:USER_NOT_FOUND"
          },
          "500": {
            "description": "BILLING:FAILED_TO_START_FREE_TRIAL"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Billings"
        ]
      }
    },
    "/v1/files/commit-upload": {
      "post": {
        "operationId": "CommitUploadFiles",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommitUploadRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommitUploadResponseDTO"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "description": "Bad request, when all commit files are failed to be committed"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/download-urls": {
      "post": {
        "description": "\n* xx/1.txt        =>  file inside xx and called 1.txt\n\n* xx/* or xx/    => any file under xx folder or any of its sub folders\n\n* xx/*.dcm        => any file with dcm extension, under xx folder or any of its sub folders\n\n* xx              => file inside root, has no extension and called xx\n\n* /*.             => for no extension or file ends with dot for example test. test\n\n* xx/*.[txt,dcm]  => all files ending with text or dcm\n\n* xx/*.[txt,dcm,] => for txt or dicom or no extension",
        "operationId": "GetFilesDownloadUrls",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetDownloadUrlsRequestDTO",
                "description": "of type GetDownloadUrlsRequestDTO where relative paths as above"
              }
            }
          },
          "description": "of type GetDownloadUrlsRequestDTO where relative paths as above",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GetDownloadUrlsResponseDTO"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "description": "Bad request, when failed to get download urls for all files"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/files/upload-urls": {
      "post": {
        "operationId": "GetFilesUploadUrls",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetUploadUrlsRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GetUploadUrlsResponseDTO"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "description": "Bad request, when failed to get upload urls for all files"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Files"
        ]
      }
    },
    "/v1/orders/options": {
      "get": {
        "operationId": "ListOrderOptions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderOptions"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Orders"
        ]
      }
    },
    "/v1/patients/{patientId}/orders/drafts": {
      "post": {
        "operationId": "CreateDraft",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDraftOrderRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDraftOrderResponseDTO"
                }
              }
            },
            "description": "Created"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Orders"
        ]
      }
    },
    "/v1/payments/customers": {
      "post": {
        "operationId": "GetOrCreateCustomer",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCustomerDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/customers/{customerId}/cards": {
      "get": {
        "operationId": "GetCustomerCards",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/StripePaymentMethod"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      },
      "post": {
        "operationId": "AttachCardToCustomer",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "paymentId": {
                    "type": "string"
                  }
                },
                "required": [
                  "paymentId"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      },
      "put": {
        "operationId": "UpdateCustomerDefaultCard",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cardId": {
                    "type": "string"
                  }
                },
                "required": [
                  "cardId"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/customers/{customerId}/cards/{cardId}": {
      "delete": {
        "operationId": "DeleteCustomerCard",
        "parameters": [
          {
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "cardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/paytr/iframe-token": {
      "post": {
        "operationId": "CreatePayTrIFrameToken",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIFFrameTokenDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/paytr/notification": {
      "post": {
        "operationId": "NotifyPayment",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "description": "PAYMENT:IN_PROGRESS_TRANSACTION_NOT_FOUND_OR_HANDLED"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "500": {
            "description": "PAYMENT:FAILED_TO_PROCESS_PAYMENT"
          }
        },
        "security": [],
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/paytr/status/{referenceId}": {
      "get": {
        "operationId": "CheckPaymentStatus",
        "parameters": [
          {
            "in": "path",
            "name": "referenceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/payments/stripe/confirm": {
      "post": {
        "operationId": "ConfirmStripePayment",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmPaymentPayloadRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmPaymentPayloadResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Payments"
        ]
      }
    },
    "/v1/users-accounts": {
      "post": {
        "operationId": "GetOrCreateUserAccount",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAccountResponse"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "UsersAccounts"
        ]
      }
    },
    "/v1/users-accounts/admin": {
      "get": {
        "operationId": "Filter",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort.field",
            "required": false,
            "schema": {
              "enum": [
                "createdAt"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort.order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "registrationInfo.phone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "registrationInfo.origin",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "registrationInfo.country",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "registrationInfo.countryCode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "planId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterUsersResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "UsersAccounts"
        ]
      }
    },
    "/v1/users-accounts/admin/move-all-users-plan": {
      "put": {
        "operationId": "MoveAllUsersToPlan",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveAllUsersToPlanRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "double",
                  "type": "number"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "UsersAccounts"
        ]
      }
    },
    "/v1/users-accounts/admin/move-users-plan": {
      "put": {
        "operationId": "MoveUsersToPlan",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveUsersToPlanRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "double",
                  "type": "number"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "UsersAccounts"
        ]
      }
    },
    "/v1/users-activities/admin": {
      "get": {
        "operationId": "Filter",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort.field",
            "required": false,
            "schema": {
              "enum": [
                "createdAt"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort.order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PurchaseStatus"
            }
          },
          {
            "in": "query",
            "name": "planId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userEmail",
            "required": false,
            "schema": {
              "pattern": "^(.+)@(.+)$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ActivityType"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterActivitiesResponseDTO"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "FORBIDDEN_ACCESS_FOR_NON_ADMINS"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "UsersActivities"
        ]
      }
    },
    "/v1/users/client-app": {
      "get": {
        "operationId": "GetClientApp",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Ok"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/users/invalidate-user/{email}": {
      "get": {
        "operationId": "InvalidateUserProfile",
        "parameters": [
          {
            "in": "path",
            "name": "email",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deletedCount": {
                      "format": "double",
                      "type": "number"
                    }
                  },
                  "required": [
                    "deletedCount"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Ok"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/users/login": {
      "post": {
        "operationId": "Login",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "password",
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "token",
                    "id"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Ok"
          }
        },
        "security": [],
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/users/tokens": {
      "post": {
        "operationId": "CreateAPIToken",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "idToken": {
                    "type": "string"
                  },
                  "refreshToken": {
                    "type": "string"
                  }
                },
                "required": [
                  "idToken",
                  "refreshToken"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": ""
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "500": {
            "description": "Unable to create token"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/users/tokens/{userId}/{apiToken}": {
      "get": {
        "operationId": "GetJWTTokens",
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "apiToken",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accessToken": {
                      "type": "string"
                    },
                    "idToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "idToken",
                    "refreshToken",
                    "accessToken"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "Invalid api token"
          },
          "403": {
            "description": "Token is not owned by this user"
          },
          "404": {
            "description": "Can't find jwt tokens"
          },
          "500": {
            "description": "Unable to validate api token"
          }
        },
        "security": [],
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/workspaces": {
      "post": {
        "description": "Create a new workspace if the user in the call does not already have one,\nand return the existing workspace if it already exists.",
        "operationId": "CreateOrGetWorkspace",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Workspace"
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              }
            },
            "description": "Workspace data"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Workspaces"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/list-users": {
      "post": {
        "operationId": "ListUsersByEmail",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "emails": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "emails"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UserProfile"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/my-shares/{shareId}": {
      "get": {
        "description": "Get one of my patient's shares (which I have shared with others), by share id",
        "operationId": "GetMyShareById",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shareId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SenderShareInfo"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Workspaces"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/patient/{patientId}": {
      "delete": {
        "operationId": "Delete",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Patient"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          },
          "404": {
            "description": "Patient not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Patients"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/patients": {
      "get": {
        "operationId": "List",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Patient"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Patients"
        ]
      },
      "post": {
        "operationId": "Create",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientCreateDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Patient"
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              }
            },
            "description": "Created - practicePatientId or readableId will be autogenerated if they are empty string or undefined"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          },
          "409": {
            "description": "When practicePatientId or readableId already exist"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Patients"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/patients/readable-id/{readableId}": {
      "get": {
        "operationId": "GetByReadableId",
        "parameters": [
          {
            "in": "path",
            "name": "readableId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Patient"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          },
          "404": {
            "description": "Patient not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Patients"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/patients/{patientId}": {
      "get": {
        "operationId": "Get",
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Patient"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          },
          "404": {
            "description": "Patient not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Patients"
        ]
      },
      "put": {
        "operationId": "Update",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientUpdateDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Patient"
                }
              }
            },
            "description": "Updated- practicePatientId or readableId will be autogenerated if they are empty string"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          },
          "404": {
            "description": "Patient not found"
          },
          "409": {
            "description": "practicePatientId or readableId already exist"
          },
          "422": {
            "description": "Validation failed"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Patients"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/patients/{patientId}/plans": {
      "get": {
        "operationId": "List",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Plan"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Plans"
        ]
      },
      "post": {
        "operationId": "Create",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanCreateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plan"
                }
              }
            },
            "description": "Created"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Plans"
        ]
      },
      "put": {
        "operationId": "Update",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanUpdateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plan"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Plans"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/patients/{patientId}/plans/{planId}/download-urls": {
      "get": {
        "operationId": "ListAllPlanFiles",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "planId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GetDownloadUrlsResponseDTO"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Plans"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/senders/{senderWorkspaceId}/shares/{shareId}": {
      "get": {
        "description": "Get one of sender patient's shares (which some one shared with me), by share id",
        "operationId": "GetShareById",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "senderWorkspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "shareId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiverShareInfo"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Workspaces"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/shares": {
      "get": {
        "description": "List my shares (myShares) and shared with (sharedWithMe) me info",
        "operationId": "GetAllSharedCases",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "myShares": {
                      "items": {
                        "$ref": "#/components/schemas/SenderShareInfo"
                      },
                      "type": "array"
                    },
                    "sharedWithMe": {
                      "items": {
                        "$ref": "#/components/schemas/ReceiverShareInfo"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "myShares",
                    "sharedWithMe"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Workspaces"
        ]
      },
      "post": {
        "description": "Share a patient's file(s) in the current workspace with other users' workspaces.\nIf these users are not registered with Atomica invitation emails will be sent to sign up or to complete their profiles",
        "operationId": "ShareFiles",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareFilesDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "invitedUsers": {
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/InvitedUser"
                          }
                        ],
                        "nullable": true
                      },
                      "type": "array"
                    },
                    "ownerWorkspace": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Workspace"
                        }
                      ],
                      "nullable": true
                    },
                    "sharedWorkspacesIds": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "invitedUsers",
                    "sharedWorkspacesIds",
                    "ownerWorkspace"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "It returns a new object of the current workspace,\nthe workspace ID for each receiver who is an Atomica user,\nand a list of receivers's data who are not registered but have been invited."
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Workspaces"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/unshare": {
      "post": {
        "description": "Unshare data with some users",
        "operationId": "UnshareFiles",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "sharedDataId": {
                    "type": "string"
                  },
                  "usersEmails": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "usersEmails",
                  "sharedDataId"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Workspaces"
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/users": {
      "post": {
        "operationId": "ListUsers",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "ids": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UserProfile"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Users"
        ]
      }
    },
    "/v2/ai/process": {
      "post": {
        "operationId": "ProcessAdvanced",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessRequestAdvancedDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "taskId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "taskId"
                  ],
                  "type": "object"
                }
              }
            },
            "description": ""
          },
          "400": {
            "description": "Missing or invalid desktop app info header"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "Unauthorized desktop client app version"
          },
          "500": {
            "description": "Unhandled internal server error"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "AI"
        ]
      }
    },
    "/v2/share-invitations/claim": {
      "post": {
        "description": "Binds all PENDING invitations matching the authenticated user's verified email. At most one agreement per\nworkspace becomes ACTIVE; superseded pending invitations are revoked.",
        "operationId": "ClaimShareInvitationsV2",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ShareAgreementV2-Array_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Claim pending share invitations",
        "tags": [
          "Sharing V2"
        ]
      }
    },
    "/v2/shared-workspaces": {
      "get": {
        "description": "Lists workspaces currently shared with the authenticated recipient. The response includes the effective policy\nand agreement ID needed by the shared-content APIs.",
        "operationId": "ListSharedWorkspacesV2",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_SharedWorkspaceSummary-Array_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "List workspaces shared with me",
        "tags": [
          "Sharing V2"
        ]
      }
    },
    "/v2/sharing-email-outbox/process": {
      "post": {
        "description": "Claims up to 50 retryable invitation deliveries and attempts them once. Concurrent workers cannot claim the\nsame delivery. This is an administrative maintenance endpoint.",
        "operationId": "ProcessSharingEmailOutboxV2",
        "parameters": [
          {
            "description": "Optional application origin used in invitation links.",
            "in": "header",
            "name": "Origin",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ProcessEmailOutboxResponseDTO_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Process pending invitation emails",
        "tags": [
          "Sharing V2"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/files/commit": {
      "post": {
        "description": "Atomically applies an ordered batch of file metadata changes and writes sharing audit events in the same MongoDB\ntransaction. ADD/DELETE require MANAGE_CONTENT; REPLACE/RENAME require UPDATE_EXISTING. FILES scopes can mutate\nonly their explicitly authorized stable IDs. Uploaded hashes are verified before commit.",
        "operationId": "CommitSharedFileChangesV2",
        "parameters": [
          {
            "description": "Owner workspace referenced by the active agreement.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "changes": [
                  {
                    "hash": "4d967f...",
                    "operation": "ADD",
                    "relativePath": "scans/upper.stl"
                  }
                ],
                "patientId": "64f1c2a7e4b0f123456789ab"
              },
              "schema": {
                "$ref": "#/components/schemas/V2CommitFilesDTO",
                "description": "Patient/plan scope and ordered changes."
              }
            }
          },
          "description": "Patient/plan scope and ordered changes.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_Commit_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Active policy does not grant the required content access"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Workspace, patient, file, or active agreement not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Commit authorized file changes",
        "tags": [
          "Sharing V2 Content"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/patients": {
      "get": {
        "operationId": "ListV2",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort.field",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PatientSortField"
            }
          },
          {
            "in": "query",
            "name": "sort.order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "firstName",
            "required": false,
            "schema": {
              "maxLength": 30,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lastName",
            "required": false,
            "schema": {
              "maxLength": 30,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "birthDate",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseFilterResponse_Patient_"
                }
              }
            },
            "description": "Ok"
          },
          "401": {
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "description": "User is not authorized to access this workspace"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "tags": [
          "Patients"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/patients/shared": {
      "get": {
        "description": "Returns only patients readable under the active agreement. Pagination and `totalCount` are calculated after\napplying the policy. ANONYMOUS policies redact demographics; FILES policies omit unshared file and plan metadata.\nWorkspace owners receive their normal unredacted patient data.",
        "operationId": "ListSharedPatientsV2",
        "parameters": [
          {
            "description": "Owner workspace referenced by the active agreement.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of authorized patients to skip.",
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Maximum authorized patients to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "format": "int32",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Field used for sorting.",
            "in": "query",
            "name": "sort.field",
            "required": false,
            "schema": {
              "default": "updatedAt",
              "enum": [
                "createdAt",
                "updatedAt",
                "firstName",
                "lastName",
                "practicePatientId"
              ],
              "type": "string"
            }
          },
          {
            "description": "Sort direction.",
            "in": "query",
            "name": "sort.order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingPaginatedResponseDTO_SharedPatientDTO_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Workspace, patient, file, or active agreement not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "List authorized shared patients",
        "tags": [
          "Sharing V2 Content"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/patients/{patientId}/files/upload-urls": {
      "post": {
        "description": "Issues short-lived upload URLs after operation-specific authorization. Uploading blobs does not update metadata;\ncall the commit endpoint afterward. FILES-scoped replacements must provide the authorized target `fileId`.",
        "operationId": "IssueSharedFileUploadUrlsV2",
        "parameters": [
          {
            "description": "Owner workspace referenced by the active agreement.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Patient receiving the upload.",
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "filesInfo": [
                  {
                    "hash": "4d967f...",
                    "relativePath": "scans/upper.stl"
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/V2UploadUrlsRequestDTO",
                "description": "Upload scope and content hashes."
              }
            }
          },
          "description": "Upload scope and content hashes.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_GetUploadUrlsResponseDTO-Array_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Active policy does not grant the required content access"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Workspace, patient, file, or active agreement not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Issue authorized file upload URLs",
        "tags": [
          "Sharing V2 Content"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/patients/{patientId}/files/{fileId}/download-url": {
      "post": {
        "description": "Issues a short-lived download URL after checking the agreement, patient ancestry, stable file ID, access level,\nand scope expiry. URL lifetime is at most five minutes and never exceeds the policy expiry.",
        "operationId": "IssueSharedFileDownloadUrlV2",
        "parameters": [
          {
            "description": "Owner workspace referenced by the active agreement.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Parent patient.",
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Stable file ID present in the effective policy.",
            "in": "path",
            "name": "fileId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_GetDownloadUrlsResponseDTO-and-_fileId-string--transferId-string--expiresInSeconds-number__"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Workspace, patient, file, or active agreement not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Issue an authorized file download URL",
        "tags": [
          "Sharing V2 Content"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/patients/{patientId}/plans/shared": {
      "get": {
        "description": "Lists plans visible under the active policy. FILES policies return only plans containing authorized files;\nANONYMOUS disclosure returns no plans.",
        "operationId": "ListSharedPlansV2",
        "parameters": [
          {
            "description": "Owner workspace referenced by the active agreement.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Parent patient.",
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_SharedPlanDTO-Array_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Workspace, patient, file, or active agreement not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "List authorized shared plans",
        "tags": [
          "Sharing V2 Content"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/patients/{patientId}/shared": {
      "get": {
        "description": "Returns one authorized patient. The response is projected according to disclosure and file scope; a caller\nwithout access receives 404 rather than details about the denied resource.",
        "operationId": "GetSharedPatientV2",
        "parameters": [
          {
            "description": "Owner workspace referenced by the active agreement.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Patient to retrieve.",
            "in": "path",
            "name": "patientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_SharedPatientDTO_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Workspace, patient, file, or active agreement not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Get an authorized shared patient",
        "tags": [
          "Sharing V2 Content"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/share-agreements": {
      "get": {
        "description": "Returns agreements sent from this workspace. Results can be filtered by lifecycle status and sorted.\nOnly the workspace owner may list sent agreements.",
        "operationId": "ListSentShareAgreementsV2",
        "parameters": [
          {
            "description": "Workspace owned by the authenticated caller.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of matching records to skip.",
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Maximum records to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "format": "int32",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Restrict results to one agreement status.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ShareAgreementStatus"
            }
          },
          {
            "description": "Field used for sorting.",
            "in": "query",
            "name": "sort.field",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ShareAgreementSortFieldDTO"
            }
          },
          {
            "description": "Sort direction.",
            "in": "query",
            "name": "sort.order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingPaginatedResponseDTO_ShareAgreementV2_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "List sent share agreements",
        "tags": [
          "Sharing V2"
        ]
      },
      "post": {
        "description": "Creates a new agreement, reactivates a revoked agreement for the same normalized email, or updates the\nexisting non-revoked agreement. Registered recipients become ACTIVE immediately; other recipients remain\nPENDING until they claim the invitation. Only the workspace owner may call this operation.",
        "operationId": "CreateShareAgreementV2",
        "parameters": [
          {
            "description": "Workspace owned by the authenticated caller.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional retry key. Reusing it returns the original agreement.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional application origin used in invitation links.",
            "in": "header",
            "name": "Origin",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "policy": {
                  "access": "READ",
                  "disclosure": "FULL",
                  "mode": "WORKSPACE"
                },
                "recipientEmail": "recipient@example.com"
              },
              "schema": {
                "$ref": "#/components/schemas/CreateShareAgreementDTO",
                "description": "Recipient and complete sharing policy."
              }
            }
          },
          "description": "Recipient and complete sharing policy.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ShareAgreementV2_"
                }
              }
            },
            "description": "Existing agreement updated",
            "headers": {
              "ETag": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ShareAgreementV2_"
                }
              }
            },
            "description": "Created",
            "headers": {
              "ETag": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Policy validation failed"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Create or replace a share agreement",
        "tags": [
          "Sharing V2"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/share-agreements/{agreementId}": {
      "delete": {
        "description": "Revokes an agreement using optimistic concurrency. Revocation immediately blocks recipient content access.\nSend the current agreement `ETag` in `If-Match`.",
        "operationId": "RevokeShareAgreementV2",
        "parameters": [
          {
            "description": "Workspace owned by the authenticated caller.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Agreement to revoke.",
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Current agreement ETag, for example `\"3\"`.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ShareAgreementV2_"
                }
              }
            },
            "description": "Agreement revoked",
            "headers": {
              "ETag": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          },
          "412": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "If-Match version is missing, invalid, or stale"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Revoke a share agreement",
        "tags": [
          "Sharing V2"
        ]
      },
      "get": {
        "description": "Returns an agreement to its workspace owner or bound recipient. Unauthorized callers receive 404 to avoid\ndisclosing whether an agreement exists.",
        "operationId": "GetShareAgreementV2",
        "parameters": [
          {
            "description": "Agreement workspace.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Share agreement ID.",
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ShareAgreementV2_"
                }
              }
            },
            "description": "Agreement returned",
            "headers": {
              "ETag": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Get a share agreement",
        "tags": [
          "Sharing V2"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/share-agreements/{agreementId}/invitation/resend": {
      "post": {
        "description": "Enqueues and attempts a new invitation email for a PENDING agreement. ACTIVE or revoked agreements return 404.",
        "operationId": "ResendShareInvitationV2",
        "parameters": [
          {
            "description": "Workspace owned by the authenticated caller.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pending agreement ID.",
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional application origin used in the invitation link.",
            "in": "header",
            "name": "Origin",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ShareAgreementV2_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Resend a pending invitation",
        "tags": [
          "Sharing V2"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/share-agreements/{agreementId}/policy": {
      "put": {
        "description": "Replaces the complete policy using optimistic concurrency. Send the agreement's current numeric version in\n`If-Match`. Prefer copying the quoted `ETag` returned by the agreement GET response (for example `\"3\"`).\nAn unquoted integer is also accepted. A stale, malformed, or missing version returns 412.",
        "operationId": "ReplaceShareAgreementPolicyV2",
        "parameters": [
          {
            "description": "Workspace owned by the authenticated caller.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Agreement to update.",
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Current agreement ETag, for example `\"3\"`.",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "policy": {
                  "mode": "PATIENTS",
                  "patients": [
                    {
                      "disclosure": "ANONYMOUS",
                      "patientId": "64f1c2a7e4b0f123456789ab",
                      "scope": {
                        "access": "READ",
                        "mode": "PATIENT"
                      }
                    }
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/UpdateSharePolicyDTO",
                "description": "Complete replacement policy; this is not a merge patch."
              }
            }
          },
          "description": "Complete replacement policy; this is not a merge patch.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingDataResponseDTO_ShareAgreementV2_"
                }
              }
            },
            "description": "Policy replaced",
            "headers": {
              "ETag": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          },
          "412": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "If-Match version is missing, invalid, or stale"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Policy validation failed"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "Replace a share policy",
        "tags": [
          "Sharing V2"
        ]
      }
    },
    "/v2/workspaces/{workspaceId}/sharing-audit": {
      "get": {
        "description": "Lists immutable agreement, authorization, URL issuance, and file-mutation audit events. Only the workspace\nowner may access this log. All filters are optional and combined with AND semantics.",
        "operationId": "ListSharingAuditEventsV2",
        "parameters": [
          {
            "description": "Workspace owned by the authenticated caller.",
            "in": "path",
            "name": "workspaceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of matching events to skip.",
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "default": 0,
              "format": "int32",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Maximum events to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "format": "int32",
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "recipientUserId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agreementId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "eventType",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SharingAuditEventType"
            }
          },
          {
            "in": "query",
            "name": "patientId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fileId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "decision",
            "required": false,
            "schema": {
              "enum": [
                "ALLOW",
                "DENY"
              ],
              "type": "string"
            }
          },
          {
            "description": "Inclusive ISO 8601 lower timestamp bound.",
            "example": "2026-08-01T00:00:00.000Z",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Inclusive ISO 8601 upper timestamp bound.",
            "example": "2026-08-31T23:59:59.999Z",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Field used for sorting.",
            "in": "query",
            "name": "sort.field",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SharingAuditSortFieldDTO"
            }
          },
          {
            "description": "Sort direction.",
            "in": "query",
            "name": "sort.order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingPaginatedResponseDTO_SharingAuditEventV2_"
                }
              }
            },
            "description": "Ok"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Request validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "JWT token is missing or invalid"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Only the workspace owner can view audit events"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingErrorResponseDTO"
                }
              }
            },
            "description": "Agreement or workspace not found"
          }
        },
        "security": [
          {
            "jwt_auth": []
          }
        ],
        "summary": "List sharing audit events",
        "tags": [
          "Sharing V2"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Local development",
      "url": "http://localhost:3001/"
    },
    {
      "description": "Development server",
      "url": "https://develop-api-case-cloud.atomica.ai/"
    },
    {
      "description": "Staging server",
      "url": "https://staging-api-case-cloud.atomica.ai/"
    },
    {
      "description": "Demo server",
      "url": "https://demo-api-case-cloud.atomica.ai/"
    }
  ],
  "tags": [
    {
      "description": "Create and manage recipient agreements, claim invitations, inspect effective shared workspaces, and query immutable sharing audit events. Every success is an object with data; paginated lists also include pagination { skip, limit, totalCount }. Policy updates and revocation use the agreement version through If-Match.",
      "name": "Sharing V2"
    },
    {
      "description": "Read or mutate shared patient content under an ACTIVE agreement. Every success is an object with data; paginated lists also include pagination { skip, limit, totalCount }. Responses honor FULL/ANONYMOUS disclosure, PATIENT/FILES scope, access level, and per-scope expiry.",
      "name": "Sharing V2 Content"
    }
  ]
}
