{
  "openapi": "3.1.0",
  "info": {
    "title": "Factify API",
    "version": "1.0.0",
    "description": "Factify API enables you to create, manage, and control access to legally-binding documents that replace PDFs.\n\n## Authentication\n\nBearer authentication header of the form Bearer \u003ctoken\u003e, where \u003ctoken\u003e is your auth token.\n\n```\nAuthorization: Bearer ffy...\n```\n\n## Rate Limiting\n\n- 1000 requests per minute per API key\n- 100 requests per minute for resource creation (POST)\n\n## Errors\n\nFactify uses conventional HTTP status codes and returns structured error responses:\n\n```json\n{\n  \"error\": {\n    \"type\": \"invalid_request_error\",\n    \"message\": \"Document title cannot be empty\",\n    \"param\": \"title\",\n    \"code\": \"missing_required_field\"\n  }\n}\n```\n",
    "contact": {
      "name": "Factify API Support",
      "email": "api@factify.com",
      "url": "https://factify.com/support"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://factify.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://bfc147e0ea6a.ngrok-free.app",
      "description": "Production server"
    },
    {
      "url": "https://api.factify-dev.com",
      "description": "Dev server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Bearer authentication header of the form Bearer \u003ctoken\u003e, where \u003ctoken\u003e is your auth token."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request parameters",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "validation_error": {
                "value": {
                  "error": {
                    "type": "invalid_request_error",
                    "message": "Document title cannot be empty",
                    "code": "missing_required_field",
                    "param": "title",
                    "retry_after": null
                  }
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Authorization failed - valid key but insufficient permissions",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "insufficient_permissions": {
                "value": {
                  "error": {
                    "type": "authorization_error",
                    "message": "You do not have permission to access this resource",
                    "code": "insufficient_permissions",
                    "param": null,
                    "retry_after": null
                  }
                }
              }
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "internal_error": {
                "value": {
                  "error": {
                    "type": "api_error",
                    "message": "An unexpected error occurred. Please try again later.",
                    "code": "internal_error",
                    "param": null,
                    "retry_after": null
                  }
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "resource_not_found": {
                "value": {
                  "error": {
                    "type": "not_found_error",
                    "message": "Document not found",
                    "code": "resource_not_found",
                    "param": null,
                    "retry_after": null
                  }
                }
              }
            }
          }
        }
      },
      "RateLimitExceeded": {
        "description": "Too many requests",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "rate_limit": {
                "value": {
                  "error": {
                    "type": "rate_limit_error",
                    "message": "Too many requests. Retry after 30 seconds.",
                    "code": "rate_limit_exceeded",
                    "param": null,
                    "retry_after": 30
                  }
                }
              }
            }
          }
        },
        "headers": {
          "X-RateLimit-Limit": {
            "schema": {
              "type": "integer"
            },
            "description": "Request limit per minute"
          },
          "X-RateLimit-Remaining": {
            "schema": {
              "type": "integer"
            },
            "description": "Remaining requests in current window"
          },
          "X-RateLimit-Reset": {
            "schema": {
              "type": "integer"
            },
            "description": "Unix timestamp when rate limit resets"
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication failed - missing or invalid API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "missing_key": {
                "value": {
                  "error": {
                    "type": "authentication_error",
                    "message": "No API key provided",
                    "code": "missing_api_key",
                    "param": null,
                    "retry_after": null
                  }
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "message",
              "code",
              "param",
              "retry_after"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "authentication_error",
                  "authorization_error",
                  "not_found_error",
                  "rate_limit_error",
                  "api_error"
                ],
                "description": "Error type for programmatic handling"
              },
              "message": {
                "type": "string",
                "description": "Human-readable error message"
              },
              "code": {
                "type": "string",
                "description": "Specific error code for detailed handling"
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Parameter that caused the error (for validation errors)"
              },
              "retry_after": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Seconds to wait before retrying (for rate limit errors)"
              }
            }
          }
        }
      },
      "factify.api.v1beta.AccessLevel": {
        "enum": [
          "private",
          "organization",
          "public"
        ]
      },
      "factify.api.v1beta.AttachPolicyRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "policy_id": {
            "type": "string",
            "title": "policy_id",
            "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Policy ID to attach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}"
          }
        },
        "title": "AttachPolicyRequest",
        "required": [
          "policy_id"
        ],
        "additionalProperties": false,
        "description": "AttachPolicyRequest specifies a policy to attach to a document."
      },
      "factify.api.v1beta.CreateDocumentRequest": {
        "type": "object",
        "properties": {
          "payload": {
            "type": "string",
            "title": "payload",
            "format": "binary",
            "description": "PDF file to upload"
          },
          "title": {
            "type": "string",
            "title": "title",
            "maxLength": 255,
            "minLength": 1,
            "description": "Document title."
          },
          "description": {
            "type": "string",
            "title": "description",
            "maxLength": 2000,
            "description": "Optional document description.",
            "nullable": true
          },
          "access_level": {
            "title": "access_level",
            "description": "Document access level. Defaults to organization if user belongs to an org, otherwise private.",
            "nullable": true,
            "$ref": "#/components/schemas/factify.api.v1beta.AccessLevel"
          },
          "payload_key": {
            "type": "string",
            "title": "payload_key",
            "description": "Storage key for uploaded file (set by server)",
            "readOnly": true
          },
          "document_id": {
            "type": "string",
            "title": "document_id",
            "description": "Pre-generated document ID (set by server)",
            "readOnly": true
          },
          "version_id": {
            "type": "string",
            "title": "version_id",
            "description": "Pre-generated version ID (set by server)",
            "readOnly": true
          }
        },
        "title": "CreateDocumentRequest",
        "required": [
          "payload",
          "title"
        ],
        "additionalProperties": false,
        "description": "CreateDocumentRequest contains the file and metadata for creating a document."
      },
      "factify.api.v1beta.CreateVersionRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID to create version for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "payload": {
            "type": "string",
            "title": "payload",
            "format": "binary",
            "description": "PDF file for new version"
          },
          "title": {
            "type": "string",
            "title": "title",
            "maxLength": 255,
            "description": "Optional version title.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "title": "description",
            "description": "Description of changes in this version.",
            "nullable": true
          },
          "payload_key": {
            "type": "string",
            "title": "payload_key",
            "description": "Storage key for uploaded file (set by server)",
            "readOnly": true
          },
          "version_id": {
            "type": "string",
            "title": "version_id",
            "description": "Pre-generated version ID (set by server)",
            "readOnly": true
          }
        },
        "title": "CreateVersionRequest",
        "required": [
          "payload"
        ],
        "additionalProperties": false,
        "description": "CreateVersionRequest contains the file and metadata for creating a version."
      },
      "factify.api.v1beta.DetachPolicyRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "policy_id": {
            "type": "string",
            "title": "policy_id",
            "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Policy ID to detach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}"
          }
        },
        "title": "DetachPolicyRequest",
        "additionalProperties": false,
        "description": "DetachPolicyRequest identifies a policy to detach from a document."
      },
      "factify.api.v1beta.Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "title": "id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Unique ID for the document.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "example": "doc_01h2xcejqtf2nbrexx3vqjhp41"
          },
          "factify_url": {
            "type": "string",
            "title": "factify_url",
            "format": "uri",
            "description": "Factify URL for accessing the document.",
            "example": "https://d.factify.com/d/01h2xcejqtf2nbrexx3vqjhp41"
          },
          "title": {
            "type": "string",
            "title": "title",
            "maxLength": 255,
            "minLength": 1,
            "description": "Document title.",
            "example": "Q4 2024 Financial Report"
          },
          "description": {
            "type": "string",
            "title": "description",
            "maxLength": 2000,
            "description": "Optional document description.",
            "nullable": true,
            "example": "Quarterly financial report for Q4 2024"
          },
          "access_level": {
            "title": "access_level",
            "description": "Document access level.",
            "$ref": "#/components/schemas/factify.api.v1beta.AccessLevel"
          },
          "processing_status": {
            "title": "processing_status",
            "description": "Processing status.",
            "$ref": "#/components/schemas/factify.api.v1beta.ProcessingStatus"
          },
          "created_at": {
            "title": "created_at",
            "description": "Timestamp when document was created.",
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "title": "created_by",
            "description": "User who created the document.",
            "$ref": "#/components/schemas/factify.api.v1beta.User"
          },
          "current_version": {
            "title": "current_version",
            "description": "Reference to the current version, if any.",
            "nullable": true,
            "$ref": "#/components/schemas/factify.api.v1beta.VersionRef"
          }
        },
        "title": "Document",
        "required": [
          "id",
          "factify_url",
          "title",
          "access_level",
          "processing_status",
          "created_at",
          "created_by"
        ],
        "additionalProperties": false,
        "description": "Document represents a Factify document."
      },
      "factify.api.v1beta.DocumentPolicy": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID this policy is attached to.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "example": "doc_01h2xcejqtf2nbrexx3vqjhp41"
          },
          "attached_at": {
            "title": "attached_at",
            "description": "Timestamp when policy was attached.",
            "type": "string",
            "format": "date-time"
          },
          "attached_by": {
            "title": "attached_by",
            "description": "User who attached the policy.",
            "$ref": "#/components/schemas/factify.api.v1beta.User"
          },
          "policy": {
            "title": "policy",
            "description": "The policy details.",
            "$ref": "#/components/schemas/factify.api.v1beta.Policy"
          }
        },
        "title": "DocumentPolicy",
        "required": [
          "document_id",
          "attached_at",
          "attached_by",
          "policy"
        ],
        "additionalProperties": false,
        "description": "DocumentPolicy represents a policy attached to a document."
      },
      "factify.api.v1beta.GenerateEntryPageRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          }
        },
        "title": "GenerateEntryPageRequest",
        "additionalProperties": false,
        "description": "GenerateEntryPageRequest identifies a document to generate an entry page for."
      },
      "factify.api.v1beta.GenerateEntryPageResponse": {
        "type": "object",
        "properties": {
          "download_url": {
            "type": "string",
            "title": "download_url",
            "format": "uri",
            "description": "Temporary download URL for the entry page PDF.",
            "example": "https://storage.factify.com/entry-pages/abc123.pdf?token=xyz"
          }
        },
        "title": "GenerateEntryPageResponse",
        "required": [
          "download_url"
        ],
        "additionalProperties": false,
        "description": "GenerateEntryPageResponse contains the download URL for the entry page."
      },
      "factify.api.v1beta.GetDocumentRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          }
        },
        "title": "GetDocumentRequest",
        "additionalProperties": false,
        "description": "GetDocumentRequest identifies a document to retrieve."
      },
      "factify.api.v1beta.GetVersionRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "version_id": {
            "type": "string",
            "title": "version_id",
            "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Version ID.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}"
          }
        },
        "title": "GetVersionRequest",
        "additionalProperties": false,
        "description": "GetVersionRequest identifies a specific version to retrieve."
      },
      "factify.api.v1beta.ListDocumentPoliciesRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "limit": {
            "type": "integer",
            "title": "limit",
            "maximum": 100,
            "minimum": 1,
            "format": "int32",
            "description": "Number of results to return (1-100). Default: 50.",
            "nullable": true,
            "example": 50
          },
          "cursor": {
            "type": "string",
            "title": "cursor",
            "description": "Opaque pagination cursor from previous response."
          }
        },
        "title": "ListDocumentPoliciesRequest",
        "additionalProperties": false,
        "description": "ListDocumentPoliciesRequest specifies pagination for listing document policies."
      },
      "factify.api.v1beta.ListDocumentPoliciesResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/factify.api.v1beta.DocumentPolicy"
            },
            "title": "items",
            "description": "List of policy attachments."
          },
          "pagination": {
            "title": "pagination",
            "description": "Pagination metadata.",
            "$ref": "#/components/schemas/factify.api.v1beta.Pagination"
          }
        },
        "title": "ListDocumentPoliciesResponse",
        "additionalProperties": false,
        "description": "ListDocumentPoliciesResponse contains a page of policy attachments."
      },
      "factify.api.v1beta.ListDocumentsRequest": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "title": "limit",
            "maximum": 100,
            "minimum": 1,
            "format": "int32",
            "description": "Number of results to return (1-100). Default: 50.",
            "nullable": true,
            "example": 50
          },
          "cursor": {
            "type": "string",
            "title": "cursor",
            "description": "Opaque pagination cursor from previous response.\n Format: Base64-encoded string from the pagination.next_cursor field.",
            "example": "eyJsYXN0X2lkIjoiZG9jXzAxaDJ4Y2VqcXRmMm5icmV4eDN2cWpocDQxIn0"
          },
          "created_after": {
            "title": "created_after",
            "description": "Filter: return documents created after this timestamp.",
            "nullable": true,
            "type": "string",
            "format": "date-time"
          },
          "created_before": {
            "title": "created_before",
            "description": "Filter: return documents created before this timestamp.",
            "nullable": true,
            "type": "string",
            "format": "date-time"
          }
        },
        "title": "ListDocumentsRequest",
        "additionalProperties": false,
        "description": "ListDocumentsRequest specifies filters and pagination for listing documents.\ncreated_time_range // created_after must be before created_before\n"
      },
      "factify.api.v1beta.ListDocumentsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/factify.api.v1beta.Document"
            },
            "title": "items",
            "description": "List of documents."
          },
          "pagination": {
            "title": "pagination",
            "description": "Pagination metadata.",
            "$ref": "#/components/schemas/factify.api.v1beta.Pagination"
          }
        },
        "title": "ListDocumentsResponse",
        "additionalProperties": false,
        "description": "ListDocumentsResponse contains a page of documents."
      },
      "factify.api.v1beta.ListVersionsRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID to list versions for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "limit": {
            "type": "integer",
            "title": "limit",
            "maximum": 100,
            "minimum": 1,
            "format": "int32",
            "description": "Number of results to return (1-100). Default: 50.",
            "nullable": true,
            "example": 50
          },
          "cursor": {
            "type": "string",
            "title": "cursor",
            "description": "Opaque pagination cursor from previous response."
          }
        },
        "title": "ListVersionsRequest",
        "additionalProperties": false,
        "description": "ListVersionsRequest specifies filters and pagination for listing versions."
      },
      "factify.api.v1beta.ListVersionsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/factify.api.v1beta.Version"
            },
            "title": "items",
            "description": "List of versions."
          },
          "pagination": {
            "title": "pagination",
            "description": "Pagination metadata.",
            "$ref": "#/components/schemas/factify.api.v1beta.Pagination"
          }
        },
        "title": "ListVersionsResponse",
        "additionalProperties": false,
        "description": "ListVersionsResponse contains a page of versions."
      },
      "factify.api.v1beta.Pagination": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": "string",
            "title": "next_cursor",
            "description": "Cursor for fetching the next page, empty if no more results.",
            "example": "eyJsYXN0X2lkIjoiZG9jXzAxaDJ4Y2VqcXRmMm5icmV4eDN2cWpocDQxIn0"
          },
          "has_more": {
            "type": "boolean",
            "title": "has_more",
            "description": "Whether there are more results available."
          }
        },
        "title": "Pagination",
        "additionalProperties": false,
        "description": "Pagination contains cursor-based pagination metadata."
      },
      "factify.api.v1beta.Policy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "title": "id",
            "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Unique ID for the policy.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}",
            "example": "pol_01h2xcejqtf2nbrexx3vqjhp41"
          },
          "name": {
            "type": "string",
            "title": "name",
            "minLength": 1,
            "description": "Policy name.",
            "example": "GDPR Compliance Policy"
          },
          "created_at": {
            "title": "created_at",
            "description": "Timestamp when policy was created.",
            "type": "string",
            "format": "date-time"
          }
        },
        "title": "Policy",
        "required": [
          "id",
          "name",
          "created_at"
        ],
        "additionalProperties": false,
        "description": "Policy represents a governance policy."
      },
      "factify.api.v1beta.ProcessingStatus": {
        "enum": [
          "processing",
          "ready",
          "failed"
        ]
      },
      "factify.api.v1beta.UpdateDocumentRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID to update.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "title": {
            "type": "string",
            "title": "title",
            "maxLength": 255,
            "minLength": 1,
            "description": "New title (1-255 characters).",
            "nullable": true
          },
          "description": {
            "type": "string",
            "title": "description",
            "maxLength": 2000,
            "description": "New description (max 2000 characters).",
            "nullable": true
          }
        },
        "title": "UpdateDocumentRequest",
        "additionalProperties": false,
        "description": "UpdateDocumentRequest specifies fields to update on a document."
      },
      "factify.api.v1beta.UpdateVersionRequest": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
          },
          "version_id": {
            "type": "string",
            "title": "version_id",
            "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Version ID to update.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}"
          },
          "title": {
            "type": "string",
            "title": "title",
            "maxLength": 255,
            "description": "New title (max 255 characters).",
            "nullable": true
          },
          "description": {
            "type": "string",
            "title": "description",
            "description": "New description.",
            "nullable": true
          }
        },
        "title": "UpdateVersionRequest",
        "additionalProperties": false,
        "description": "UpdateVersionRequest specifies fields to update on a version."
      },
      "factify.api.v1beta.User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "title": "id",
            "pattern": "^(user|svc)_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Unique ID for the user or service account.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26} for users, svc_[0-9a-hjkmnp-tv-z]{26} for service accounts",
            "example": "user_01h2xcejqtf2nbrexx3vqjhp41"
          },
          "type": {
            "title": "type",
            "description": "User type discriminator.",
            "$ref": "#/components/schemas/factify.api.v1beta.UserType"
          },
          "name": {
            "type": "string",
            "title": "name",
            "minLength": 1,
            "description": "Display name of the user or service account.",
            "example": "John Doe"
          }
        },
        "title": "User",
        "required": [
          "id",
          "type",
          "name"
        ],
        "additionalProperties": false,
        "description": "User represents a user or service account."
      },
      "factify.api.v1beta.UserType": {
        "enum": [
          "user_account",
          "service_account"
        ]
      },
      "factify.api.v1beta.Version": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "title": "id",
            "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Unique ID for the version.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}",
            "example": "ver_01h2abcd1234efgh5678jkmnpt"
          },
          "document_id": {
            "type": "string",
            "title": "document_id",
            "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Parent document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "example": "doc_01h2xcejqtf2nbrexx3vqjhp41"
          },
          "factify_url": {
            "type": "string",
            "title": "factify_url",
            "format": "uri",
            "description": "Factify URL for accessing this version.",
            "example": "https://d.factify.com/d/01h2xcejqtf2nbrexx3vqjhp41/v/1"
          },
          "title": {
            "type": "string",
            "title": "title",
            "maxLength": 255,
            "description": "Optional version title.",
            "nullable": true,
            "example": "Version 2.0"
          },
          "description": {
            "type": "string",
            "title": "description",
            "description": "Description of changes in this version.",
            "nullable": true
          },
          "processing_status": {
            "title": "processing_status",
            "description": "Processing status.",
            "$ref": "#/components/schemas/factify.api.v1beta.ProcessingStatus"
          },
          "created_at": {
            "title": "created_at",
            "description": "Timestamp when version was created.",
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "title": "created_by",
            "description": "User who created the version.",
            "$ref": "#/components/schemas/factify.api.v1beta.User"
          }
        },
        "title": "Version",
        "required": [
          "id",
          "document_id",
          "factify_url",
          "processing_status",
          "created_at",
          "created_by"
        ],
        "additionalProperties": false,
        "description": "Version represents a document version."
      },
      "factify.api.v1beta.VersionRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "title": "id",
            "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$",
            "description": "Version ID.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}",
            "example": "ver_01h2abcd1234efgh5678jkmnpt"
          }
        },
        "title": "VersionRef",
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "description": "VersionRef is a lightweight reference to a version."
      },
      "google.protobuf.Empty": {
        "type": "object",
        "description": "A generic empty message that you can re-use to avoid defining duplicated\n empty messages in your APIs. A typical example is to use it as the request\n or the response type of an API method. For instance:\n\n     service Foo {\n       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n     }"
      }
    }
  },
  "paths": {
    "/v1/documents": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "List documents",
        "description": "List documents with cursor-based pagination.",
        "operationId": "listDocuments",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results to return (1-100). Default: 50.",
            "schema": {
              "type": "integer",
              "title": "limit",
              "maximum": 100,
              "minimum": 1,
              "format": "int32",
              "description": "Number of results to return (1-100). Default: 50.",
              "example": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from previous response.\n Format: Base64-encoded string from the pagination.next_cursor field.",
            "schema": {
              "type": "string",
              "title": "cursor",
              "description": "Opaque pagination cursor from previous response.\n Format: Base64-encoded string from the pagination.next_cursor field.",
              "example": "eyJsYXN0X2lkIjoiZG9jXzAxaDJ4Y2VqcXRmMm5icmV4eDN2cWpocDQxIn0"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Filter by created after (RFC 3339 format, e.g., 2024-01-15T09:30:00Z)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.ListDocumentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-speakeasy-pagination": {
          "type": "cursor",
          "inputs": [
            {
              "name": "cursor",
              "in": "parameters",
              "type": "cursor"
            }
          ],
          "outputs": {
            "nextCursor": "$.next_cursor"
          }
        }
      },
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Create a document",
        "description": "Creates a new document by uploading a PDF file.",
        "operationId": "createDocument",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/factify.api.v1beta.CreateDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.Document"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/documents/{document_id}": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "Retrieve a document",
        "description": "Retrieve a document by ID.",
        "operationId": "getDocument",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.Document"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "tags": [
          "Documents"
        ],
        "summary": "Update a document",
        "description": "Update document title and description.",
        "operationId": "updateDocument",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID to update.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID to update.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "title": "title",
                    "maxLength": 255,
                    "minLength": 1,
                    "description": "New title (1-255 characters).",
                    "nullable": true
                  },
                  "description": {
                    "type": "string",
                    "title": "description",
                    "maxLength": 2000,
                    "description": "New description (max 2000 characters).",
                    "nullable": true
                  }
                },
                "title": "UpdateDocumentRequest",
                "additionalProperties": false,
                "description": "UpdateDocumentRequest specifies fields to update on a document."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.Document"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/documents/{document_id}/entry_page": {
      "post": {
        "tags": [
          "Entry Pages"
        ],
        "summary": "Generate entry page",
        "description": "Generate and return a temporary downloadable URL for the document entry page PDF.",
        "operationId": "generateDocumentEntryPage",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.GenerateEntryPageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/documents/{document_id}/policies": {
      "get": {
        "tags": [
          "Policies"
        ],
        "summary": "List document policies",
        "description": "List policies attached to a document.",
        "operationId": "listDocumentPolicies",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results to return (1-100). Default: 50.",
            "schema": {
              "type": "integer",
              "title": "limit",
              "maximum": 100,
              "minimum": 1,
              "format": "int32",
              "description": "Number of results to return (1-100). Default: 50.",
              "example": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from previous response.",
            "schema": {
              "type": "string",
              "title": "cursor",
              "description": "Opaque pagination cursor from previous response."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.ListDocumentPoliciesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-speakeasy-pagination": {
          "type": "cursor",
          "inputs": [
            {
              "name": "cursor",
              "in": "parameters",
              "type": "cursor"
            }
          ],
          "outputs": {
            "nextCursor": "$.next_cursor"
          }
        }
      },
      "post": {
        "tags": [
          "Policies"
        ],
        "summary": "Attach a policy",
        "description": "Attach a policy to a document.",
        "operationId": "attachDocumentPolicy",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "policy_id": {
                    "type": "string",
                    "title": "policy_id",
                    "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$",
                    "description": "Policy ID to attach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}"
                  }
                },
                "title": "AttachPolicyRequest",
                "required": [
                  "policy_id"
                ],
                "additionalProperties": false,
                "description": "AttachPolicyRequest specifies a policy to attach to a document."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.DocumentPolicy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/documents/{document_id}/policies/{policy_id}": {
      "delete": {
        "tags": [
          "Policies"
        ],
        "summary": "Detach a policy",
        "description": "Detach a policy from a document.",
        "operationId": "detachDocumentPolicy",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          },
          {
            "name": "policy_id",
            "in": "path",
            "description": "Policy ID to detach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "policy_id",
              "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Policy ID to detach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/google.protobuf.Empty"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/documents/{document_id}/versions": {
      "get": {
        "tags": [
          "Versions"
        ],
        "summary": "List document versions",
        "description": "List versions for a document with cursor-based pagination.",
        "operationId": "listDocumentVersions",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID to list versions for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID to list versions for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results to return (1-100). Default: 50.",
            "schema": {
              "type": "integer",
              "title": "limit",
              "maximum": 100,
              "minimum": 1,
              "format": "int32",
              "description": "Number of results to return (1-100). Default: 50.",
              "example": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from previous response.",
            "schema": {
              "type": "string",
              "title": "cursor",
              "description": "Opaque pagination cursor from previous response."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.ListVersionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-speakeasy-pagination": {
          "type": "cursor",
          "inputs": [
            {
              "name": "cursor",
              "in": "parameters",
              "type": "cursor"
            }
          ],
          "outputs": {
            "nextCursor": "$.next_cursor"
          }
        }
      },
      "post": {
        "tags": [
          "Versions"
        ],
        "summary": "Create a new version",
        "description": "Creates a new version by uploading a PDF file.",
        "operationId": "createDocumentVersion",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID to create version for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID to create version for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/factify.api.v1beta.CreateVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.Version"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/documents/{document_id}/versions/{version_id}": {
      "get": {
        "tags": [
          "Versions"
        ],
        "summary": "Retrieve a version",
        "description": "Retrieve a specific version by ID.",
        "operationId": "getDocumentVersion",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "description": "Version ID.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "version_id",
              "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Version ID.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.Version"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "tags": [
          "Versions"
        ],
        "summary": "Update a version",
        "description": "Update version title and description.",
        "operationId": "updateDocumentVersion",
        "parameters": [
          {
            "name": "document_id",
            "in": "path",
            "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "document_id",
              "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "description": "Version ID to update.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}",
            "required": true,
            "schema": {
              "type": "string",
              "title": "version_id",
              "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$",
              "description": "Version ID to update.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "title": "title",
                    "maxLength": 255,
                    "description": "New title (max 255 characters).",
                    "nullable": true
                  },
                  "description": {
                    "type": "string",
                    "title": "description",
                    "description": "New description.",
                    "nullable": true
                  }
                },
                "title": "UpdateVersionRequest",
                "additionalProperties": false,
                "description": "UpdateVersionRequest specifies fields to update on a version."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/factify.api.v1beta.Version"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Documents",
      "description": "Create, retrieve, update, and manage documents."
    },
    {
      "name": "Versions",
      "description": "Manage document versions and version history."
    },
    {
      "name": "Policies",
      "description": "Attach and manage access policies for documents."
    },
    {
      "name": "Entry Pages",
      "description": "Generate shareable entry pages for documents."
    }
  ]
}
