{
  "openapi": "3.0.3",
  "info": {
    "title": "Wisedocs API",
    "version": "1.0",
    "description": "REST API for integrating Wisedocs capabilities into diverse workflows and\nuse cases across claims, insurance, legal, and healthcare operations.\n",
    "license": {
      "name": "Proprietary",
      "url": "https://wisedocs.ai"
    }
  },
  "servers": [
    {
      "url": "https://dev-api.wisedocs.ai",
      "description": "Development server"
    },
    {
      "url": "https://staging-api.wisedocs.ai",
      "description": "Staging server"
    },
    {
      "url": "https://api.wisedocs.ai",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "OAuth 2.0 client credentials"
    },
    {
      "name": "Cases",
      "description": "Case management operations"
    },
    {
      "name": "Files",
      "description": "File management operations"
    },
    {
      "name": "Teams",
      "description": "Teams that cases can be assigned to"
    }
  ],
  "security": [
    {
      "bearerAuth": [],
      "apiKeyAuth": []
    }
  ],
  "paths": {
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "getAuthorizationServerMetadata",
        "summary": "Get OAuth authorization server metadata",
        "description": "Returns the public OAuth endpoints and supported confidential-client authentication methods.",
        "tags": [
          "Authentication"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Authorization server metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationServerMetadata"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "createAccessToken",
        "summary": "Create an access token",
        "description": "Exchanges client credentials for an access token using the OAuth 2.0\nclient credentials grant.\n\nAuthenticate with HTTP Basic using `client_id` as the username and\n`client_secret` as the password, and send `grant_type=client_credentials`\nas a form-encoded body.\n\nTokens cannot be refreshed; request a new one when `expires_in` elapses.\n",
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "clientSecretBasic": []
          }
        ],
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -i -X POST https://dev-api.wisedocs.ai/oauth/token \\\n  -u '<client_id>:<client_secret>' \\\n  -d grant_type=client_credentials\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              },
              "example": {
                "grant_type": "client_credentials"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TokenSuccess"
          },
          "400": {
            "$ref": "#/components/responses/OAuthBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/OAuthUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/OAuthUnauthorized"
          }
        }
      }
    },
    "/oauth/introspect": {
      "post": {
        "operationId": "introspectAccessToken",
        "summary": "Introspect an access token",
        "description": "Returns metadata for an active access token issued to the authenticated\nclient. Inactive, expired, or revoked tokens return `{\"active\": false}`.\n",
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "clientSecretBasic": []
          }
        ],
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -i -X POST https://dev-api.wisedocs.ai/oauth/introspect \\\n  -u '<client_id>:<client_secret>' \\\n  -d token='<access_token>'\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenManagementRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenManagementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token activity and metadata.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "example": "no-store"
                }
              },
              "Pragma": {
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntrospectionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/TokenManagementBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/OAuthClientUnauthorized"
          },
          "503": {
            "$ref": "#/components/responses/TokenManagementUnavailable"
          }
        }
      }
    },
    "/oauth/revoke": {
      "post": {
        "operationId": "revokeAccessToken",
        "summary": "Revoke an access token",
        "description": "Revokes an access token issued to the authenticated client. The operation\nis idempotent and returns `200` even if the token is already expired or\nrevoked.\n",
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "clientSecretBasic": []
          }
        ],
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -i -X POST https://dev-api.wisedocs.ai/oauth/revoke \\\n  -u '<client_id>:<client_secret>' \\\n  -d token='<access_token>'\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenManagementRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenManagementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revocation accepted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "example": "no-store"
                }
              },
              "Pragma": {
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "example": {}
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/TokenManagementBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/OAuthClientUnauthorized"
          },
          "503": {
            "$ref": "#/components/responses/TokenManagementUnavailable"
          }
        }
      }
    },
    "/api/v1/cases": {
      "post": {
        "operationId": "createCase",
        "summary": "Create a case",
        "description": "Create a new case. Only `claimant.firstName` and `claimant.lastName` are\nrequired.\n\nWhen `case` is provided and `case.allowDuplication` is `false` (default),\nreturns `409` if a case with the same claimant name and `case.caseNumber`\nalready exists.\n\nOptionally set `case.createdBy` to the email of a Wisedocs user to show as\nthe case's \"Created by\". Returns `400` if the email does not belong to an\nactive user in your workspace or, when team visibility is enabled, to a\nmember of one of the `case.teams`.\n",
        "tags": [
          "Cases"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "cases:write"
            ],
            "apiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseCreateRequest"
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal request",
                  "value": {
                    "claimant": {
                      "firstName": "John",
                      "lastName": "Doe"
                    }
                  }
                },
                "full": {
                  "summary": "Full request",
                  "value": {
                    "claim": {
                      "claimNumber": "CLM-12345",
                      "dateOfLoss": "2026-01-15",
                      "policyNumber": "POL-12345"
                    },
                    "claimant": {
                      "firstName": "John",
                      "lastName": "Doe",
                      "email": "john.doe@example.com",
                      "dateOfBirth": "1980-01-15",
                      "gender": "M",
                      "mobilePhone": "+15551234567",
                      "officePhone": "+15551234567"
                    },
                    "case": {
                      "caseNumber": "CASE-12345",
                      "caseType": "personal-injury",
                      "allowDuplication": false,
                      "teams": [
                        "0b6e1e8a-6b0e-4f5c-9a7e-1f2a3b4c5d6e"
                      ]
                    },
                    "claimantsAddress": {
                      "street1": "123 Example Street",
                      "street2": "Suite 100",
                      "city": "Toronto",
                      "postal": "M5V 1A1",
                      "province": "ON",
                      "country": "Canada"
                    },
                    "referringorganization": {
                      "name": "Example Organization"
                    },
                    "referrercontactprofile": {
                      "firstName": "Jane",
                      "email": "referrer@example.com"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/Created"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "operationId": "searchCases",
        "summary": "Search cases",
        "description": "Return a paginated list of cases, optionally filtered by `caseUuid`,\n`internalCaseNumber`, and `claimNumber` (exact match, combined with AND).\n",
        "tags": [
          "Cases"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "cases:read"
            ],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchCaseUuid"
          },
          {
            "$ref": "#/components/parameters/SearchInternalCaseNumber"
          },
          {
            "$ref": "#/components/parameters/SearchClaimNumber"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Search"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/v1/cases/{caseUuid}": {
      "get": {
        "operationId": "getCase",
        "summary": "Get case information",
        "description": "Return case details.",
        "tags": [
          "Cases"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "cases:read"
            ],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CaseUuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CaseDetail"
          },
          "400": {
            "description": "`caseUuid` is not a valid UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "message": "`caseUuid` must be a valid UUID"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateCase",
        "summary": "Update case information",
        "description": "Update selected fields of a case. Send only the fields to change; omitted\nfields remain unchanged, and all updates are applied atomically.\n",
        "tags": [
          "Cases"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "cases:write"
            ],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CaseUuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseUpdateRequest"
              },
              "examples": {
                "claimant": {
                  "summary": "Update the claimant and their address",
                  "value": {
                    "claimant": {
                      "lastName": "Doe-Smith",
                      "dateOfBirth": null
                    },
                    "claimantsAddress": {
                      "street1": "456 New Street",
                      "street2": ""
                    }
                  }
                },
                "case": {
                  "summary": "Close a case and change its claim number",
                  "value": {
                    "case": {
                      "status": "CLOSED"
                    },
                    "claim": {
                      "claimNumber": "CLM-67890"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Updated"
          },
          "400": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unknownField": {
                    "summary": "Unknown field",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "case",
                              "teams"
                            ],
                            "msg": "extra fields not permitted",
                            "type": "value_error.extra"
                          }
                        ]
                      }
                    }
                  },
                  "notNullable": {
                    "summary": "Null for a field that cannot be cleared",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "claimant",
                              "firstName"
                            ],
                            "msg": "may not be null",
                            "type": "value_error"
                          }
                        ]
                      }
                    }
                  },
                  "serviceValidation": {
                    "summary": "Field validation error",
                    "value": {
                      "error": {
                        "message": "Bad Request Error",
                        "details": {
                          "claimant": {
                            "firstName": [
                              "Ensure this field has at least 1 characters."
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/cases/{caseUuid}/files": {
      "post": {
        "operationId": "uploadCaseFiles",
        "summary": "Create file upload URLs",
        "description": "Create file records in a case and return a presigned S3 `PUT` URL for each.\nUpload each file's bytes to its `putUrl` with an HTTP `PUT`, then report\nthe upload with `PATCH /api/v1/cases/{caseUuid}/files/{fileUuid}`.\n\nEvery upload `PUT` must include:\n\n- `x-amz-server-side-encryption: AES256`\n- `Content-Type` set to the file's media type:\n\n| Extension | `Content-Type` |\n| --- | --- |\n| `.pdf` | `application/pdf` |\n| `.jpg`, `.jpeg` | `image/jpeg` |\n| `.png` | `image/png` |\n| `.tif`, `.tiff` | `image/tiff` |\n| `.gif` | `image/gif` |\n| `.doc` | `application/msword` |\n| `.docx` | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` |\n\nFor example:\n\n```bash\ncurl -X PUT \"$PUT_URL\" \\\n  -H \"x-amz-server-side-encryption: AES256\" \\\n  -H \"Content-Type: image/jpeg\" \\\n  --upload-file x-ray.jpg\n```\n",
        "tags": [
          "Files"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "files:write"
            ],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CaseUuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileUploadRequest"
              },
              "examples": {
                "single": {
                  "summary": "One file",
                  "value": {
                    "fileNames": [
                      "medical-record.pdf"
                    ]
                  }
                },
                "multiple": {
                  "summary": "Several files",
                  "value": {
                    "fileNames": [
                      "medical-record.pdf",
                      "x-ray.png",
                      "referral-letter.docx"
                    ]
                  }
                },
                "priority": {
                  "summary": "With an SLA priority",
                  "value": {
                    "fileNames": [
                      "medical-record.pdf"
                    ],
                    "priority": "P1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/Uploaded"
          },
          "400": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "empty": {
                    "summary": "No file names",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "fileNames"
                            ],
                            "msg": "ensure this value has at least 1 items",
                            "type": "value_error.list.min_items",
                            "ctx": {
                              "limit_value": 1
                            }
                          }
                        ]
                      }
                    }
                  },
                  "unsupported": {
                    "summary": "Unsupported file extension",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "fileNames",
                              1
                            ],
                            "msg": "File extension not supported; use one of .pdf, .jpg, .jpeg, .png, .tif, .tiff, .gif, .doc, .docx",
                            "type": "value_error"
                          }
                        ]
                      }
                    }
                  },
                  "duplicate": {
                    "summary": "Duplicate file name",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "fileNames"
                            ],
                            "msg": "Duplicate file names: medical-record.pdf",
                            "type": "value_error"
                          }
                        ]
                      }
                    }
                  },
                  "invalidPriority": {
                    "summary": "Unknown priority",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "priority"
                            ],
                            "msg": "value is not a valid enumeration member; permitted: 'P0', 'P1', 'P2', 'P3', 'P4'",
                            "type": "type_error.enum",
                            "ctx": {
                              "enum_values": [
                                "P0",
                                "P1",
                                "P2",
                                "P3",
                                "P4"
                              ]
                            }
                          }
                        ]
                      }
                    }
                  },
                  "invalidCaseUuid": {
                    "summary": "Malformed case UUID",
                    "value": {
                      "error": {
                        "message": "`caseUuid` must be a valid UUID"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The case does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "message": "Not Found Error",
                    "details": {
                      "detail": "No Case matches the given query."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v1/cases/{caseUuid}/files/{fileUuid}": {
      "get": {
        "operationId": "getFile",
        "summary": "Get file information",
        "description": "Return a file in the case: its processing `status`, page count, dates,\nand a presigned `getUrl` to download it once uploaded.\n",
        "tags": [
          "Files"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "files:read"
            ],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CaseUuid"
          },
          {
            "$ref": "#/components/parameters/FileUuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/File"
          },
          "400": {
            "description": "`caseUuid` or `fileUuid` is not a valid UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "message": "`fileUuid` must be a valid UUID"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The case does not exist, or the file is not in the case.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "message": "Not Found Error",
                    "details": {
                      "detail": "No File matches the given query."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateFile",
        "summary": "Report a file upload complete",
        "description": "Notify Wisedocs that a file has been uploaded to its presigned `putUrl` so\nvalidation and processing can begin.\n\nThe call is idempotent. If a file fails validation (`INVALID`), re-upload\nthe file to its `putUrl` with the required headers and call this endpoint\nagain.\n",
        "tags": [
          "Files"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "files:write"
            ],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CaseUuid"
          },
          {
            "$ref": "#/components/parameters/FileUuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileStatusUpdateRequest"
              },
              "example": {
                "status": "UPLOADED"
              }
            }
          }
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/StatusUpdated"
          },
          "400": {
            "description": "Request validation failed, or the file has not been uploaded to its presigned URL yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalidStatus": {
                    "summary": "Unsupported status",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "status"
                            ],
                            "msg": "value is not a valid enumeration member; permitted: 'UPLOADED'",
                            "type": "type_error.enum",
                            "ctx": {
                              "enum_values": [
                                "UPLOADED"
                              ]
                            }
                          }
                        ]
                      }
                    }
                  },
                  "unknownField": {
                    "summary": "Unknown field",
                    "value": {
                      "error": {
                        "message": [
                          {
                            "loc": [
                              "s3PutKey"
                            ],
                            "msg": "extra fields not permitted",
                            "type": "value_error.extra"
                          }
                        ]
                      }
                    }
                  },
                  "invalidFileUuid": {
                    "summary": "Malformed file UUID",
                    "value": {
                      "error": {
                        "message": "`fileUuid` must be a valid UUID"
                      }
                    }
                  },
                  "notUploaded": {
                    "summary": "The file's bytes are not uploaded",
                    "value": {
                      "error": {
                        "message": "Bad Request Error",
                        "details": {
                          "status": [
                            "File with uuid '323e4567-e89b-12d3-a456-426614174000' could not find s3 object"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The case does not exist, or the file is not in the case.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "message": "Not Found Error",
                    "details": {
                      "detail": "No File matches the given query."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v1/teams": {
      "get": {
        "operationId": "listTeams",
        "summary": "List teams",
        "description": "Return the teams that cases can be assigned to, for use in `case.teams`\nwhen creating a case. Filters are combined with AND; unknown query\nparameters are rejected.\n",
        "tags": [
          "Teams"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "teams:read"
            ],
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamName"
          },
          {
            "$ref": "#/components/parameters/MemberUsername"
          },
          {
            "$ref": "#/components/parameters/MemberEmail"
          },
          {
            "$ref": "#/components/parameters/Limit-2"
          },
          {
            "$ref": "#/components/parameters/Offset-2"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/List"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Raw JWT returned in `access_token` by `POST /oauth/token`."
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API Gateway key required in addition to the Bearer token."
      },
      "oauth2ClientCredentials": {
        "type": "oauth2",
        "description": "OAuth 2.0 client credentials. Send the issued access token as\n`Authorization: Bearer <access_token>`. Each operation requires the\nscope listed for it; a token without that scope receives `403` with\n`error.code: \"insufficient_scope\"`.\n",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oauth/token",
            "scopes": {
              "cases:read": "Read case lists, searches, and details.",
              "cases:write": "Create and update cases and their related entities.",
              "files:read": "Read file details.",
              "files:write": "Create file upload URLs and complete uploads.",
              "teams:read": "List teams that cases can be assigned to."
            }
          }
        }
      },
      "clientSecretBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "HTTP Basic authentication with `client_id` as the username and\n`client_secret` as the password.\n"
      }
    },
    "schemas": {
      "AuthorizationServerMetadata": {
        "type": "object",
        "required": [
          "issuer",
          "token_endpoint",
          "revocation_endpoint",
          "introspection_endpoint",
          "grant_types_supported",
          "token_endpoint_auth_methods_supported",
          "revocation_endpoint_auth_methods_supported",
          "introspection_endpoint_auth_methods_supported"
        ],
        "properties": {
          "issuer": {
            "type": "string",
            "format": "uri",
            "example": "https://api.wisedocs.ai"
          },
          "token_endpoint": {
            "type": "string",
            "format": "uri",
            "example": "https://api.wisedocs.ai/oauth/token"
          },
          "revocation_endpoint": {
            "type": "string",
            "format": "uri",
            "example": "https://api.wisedocs.ai/oauth/revoke"
          },
          "introspection_endpoint": {
            "type": "string",
            "format": "uri",
            "example": "https://api.wisedocs.ai/oauth/introspect"
          },
          "grant_types_supported": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "client_credentials"
            ]
          },
          "token_endpoint_auth_methods_supported": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "client_secret_basic",
              "client_secret_post"
            ]
          },
          "revocation_endpoint_auth_methods_supported": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "client_secret_basic"
            ]
          },
          "introspection_endpoint_auth_methods_supported": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "client_secret_basic"
            ]
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "message"
            ],
            "properties": {
              "message": {
                "description": "Error message. Request validation failures return an array of validation error objects (`loc`, `msg`, `type`).",
                "oneOf": [
                  {
                    "type": "string",
                    "example": "Request body is not valid JSON"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "loc": {
                          "type": "array",
                          "description": "Path to the invalid value: field names, and zero-based indexes for list items.",
                          "items": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "integer"
                              }
                            ]
                          },
                          "example": [
                            "claimant",
                            "firstName"
                          ]
                        },
                        "msg": {
                          "type": "string",
                          "example": "field required"
                        },
                        "type": {
                          "type": "string",
                          "example": "value_error.missing"
                        }
                      }
                    }
                  }
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": true,
                "description": "Field-level validation or domain error details, grouped by the request's top-level fields.",
                "example": {
                  "claim": {
                    "dateOfLoss": [
                      "Date cannot be in the future."
                    ]
                  },
                  "claimant": {
                    "gender": [
                      "\"male\" is not a valid choice."
                    ]
                  }
                }
              },
              "code": {
                "type": "string",
                "description": "Optional machine-readable error code, e.g. `insufficient_scope` on a `403` caused by a missing OAuth scope.",
                "example": "insufficient_scope"
              }
            }
          }
        }
      },
      "TokenRequest": {
        "type": "object",
        "description": "OAuth 2.0 client credentials token request.",
        "required": [
          "grant_type"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "client_credentials"
            ],
            "example": "client_credentials"
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Raw JWT to send as `Authorization: Bearer <access_token>`.",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature"
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ],
            "example": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "minimum": 0,
            "description": "Seconds until the token expires.",
            "example": 300
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited scopes granted to this API client. Supported scopes\nare `cases:read`, `cases:write`, `files:read`, `files:write`, and\n`teams:read`.\n",
            "example": "cases:read files:read"
          }
        }
      },
      "OAuthError": {
        "type": "object",
        "required": [
          "error",
          "error_description"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_client",
              "unsupported_grant_type"
            ],
            "example": "invalid_client"
          },
          "error_description": {
            "type": "string",
            "example": "invalid client credentials"
          }
        }
      },
      "TokenManagementRequest": {
        "type": "object",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "Access token to inspect or revoke.",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.example.signature"
          }
        }
      },
      "IntrospectionResponse": {
        "type": "object",
        "required": [
          "active"
        ],
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Whether the token is active.",
            "example": true
          },
          "exp": {
            "type": "integer",
            "description": "Token expiry as a Unix timestamp. Present only for an active token.",
            "example": 1791907200
          },
          "tenant": {
            "type": "string",
            "description": "Tenant identifier. Present only for an active token.",
            "example": "example-tenant"
          },
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "API client UUID. Present only for an active token.",
            "example": "5ae8db5d-f7e7-473d-92b3-eb51d8bac0d2"
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited scopes granted to the token.",
            "example": "cases:read files:read"
          }
        }
      },
      "OAuthClientError": {
        "type": "object",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "example": "Invalid client credentials."
          }
        }
      },
      "CaseSearchResult": {
        "type": "object",
        "required": [
          "caseUuid",
          "internalCaseNumber",
          "claimNumber",
          "claimantFullName",
          "status",
          "created"
        ],
        "properties": {
          "caseUuid": {
            "type": "string",
            "format": "uuid",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "internalCaseNumber": {
            "type": "string",
            "nullable": true,
            "example": "CASE-12345"
          },
          "claimNumber": {
            "type": "string",
            "nullable": true,
            "example": "CLM-12345"
          },
          "claimantFullName": {
            "type": "string",
            "nullable": true,
            "example": "John Doe"
          },
          "status": {
            "type": "string",
            "example": "OPENED"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T14:30:00Z"
          }
        }
      },
      "CaseSearchResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "description": "Total number of matching cases, across all pages.",
                "example": 1
              },
              "results": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CaseSearchResult"
                }
              }
            }
          },
          "status": {
            "type": "string",
            "example": "success"
          }
        }
      },
      "Claim": {
        "type": "object",
        "properties": {
          "claimNumber": {
            "type": "string",
            "example": "CLM-12345"
          },
          "dateOfLoss": {
            "type": "string",
            "format": "date",
            "description": "Cannot be in the future.",
            "example": "2026-01-15"
          },
          "policyNumber": {
            "type": "string",
            "example": "POL-12345"
          }
        }
      },
      "Claimant": {
        "type": "object",
        "required": [
          "firstName",
          "lastName"
        ],
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "example": "Doe"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "john.doe@example.com"
          },
          "dateOfBirth": {
            "type": "string",
            "format": "date",
            "description": "Cannot be in the future.",
            "example": "1980-01-15"
          },
          "gender": {
            "type": "string",
            "enum": [
              "M",
              "F",
              "NB",
              "UN"
            ],
            "description": "`M` male, `F` female, `NB` non-binary, `UN` unknown.",
            "example": "M"
          },
          "mobilePhone": {
            "type": "string",
            "example": "+15551234567"
          },
          "officePhone": {
            "type": "string",
            "example": "+15551234567"
          },
          "allowDuplication": {
            "type": "boolean",
            "default": true,
            "deprecated": true,
            "description": "Ignored when creating a case. Use `case.allowDuplication`.",
            "example": true
          }
        }
      },
      "CaseDetails": {
        "type": "object",
        "properties": {
          "allowDuplication": {
            "type": "boolean",
            "default": false,
            "example": false
          },
          "caseNumber": {
            "type": "string",
            "example": "CASE-12345"
          },
          "caseType": {
            "type": "string",
            "example": "personal-injury"
          },
          "status": {
            "type": "string",
            "default": "OPENED",
            "example": "OPENED"
          },
          "teams": {
            "type": "array",
            "description": "Team UUIDs (from `GET /api/v1/teams`) to assign the case to. Required when team visibility is enabled on the account.",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "example": [
              "0b6e1e8a-6b0e-4f5c-9a7e-1f2a3b4c5d6e"
            ]
          },
          "createdBy": {
            "type": "string",
            "format": "email",
            "description": "Email of the Wisedocs user to show as the case's \"Created by\". Must belong to an active user in your workspace. When team visibility is enabled, the user must also be a member of at least one team in `case.teams`. Otherwise the request fails with `400`; the error is the same for every reason. Naming a user does not grant them access to the case. Create-only: not accepted by `updateCase` and not returned in responses.",
            "example": "jane.smith@example.com"
          }
        }
      },
      "ClaimantAddress": {
        "type": "object",
        "properties": {
          "street1": {
            "type": "string",
            "example": "123 Example Street"
          },
          "street2": {
            "type": "string",
            "example": "Suite 100"
          },
          "city": {
            "type": "string",
            "example": "Toronto"
          },
          "postal": {
            "type": "string",
            "example": "M5V 1A1"
          },
          "province": {
            "type": "string",
            "example": "ON"
          },
          "country": {
            "type": "string",
            "example": "Canada"
          }
        }
      },
      "ReferringOrganization": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Example Organization"
          }
        }
      },
      "ReferrerContactProfile": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "referrer@example.com"
          },
          "firstName": {
            "type": "string",
            "example": "Jane"
          }
        }
      },
      "CaseCreateRequest": {
        "type": "object",
        "required": [
          "claimant"
        ],
        "properties": {
          "claim": {
            "$ref": "#/components/schemas/Claim"
          },
          "claimant": {
            "$ref": "#/components/schemas/Claimant"
          },
          "case": {
            "$ref": "#/components/schemas/CaseDetails"
          },
          "claimantsAddress": {
            "$ref": "#/components/schemas/ClaimantAddress"
          },
          "referringorganization": {
            "$ref": "#/components/schemas/ReferringOrganization"
          },
          "referrercontactprofile": {
            "$ref": "#/components/schemas/ReferrerContactProfile"
          },
          "defaultWorkflowUuid": {
            "type": "string",
            "format": "uuid",
            "deprecated": true,
            "description": "No longer used. Accepted for compatibility and ignored.",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "autoWorkflowConfig": {
            "type": "string",
            "deprecated": true,
            "description": "No longer used. Accepted for compatibility and ignored.",
            "example": "calendar_day_upload_group"
          }
        }
      },
      "CaseCreateResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "caseUuid": {
                "type": "string",
                "format": "uuid",
                "example": "123e4567-e89b-12d3-a456-426614174000"
              },
              "status": {
                "type": "string",
                "example": "OPENED"
              }
            }
          },
          "status": {
            "type": "string",
            "example": "success"
          }
        }
      },
      "CaseDetailsResponse": {
        "type": "object",
        "properties": {
          "internalCaseNumber": {
            "type": "string",
            "description": "`case.caseNumber` sent to `createCase`.",
            "example": "CASE-12345"
          },
          "caseType": {
            "type": "string",
            "example": "personal-injury"
          },
          "status": {
            "type": "string",
            "example": "OPENED"
          },
          "teams": {
            "type": "array",
            "description": "UUIDs of the teams that can see the case.",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "example": [
              "0b6e1e8a-6b0e-4f5c-9a7e-1f2a3b4c5d6e"
            ]
          }
        }
      },
      "ClaimantResponse": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "example": "Doe"
          },
          "email": {
            "type": "string",
            "example": "john.doe@example.com"
          },
          "dateOfBirth": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "example": "1980-01-15"
          },
          "gender": {
            "type": "string",
            "example": "M"
          },
          "mobilePhone": {
            "type": "string",
            "example": "+15551234567"
          },
          "officePhone": {
            "type": "string",
            "example": "+15551234567"
          }
        }
      },
      "CaseView": {
        "type": "object",
        "description": "Case details.",
        "required": [
          "caseUuid",
          "created",
          "case",
          "claim",
          "claimant"
        ],
        "properties": {
          "caseUuid": {
            "type": "string",
            "format": "uuid",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "example": "2026-01-15T14:30:00Z"
          },
          "case": {
            "$ref": "#/components/schemas/CaseDetailsResponse"
          },
          "claim": {
            "$ref": "#/components/schemas/Claim"
          },
          "claimant": {
            "$ref": "#/components/schemas/ClaimantResponse"
          },
          "claimantsAddress": {
            "type": "object",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ClaimantAddress"
              }
            ]
          },
          "referringorganization": {
            "type": "object",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ReferringOrganization"
              }
            ]
          },
          "referrercontactprofile": {
            "type": "object",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ReferrerContactProfile"
              }
            ]
          }
        }
      },
      "CaseGetResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CaseView"
          },
          "status": {
            "type": "string",
            "example": "success"
          }
        }
      },
      "CaseUpdateDetails": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "caseNumber": {
            "type": "string",
            "description": "Returned as `case.internalCaseNumber`.",
            "example": "CASE-12345"
          },
          "caseType": {
            "type": "string",
            "example": "personal-injury"
          },
          "status": {
            "type": "string",
            "enum": [
              "OPENED",
              "INACT",
              "CLOSED"
            ],
            "description": "`OPENED`, `INACT` (inactive) or `CLOSED`.",
            "example": "CLOSED"
          }
        }
      },
      "ClaimUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "claimNumber": {
            "type": "string",
            "example": "CLM-12345"
          },
          "dateOfLoss": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Cannot be in the future. `null` clears it.",
            "example": "2026-01-15"
          },
          "policyNumber": {
            "type": "string",
            "example": "POL-12345"
          }
        }
      },
      "ClaimantUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "example": "Doe"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "john.doe@example.com"
          },
          "dateOfBirth": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Cannot be in the future. `null` clears it.",
            "example": "1980-01-15"
          },
          "gender": {
            "type": "string",
            "enum": [
              "M",
              "F",
              "NB",
              "UN"
            ],
            "description": "`M` male, `F` female, `NB` non-binary, `UN` unknown.",
            "example": "M"
          },
          "mobilePhone": {
            "type": "string",
            "example": "+15551234567"
          },
          "officePhone": {
            "type": "string",
            "example": "+15551234567"
          }
        }
      },
      "ClaimantAddressUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "street1": {
            "type": "string",
            "example": "123 Example Street"
          },
          "street2": {
            "type": "string",
            "example": "Suite 100"
          },
          "city": {
            "type": "string",
            "example": "Toronto"
          },
          "postal": {
            "type": "string",
            "example": "M5V 1A1"
          },
          "province": {
            "type": "string",
            "example": "ON"
          },
          "country": {
            "type": "string",
            "example": "Canada"
          }
        }
      },
      "ReferringOrganizationUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "example": "Example Organization"
          }
        }
      },
      "ReferrerContactProfileUpdate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "referrer@example.com"
          },
          "firstName": {
            "type": "string",
            "example": "Jane"
          }
        }
      },
      "CaseUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "Partial update payload. Send only the fields to change:\n\n- Omitted fields remain unchanged.\n- Send `null` to clear `claim.dateOfLoss` or `claimant.dateOfBirth`, or `\"\"` to clear a text field.\n- `claimantsAddress`, `referringorganization`, and `referrercontactprofile` are updated only if already present on the case.\n",
        "properties": {
          "case": {
            "$ref": "#/components/schemas/CaseUpdateDetails"
          },
          "claim": {
            "$ref": "#/components/schemas/ClaimUpdate"
          },
          "claimant": {
            "$ref": "#/components/schemas/ClaimantUpdate"
          },
          "claimantsAddress": {
            "$ref": "#/components/schemas/ClaimantAddressUpdate"
          },
          "referringorganization": {
            "$ref": "#/components/schemas/ReferringOrganizationUpdate"
          },
          "referrercontactprofile": {
            "$ref": "#/components/schemas/ReferrerContactProfileUpdate"
          }
        }
      },
      "FileUploadRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fileNames"
        ],
        "properties": {
          "fileNames": {
            "type": "array",
            "description": "Unique file names to upload (1 to 100). Supported extensions: `.pdf`, `.jpg`, `.jpeg`, `.png`, `.tif`, `.tiff`, `.gif`, `.doc`, `.docx`.",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "example": [
              "medical-record.pdf",
              "x-ray.png"
            ]
          },
          "priority": {
            "type": "string",
            "description": "SLA priority for the files, from `P0` (highest) to `P4` (lowest). When omitted, your workspace's default priority applies. Wisedocs counts each file's pages after upload; if they are past the priority's page limit, the file is moved to the next lower priority that fits, and its due date follows that priority.",
            "enum": [
              "P0",
              "P1",
              "P2",
              "P3",
              "P4"
            ],
            "example": "P1"
          }
        }
      },
      "FileUploadData": {
        "type": "object",
        "required": [
          "fileName",
          "putUrl",
          "fileUuid",
          "s3PutKey"
        ],
        "properties": {
          "fileName": {
            "type": "string",
            "description": "The file name, as sent in `fileNames`.",
            "example": "medical-record.pdf"
          },
          "putUrl": {
            "type": "string",
            "format": "uri",
            "description": "Presigned S3 URL for uploading the file via HTTP `PUT` with `x-amz-server-side-encryption: AES256` and the file's `Content-Type`.",
            "example": "https://s3.amazonaws.com/example/presigned-upload"
          },
          "fileUuid": {
            "type": "string",
            "format": "uuid",
            "description": "The new file's UUID.",
            "example": "323e4567-e89b-12d3-a456-426614174000"
          },
          "s3PutKey": {
            "type": "string",
            "description": "S3 object key for the upload.",
            "example": "323e4567-e89b-12d3-a456-426614174000/k3Jd9sLm2QpXa7Vb-original"
          }
        }
      },
      "FileUploadResponse": {
        "type": "object",
        "required": [
          "data",
          "status"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "fileData"
            ],
            "properties": {
              "fileData": {
                "type": "array",
                "description": "One item per requested file, in the order of `fileNames`.",
                "items": {
                  "$ref": "#/components/schemas/FileUploadData"
                }
              }
            }
          },
          "status": {
            "type": "string",
            "example": "success"
          }
        }
      },
      "FileInformationResponse": {
        "type": "object",
        "required": [
          "data",
          "status"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "fileUuid",
              "caseUuid",
              "fileName",
              "status",
              "uploadDate"
            ],
            "properties": {
              "fileUuid": {
                "type": "string",
                "format": "uuid",
                "example": "323e4567-e89b-12d3-a456-426614174000"
              },
              "caseUuid": {
                "type": "string",
                "format": "uuid",
                "example": "123e4567-e89b-12d3-a456-426614174000"
              },
              "fileName": {
                "type": "string",
                "example": "medical-record.pdf"
              },
              "status": {
                "type": "string",
                "description": "The file's processing status, for example `NOTAVAIL` (not uploaded yet), `PENDING_VALIDATE`, `VALIDATED`, `QUEUED`, `PROCESSED`, or `INVALID` (validation failed).",
                "example": "QUEUED"
              },
              "pageCount": {
                "type": "integer",
                "nullable": true,
                "description": "Set once validation counts the pages.",
                "example": 42
              },
              "uploadDate": {
                "type": "string",
                "format": "date-time",
                "description": "When the file record was created.",
                "example": "2026-01-15T14:30:00Z"
              },
              "dueDate": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "example": "2026-01-22T14:30:00Z"
              },
              "reviewDate": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "example": null
              },
              "getUrl": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "Presigned download URL; `null` until the file is uploaded.",
                "example": "https://s3.amazonaws.com/example/presigned-download"
              }
            }
          },
          "status": {
            "type": "string",
            "example": "success"
          }
        }
      },
      "FileStatusUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "`UPLOADED` once the file has been uploaded to its `putUrl`.",
            "enum": [
              "UPLOADED"
            ],
            "example": "UPLOADED"
          }
        }
      },
      "FileStatusResponse": {
        "type": "object",
        "required": [
          "data",
          "status"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "fileUuid",
              "caseUuid",
              "status"
            ],
            "properties": {
              "fileUuid": {
                "type": "string",
                "format": "uuid",
                "example": "323e4567-e89b-12d3-a456-426614174000"
              },
              "caseUuid": {
                "type": "string",
                "format": "uuid",
                "example": "123e4567-e89b-12d3-a456-426614174000"
              },
              "status": {
                "type": "string",
                "description": "The file's processing status after the call: `PENDING_VALIDATE` right after the first report, or a later status when the upload was already reported.",
                "example": "PENDING_VALIDATE"
              }
            }
          },
          "status": {
            "type": "string",
            "example": "success"
          }
        }
      },
      "Team": {
        "type": "object",
        "required": [
          "uuid",
          "name"
        ],
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "example": "0b6e1e8a-6b0e-4f5c-9a7e-1f2a3b4c5d6e"
          },
          "name": {
            "type": "string",
            "example": "Claims"
          }
        }
      },
      "TeamList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Total number of matching teams.",
            "example": 1
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Team"
            }
          }
        }
      }
    },
    "responses": {
      "TooManyRequests": {
        "description": "Request rate limit exceeded.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "TokenSuccess": {
        "description": "Access token issued.",
        "headers": {
          "Cache-Control": {
            "schema": {
              "type": "string",
              "example": "no-store"
            }
          },
          "Pragma": {
            "schema": {
              "type": "string",
              "example": "no-cache"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TokenResponse"
            }
          }
        }
      },
      "OAuthBadRequest": {
        "description": "Invalid request or unsupported grant type.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OAuthError"
            }
          }
        }
      },
      "OAuthUnauthorized": {
        "description": "Client authentication failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OAuthError"
            }
          }
        }
      },
      "TokenManagementBadRequest": {
        "description": "The token field is missing.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OAuthClientError"
            }
          }
        }
      },
      "OAuthClientUnauthorized": {
        "description": "Confidential-client authentication failed.",
        "headers": {
          "WWW-Authenticate": {
            "description": "HTTP Basic authentication challenge for an OAuth client.",
            "schema": {
              "type": "string",
              "example": "Basic realm=\"oauth-client\""
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OAuthClientError"
            }
          }
        }
      },
      "TokenManagementUnavailable": {
        "description": "Token status cannot be checked or revocation cannot be confirmed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OAuthClientError"
            }
          }
        }
      },
      "Search": {
        "description": "Matching cases returned.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CaseSearchResponse"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Request validation failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The Bearer token is missing, invalid, or expired.",
        "headers": {
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWW-Authenticate"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The token is not permitted to perform this operation. When a required\nscope is missing, `error.code` is `insufficient_scope` and\n`error.message` names the missing scope.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Created": {
        "description": "Case created.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CaseCreateResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with an existing resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "The service failed while processing the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "CaseDetail": {
        "description": "Case returned.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CaseGetResponse"
            },
            "examples": {
              "default": {
                "summary": "Default",
                "value": {
                  "status": "success",
                  "data": {
                    "caseUuid": "123e4567-e89b-12d3-a456-426614174000",
                    "created": "2026-01-15T14:30:00Z",
                    "case": {
                      "internalCaseNumber": "CASE-12345",
                      "caseType": "personal-injury",
                      "status": "OPENED",
                      "teams": [
                        "0b6e1e8a-6b0e-4f5c-9a7e-1f2a3b4c5d6e"
                      ]
                    },
                    "claim": {
                      "claimNumber": "CLM-12345",
                      "dateOfLoss": "2026-01-15",
                      "policyNumber": "POL-12345"
                    },
                    "claimant": {
                      "firstName": "John",
                      "lastName": "Doe",
                      "email": "john.doe@example.com",
                      "dateOfBirth": "1980-01-15",
                      "gender": "M",
                      "mobilePhone": "+15551234567",
                      "officePhone": "+15551234567"
                    },
                    "claimantsAddress": {
                      "street1": "123 Example Street",
                      "street2": "Suite 100",
                      "city": "Toronto",
                      "postal": "M5V 1A1",
                      "province": "ON",
                      "country": "Canada"
                    },
                    "referringorganization": {
                      "name": "Example Organization"
                    },
                    "referrercontactprofile": {
                      "firstName": "Jane",
                      "email": "referrer@example.com"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Updated": {
        "description": "Case updated.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CaseGetResponse"
            },
            "examples": {
              "default": {
                "summary": "Default",
                "value": {
                  "status": "success",
                  "data": {
                    "caseUuid": "123e4567-e89b-12d3-a456-426614174000",
                    "created": "2026-01-15T14:30:00Z",
                    "case": {
                      "internalCaseNumber": "CASE-12345",
                      "caseType": "personal-injury",
                      "status": "CLOSED",
                      "teams": [
                        "0b6e1e8a-6b0e-4f5c-9a7e-1f2a3b4c5d6e"
                      ]
                    },
                    "claim": {
                      "claimNumber": "CLM-12345",
                      "dateOfLoss": "2026-01-15",
                      "policyNumber": "POL-12345"
                    },
                    "claimant": {
                      "firstName": "John",
                      "lastName": "Doe",
                      "email": "john.doe@example.com",
                      "dateOfBirth": "1980-01-15",
                      "gender": "M",
                      "mobilePhone": "+15551234567",
                      "officePhone": "+15551234567"
                    },
                    "claimantsAddress": {
                      "street1": "456 New Street",
                      "street2": "",
                      "city": "Toronto",
                      "postal": "M5V 1A1",
                      "province": "ON",
                      "country": "Canada"
                    },
                    "referringorganization": {
                      "name": "Example Organization"
                    },
                    "referrercontactprofile": {
                      "firstName": "Jane",
                      "email": "referrer@example.com"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Uploaded": {
        "description": "File records and their presigned upload URLs created.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/FileUploadResponse"
            },
            "example": {
              "data": {
                "fileData": [
                  {
                    "fileName": "medical-record.pdf",
                    "putUrl": "https://s3.amazonaws.com/example/presigned-upload-1",
                    "fileUuid": "323e4567-e89b-12d3-a456-426614174000",
                    "s3PutKey": "323e4567-e89b-12d3-a456-426614174000/k3Jd9sLm2QpXa7Vb-original"
                  },
                  {
                    "fileName": "x-ray.png",
                    "putUrl": "https://s3.amazonaws.com/example/presigned-upload-2",
                    "fileUuid": "423e4567-e89b-12d3-a456-426614174001",
                    "s3PutKey": "423e4567-e89b-12d3-a456-426614174001/Wq8Zr2Tn5YcFh1Ld-original"
                  }
                ]
              },
              "status": "success"
            }
          }
        }
      },
      "File": {
        "description": "File information returned.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/FileInformationResponse"
            }
          }
        }
      },
      "StatusUpdated": {
        "description": "Upload reported, or already reported before.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/FileStatusResponse"
            },
            "example": {
              "data": {
                "fileUuid": "323e4567-e89b-12d3-a456-426614174000",
                "caseUuid": "123e4567-e89b-12d3-a456-426614174000",
                "status": "PENDING_VALIDATE"
              },
              "status": "success"
            }
          }
        }
      },
      "List": {
        "description": "Matching teams.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "status",
                "data"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "success"
                  ],
                  "example": "success"
                },
                "data": {
                  "$ref": "#/components/schemas/TeamList"
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "SearchCaseUuid": {
        "in": "query",
        "name": "caseUuid",
        "required": false,
        "description": "Filter by case UUID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "123e4567-e89b-12d3-a456-426614174000"
      },
      "SearchInternalCaseNumber": {
        "in": "query",
        "name": "internalCaseNumber",
        "required": false,
        "description": "Filter by exact internal case number (case-insensitive).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 254
        },
        "example": "CASE-12345"
      },
      "SearchClaimNumber": {
        "in": "query",
        "name": "claimNumber",
        "required": false,
        "description": "Filter by exact claim number (case-insensitive).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 254
        },
        "example": "CLM-12345"
      },
      "Limit": {
        "in": "query",
        "name": "limit",
        "required": false,
        "description": "Page size.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 10
        },
        "example": 10
      },
      "Offset": {
        "in": "query",
        "name": "offset",
        "required": false,
        "description": "Number of results to skip.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "example": 0
      },
      "CaseUuid": {
        "in": "path",
        "name": "caseUuid",
        "required": true,
        "description": "Case UUID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "FileUuid": {
        "in": "path",
        "name": "fileUuid",
        "required": true,
        "description": "File UUID.",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "TeamName": {
        "name": "name",
        "in": "query",
        "required": false,
        "description": "Only teams whose name contains this text (case-insensitive).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 254,
          "example": "Claims"
        }
      },
      "MemberUsername": {
        "name": "username",
        "in": "query",
        "required": false,
        "description": "Only teams with an active member that has this username (case-insensitive exact match).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 254,
          "example": "jane.doe"
        }
      },
      "MemberEmail": {
        "name": "email",
        "in": "query",
        "required": false,
        "description": "Only teams with an active member that has this email (case-insensitive exact match).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 254,
          "example": "jane.doe@example.com"
        }
      },
      "Limit-2": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Page size.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 10,
          "example": 10
        }
      },
      "Offset-2": {
        "name": "offset",
        "in": "query",
        "required": false,
        "description": "Number of teams to skip.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0,
          "example": 0
        }
      }
    },
    "headers": {
      "WWW-Authenticate": {
        "description": "RFC 6750 Bearer authentication challenge.",
        "schema": {
          "type": "string",
          "example": "Bearer realm=\"api.wisedocs.ai\", error=\"invalid_token\", error_description=\"The access token is invalid or has expired\""
        }
      }
    }
  }
}