{ "components": { "responses": { "BadRequest": { "content": { "application/json": { "examples": { "validation_error": { "value": { "code": "invalid_argument", "details": [ { "param": "title", "reason": "missing_required_field", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "Document title cannot be empty" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Invalid request parameters" }, "Conflict": { "content": { "application/json": { "examples": { "already_exists": { "value": { "code": "already_exists", "details": [ { "reason": "resource_already_exists", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "Document already exists" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Resource already exists" }, "Forbidden": { "content": { "application/json": { "examples": { "insufficient_permissions": { "value": { "code": "permission_denied", "details": [ { "reason": "insufficient_permissions", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "Permission denied" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Authorization failed - valid key but insufficient permissions" }, "InternalServerError": { "content": { "application/json": { "examples": { "internal_error": { "value": { "code": "internal", "details": [ { "reason": "internal_error", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "An internal error occurred" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Internal server error" }, "NotFound": { "content": { "application/json": { "examples": { "resource_not_found": { "value": { "code": "not_found", "details": [ { "reason": "resource_not_found", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "Document not found" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Resource not found" }, "RateLimitExceeded": { "content": { "application/json": { "examples": { "rate_limit": { "value": { "code": "resource_exhausted", "details": [ { "reason": "rate_limit_exceeded", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "Too many requests" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Too many requests", "headers": { "X-RateLimit-Limit": { "description": "Request limit per minute", "schema": { "type": "integer" } }, "X-RateLimit-Remaining": { "description": "Remaining requests in current window", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "Unix timestamp when rate limit resets", "schema": { "type": "integer" } } } }, "ServiceUnavailable": { "content": { "application/json": { "examples": { "unavailable": { "value": { "code": "unavailable", "details": [ { "reason": "service_unavailable", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "Service temporarily unavailable" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Service temporarily unavailable" }, "Unauthorized": { "content": { "application/json": { "examples": { "missing_key": { "value": { "code": "unauthenticated", "details": [ { "reason": "missing_api_key", "request_id": "req_01arwx4k8xrgqskvxq69gdn019" } ], "message": "API key is required" } } }, "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }, "description": "Authentication failed - missing or invalid API key" } }, "schemas": { "APIKeyQuota": { "additionalProperties": false, "description": "APIKeyQuota represents per-key quota status.", "properties": { "api_key_id": { "description": "The API key ID.", "example": "key_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "api_key_id", "type": "string" }, "current_usage": { "description": "Current usage for this key in the billing period.", "format": "int32", "title": "current_usage", "type": "integer" }, "is_exceeded": { "description": "Whether this key's quota is exceeded. Only true when limit is set and exceeded.", "title": "is_exceeded", "type": "boolean" }, "limit": { "description": "The configured limit for this key. Not set means no explicit key limit.", "exclusiveMinimum": 0, "format": "int32", "title": "limit", "type": [ "integer", "null" ] }, "remaining": { "description": "Remaining requests for this key. Only meaningful when limit is set.", "format": "int32", "title": "remaining", "type": "integer" } }, "title": "APIKeyQuota", "type": "object" }, "AcceptOrganizationInviteRequest": { "additionalProperties": false, "description": "AcceptOrganizationInviteRequest contains the token to accept an invitation.", "properties": { "organization_id": { "description": "Organization the invitation belongs to (for validation).\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "token": { "description": "The invitation token from the email link.", "maxLength": 128, "title": "token", "type": "string" } }, "required": [ "organization_id", "token" ], "title": "AcceptOrganizationInviteRequest", "type": "object" }, "AcceptOrganizationInviteResponse": { "additionalProperties": false, "description": "AcceptOrganizationInviteResponse contains the organization the user joined.", "properties": { "organization": { "$ref": "#/components/schemas/Organization", "description": "The organization the user is now a member of.", "title": "organization" } }, "required": [ "organization" ], "title": "AcceptOrganizationInviteResponse", "type": "object" }, "AccessGrantResult": { "additionalProperties": false, "description": "AccessGrantResult contains the outcome of granting access to one recipient.", "properties": { "error": { "description": "Error message if the grant failed.", "title": "error", "type": "string" }, "recipient": { "description": "The recipient that was granted access.", "title": "recipient", "type": "string" }, "success": { "description": "Whether the grant succeeded.", "title": "success", "type": "boolean" } }, "title": "AccessGrantResult", "type": "object" }, "AccessLevel": { "enum": [ "private", "organization", "public" ] }, "AccessRequest": { "additionalProperties": false, "description": "AccessRequest represents a request for access to a document.", "properties": { "created_at": { "description": "When the request was created.", "format": "date-time", "title": "created_at", "type": "string" }, "document_id": { "description": "Document this request is for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "id": { "description": "Unique ID for the access request.\n Pattern: acr_[0-9a-hjkmnp-tv-z]{26}", "example": "acr_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^acr_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "message": { "description": "Optional message from the requester.", "example": "Need access for quarterly review", "maxLength": 1024, "title": "message", "type": [ "string", "null" ] }, "permission": { "$ref": "#/components/schemas/AccessRequestPermission", "description": "Permission level being requested.", "title": "permission" }, "request_status": { "$ref": "#/components/schemas/AccessRequestStatus", "description": "Current status of the request.\n Named request_status to avoid field name collision with invite status enum mappings.", "title": "request_status" }, "subject": { "$ref": "#/components/schemas/Subject", "description": "The user requesting access.", "title": "subject" }, "subject_email": { "description": "Email of the requesting user. Denormalized for display convenience.", "example": "dwight@dundermifflin.com", "title": "subject_email", "type": "string" }, "updated_at": { "description": "When the request was last updated.", "format": "date-time", "title": "updated_at", "type": "string" } }, "required": [ "id", "document_id", "subject", "permission", "request_status", "created_at", "updated_at" ], "title": "AccessRequest", "type": "object" }, "AccessRequestPermission": { "enum": [ "view", "edit", "comment" ] }, "AccessRequestStatus": { "enum": [ "pending", "approved", "denied" ] }, "AddOrganizationMemberRequest": { "additionalProperties": false, "description": "AddOrganizationMemberRequest identifies a user to add as a member.", "properties": { "organization_id": { "description": "Organization to add the member to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "role": { "description": "Role for the new member. Cannot be UNSPECIFIED or OWNER.", "enum": [ "admin", "member" ], "example": "member", "title": "role", "type": "string" }, "user_id": { "description": "User account ID of the member to add.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "user_id", "type": "string" } }, "required": [ "organization_id", "user_id", "role" ], "title": "AddOrganizationMemberRequest", "type": "object" }, "AddOrganizationMemberResponse": { "additionalProperties": false, "description": "AddOrganizationMemberResponse contains the added member.", "properties": { "member": { "$ref": "#/components/schemas/OrganizationMember", "description": "The newly added organization member.", "title": "member" } }, "required": [ "member" ], "title": "AddOrganizationMemberResponse", "type": "object" }, "ApiKey": { "additionalProperties": false, "description": "ApiKey represents an authentication credential for programmatic API access.", "properties": { "created_at": { "description": "Timestamp when the key was created.", "format": "date-time", "title": "created_at", "type": "string" }, "expires_at": { "description": "Expiration timestamp. If set, the key becomes invalid after this time.", "format": "date-time", "title": "expires_at", "type": "string" }, "id": { "description": "Unique ID for the API key.\n Pattern: key_[0-9a-hjkmnp-tv-z]{26}", "example": "key_01jd4h5mck9gq6zrp8bn2t4w3x", "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "is_active": { "description": "Whether the key is currently active (not revoked and not expired).\n Computed: is_active = (revoked_at == null) && (expires_at == null || expires_at > now())", "readOnly": true, "title": "is_active", "type": "boolean" }, "key_prefix": { "description": "Truncated key prefix for identification in UI (e.g., \"ffy_prod_01jd4h5...\").\n Shows the first 16 characters for better uniqueness while maintaining security.", "example": "ffy_prod_01jd4h5...", "maxLength": 20, "minLength": 16, "title": "key_prefix", "type": "string" }, "name": { "description": "Human-readable name for the key (e.g., \"Production\", \"Staging\").", "example": "Production", "maxLength": 63, "minLength": 1, "title": "name", "type": "string" }, "organization_id": { "description": "ID of the organization this key belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "revoked_at": { "description": "Timestamp when the key was revoked. Null if the key has not been revoked.", "format": "date-time", "readOnly": true, "title": "revoked_at", "type": "string" } }, "required": [ "id", "name", "organization_id", "created_at", "is_active", "key_prefix" ], "title": "ApiKey", "type": "object" }, "ApproveAccessRequestRequest": { "additionalProperties": false, "description": "ApproveAccessRequestRequest approves an access request.", "properties": { "access_request_id": { "description": "Access request ID to approve.", "example": "acr_01h2xcejqtf2nbrexx3vqjhp42", "pattern": "^acr_[0-9a-hjkmnp-tv-z]{26}$", "title": "access_request_id", "type": "string" }, "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "required": [ "access_request_id" ], "title": "ApproveAccessRequestRequest", "type": "object" }, "ApproveAccessRequestResponse": { "additionalProperties": false, "description": "ApproveAccessRequestResponse contains the approved access request.", "properties": { "access_request": { "$ref": "#/components/schemas/AccessRequest", "title": "access_request" } }, "required": [ "access_request" ], "title": "ApproveAccessRequestResponse", "type": "object" }, "AttachPolicyRequest": { "additionalProperties": false, "description": "AttachPolicyRequest specifies a policy to attach to a document.", "properties": { "document_id": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "policy_id": { "description": "Policy ID to attach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}", "example": "pol_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$", "title": "policy_id", "type": "string" } }, "required": [ "policy_id" ], "title": "AttachPolicyRequest", "type": "object" }, "CheckAccessRequestStatusRequest": { "additionalProperties": false, "description": "CheckAccessRequestStatusRequest checks for a pending access request.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "CheckAccessRequestStatusRequest", "type": "object" }, "CheckAccessRequestStatusResponse": { "additionalProperties": false, "description": "CheckAccessRequestStatusResponse returns whether the caller has a pending request.", "properties": { "has_pending_request": { "title": "has_pending_request", "type": "boolean" } }, "title": "CheckAccessRequestStatusResponse", "type": "object" }, "CreateAccessRequestRequest": { "additionalProperties": false, "description": "CreateAccessRequestRequest creates a new access request.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "message": { "description": "Optional message from the requester.", "example": "Need access for quarterly review", "maxLength": 1024, "title": "message", "type": [ "string", "null" ] }, "permission": { "$ref": "#/components/schemas/AccessRequestPermission", "description": "Permission level being requested.", "title": "permission" } }, "required": [ "permission" ], "title": "CreateAccessRequestRequest", "type": "object" }, "CreateAccessRequestResponse": { "additionalProperties": false, "description": "CreateAccessRequestResponse contains the created access request.", "properties": { "access_request": { "$ref": "#/components/schemas/AccessRequest", "title": "access_request" } }, "required": [ "access_request" ], "title": "CreateAccessRequestResponse", "type": "object" }, "CreateApiKeyRequest": { "additionalProperties": false, "description": "CreateApiKeyRequest contains the data needed to create a new API key.", "properties": { "expires_at": { "description": "Expiration timestamp. If not set, the key does not expire.\n When set, must be in the future and within 1 year.\n Security note: Keys without expiration should be rotated periodically.\ntimestamp.gt_now = true\ntimestamp.within = 8760h0m0s\n", "format": "date-time", "title": "expires_at", "type": "string" }, "name": { "description": "Human-readable name for the key (e.g., \"Production\", \"Staging\").", "maxLength": 63, "minLength": 1, "title": "name", "type": "string" }, "organization_id": { "description": "Organization ID to create the key for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id", "name" ], "title": "CreateApiKeyRequest", "type": "object" }, "CreateApiKeyResponse": { "additionalProperties": false, "description": "CreateApiKeyResponse contains the newly created API key and its secret.", "properties": { "api_key": { "$ref": "#/components/schemas/ApiKey", "description": "The created API key metadata.", "title": "api_key" }, "secret": { "description": "The API key secret. This is only returned once and cannot be retrieved later.\n Format: ffy_{env}_{base32_uuid7}{base62_random}\n - env: \"prod\" or \"test\"\n - base32_uuid7: 26 chars (TypeID base32 alphabet: 0-9a-hjkmnp-tv-z)\n - base62_random: 43 chars (0-9A-Za-z)\n Store this value securely - it will not be shown again.\n SECURITY WARNING: This field must NEVER be logged. Handlers must redact secrets from all logs.", "example": "ffy_prod_01h2xcejqtf2nbrexx3vqjhp41KJ8f3mNpQrStUvWxYz0123456789ABCDEFGHIJKLmNo", "minLength": 78, "pattern": "^ffy_(prod|test)_[A-Za-z0-9]+$", "title": "secret", "type": "string" } }, "required": [ "api_key", "secret" ], "title": "CreateApiKeyResponse", "type": "object" }, "CreateDocumentRequest": { "additionalProperties": false, "description": "CreateDocumentRequest contains the file and metadata for creating a document.", "properties": { "access_level": { "description": "Document access level. Defaults to organization if user belongs to an org, otherwise private.", "oneOf": [ { "$ref": "#/components/schemas/AccessLevel" }, { "type": "null" } ], "title": "access_level" }, "description": { "description": "Optional document description.", "maxLength": 2000, "title": "description", "type": [ "string", "null" ] }, "document_id": { "description": "Pre-generated document ID (set by server)", "readOnly": true, "title": "document_id", "type": "string" }, "payload": { "description": "PDF file to upload", "format": "binary", "title": "payload", "type": "string" }, "payload_key": { "description": "Storage key for uploaded file (set by server)", "readOnly": true, "title": "payload_key", "type": "string" }, "title": { "description": "Document title.", "maxLength": 255, "minLength": 1, "title": "title", "type": "string" }, "version_id": { "description": "Pre-generated version ID (set by server)", "readOnly": true, "title": "version_id", "type": "string" } }, "required": [ "payload", "title" ], "title": "CreateDocumentRequest", "type": "object" }, "CreateDocumentResponse": { "additionalProperties": false, "description": "CreateDocumentResponse contains the newly created document.", "properties": { "document": { "$ref": "#/components/schemas/Document", "description": "The created document.", "title": "document" } }, "required": [ "document" ], "title": "CreateDocumentResponse", "type": "object" }, "CreateOrganizationInviteRequest": { "additionalProperties": false, "description": "CreateOrganizationInviteRequest contains the data needed to create an invitation.", "properties": { "email": { "description": "Email address of the recipient.", "format": "email", "title": "email", "type": "string" }, "idempotency_key": { "description": "Reserved for future use. Currently, idempotency is based on email matching:\n if a PENDING invitation exists for the same email in this organization,\n that invitation is resent rather than creating a duplicate.", "maxLength": 255, "title": "idempotency_key", "type": [ "string", "null" ] }, "message": { "description": "Optional custom message from the sender (max 2000 bytes to support ~500 multibyte characters).", "maxLength": 2000, "title": "message", "type": [ "string", "null" ] }, "organization_id": { "description": "Organization to invite the user to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id", "email" ], "title": "CreateOrganizationInviteRequest", "type": "object" }, "CreateOrganizationInviteResponse": { "additionalProperties": false, "description": "CreateOrganizationInviteResponse contains the created invitation.", "properties": { "invite": { "$ref": "#/components/schemas/OrganizationInvite", "description": "The created (or existing) invitation.", "title": "invite" } }, "required": [ "invite" ], "title": "CreateOrganizationInviteResponse", "type": "object" }, "CreateOrganizationRequest": { "additionalProperties": false, "description": "CreateOrganizationRequest contains the data needed to create a new organization.", "properties": { "name": { "description": "Human-readable organization name.", "maxLength": 255, "minLength": 1, "title": "name", "type": "string" }, "owner_user_id": { "description": "Owner user ID. If not provided, the authenticated user becomes the owner.\n Authorization: Specifying a different user requires system maintainer role.\n Required when the caller is a service account (service accounts cannot own organizations).\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "owner_user_id", "type": [ "string", "null" ] } }, "required": [ "name" ], "title": "CreateOrganizationRequest", "type": "object" }, "CreateOrganizationResponse": { "additionalProperties": false, "description": "CreateOrganizationResponse contains the newly created organization.", "properties": { "organization": { "$ref": "#/components/schemas/Organization", "description": "The created organization.", "title": "organization" } }, "required": [ "organization" ], "title": "CreateOrganizationResponse", "type": "object" }, "CreateShareLinkRequest": { "additionalProperties": false, "description": "CreateShareLinkRequest creates a share link for a document.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "CreateShareLinkRequest", "type": "object" }, "CreateShareLinkResponse": { "additionalProperties": false, "description": "CreateShareLinkResponse contains the created share link.", "properties": { "share_link": { "$ref": "#/components/schemas/ShareLink", "description": "The created share link.", "title": "share_link" }, "short_url": { "description": "Shortened URL for the share link (if available).", "title": "short_url", "type": [ "string", "null" ] } }, "title": "CreateShareLinkResponse", "type": "object" }, "CreateVersionRequest": { "additionalProperties": false, "description": "CreateVersionRequest contains the file and metadata for creating a version.", "properties": { "description": { "description": "Description of changes in this version.", "title": "description", "type": [ "string", "null" ] }, "payload": { "description": "PDF file for new version", "format": "binary", "title": "payload", "type": "string" }, "payload_key": { "description": "Storage key for uploaded file (set by server)", "readOnly": true, "title": "payload_key", "type": "string" }, "title": { "description": "Optional version title.", "maxLength": 255, "title": "title", "type": [ "string", "null" ] }, "version_id": { "description": "Pre-generated version ID (set by server)", "readOnly": true, "title": "version_id", "type": "string" } }, "required": [ "payload" ], "title": "CreateVersionRequest", "type": "object" }, "DailyUsage": { "additionalProperties": false, "description": "DailyUsage represents usage for a single day.", "properties": { "date": { "description": "The date (YYYY-MM-DD format).", "example": "2026-01-15", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "title": "date", "type": "string" }, "request_count": { "description": "Request count for this day.", "format": "int32", "title": "request_count", "type": "integer" } }, "title": "DailyUsage", "type": "object" }, "DeleteAPIKeyQuotaRequest": { "additionalProperties": false, "description": "DeleteAPIKeyQuotaRequest removes a per-key quota.", "properties": { "api_key_id": { "description": "The API key ID (required).", "minLength": 1, "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "api_key_id", "type": "string" }, "organization_id": { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": [ "string", "null" ] } }, "title": "DeleteAPIKeyQuotaRequest", "type": "object" }, "DeleteAPIKeyQuotaResponse": { "additionalProperties": false, "description": "DeleteAPIKeyQuotaResponse confirms deletion. Empty response - success indicated by no error.", "title": "DeleteAPIKeyQuotaResponse", "type": "object" }, "DenyAccessRequestRequest": { "additionalProperties": false, "description": "DenyAccessRequestRequest denies an access request.", "properties": { "access_request_id": { "description": "Access request ID to deny.", "example": "acr_01h2xcejqtf2nbrexx3vqjhp42", "pattern": "^acr_[0-9a-hjkmnp-tv-z]{26}$", "title": "access_request_id", "type": "string" }, "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "required": [ "access_request_id" ], "title": "DenyAccessRequestRequest", "type": "object" }, "DenyAccessRequestResponse": { "additionalProperties": false, "description": "DenyAccessRequestResponse contains the denied access request.", "properties": { "access_request": { "$ref": "#/components/schemas/AccessRequest", "title": "access_request" } }, "required": [ "access_request" ], "title": "DenyAccessRequestResponse", "type": "object" }, "DetachPolicyRequest": { "additionalProperties": false, "description": "DetachPolicyRequest identifies a policy to detach from a document.", "properties": { "document_id": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "policy_id": { "description": "Policy ID to detach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}", "example": "pol_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$", "title": "policy_id", "type": "string" } }, "title": "DetachPolicyRequest", "type": "object" }, "Document": { "additionalProperties": false, "description": "Document represents a Factify document.", "properties": { "access_level": { "$ref": "#/components/schemas/AccessLevel", "description": "Document access level.", "title": "access_level" }, "created_at": { "description": "Timestamp when document was created.", "format": "date-time", "title": "created_at", "type": "string" }, "created_by": { "$ref": "#/components/schemas/Subject", "description": "Subject who created the document.", "title": "created_by" }, "current_version": { "description": "Reference to the current version, if any.", "oneOf": [ { "$ref": "#/components/schemas/VersionRef" }, { "type": "null" } ], "title": "current_version" }, "description": { "description": "Optional document description.", "example": "Quarterly financial report for Q4 2024", "maxLength": 2000, "title": "description", "type": [ "string", "null" ] }, "general_access": { "$ref": "#/components/schemas/AccessLevel", "description": "General access level controlling who can discover the document.", "title": "general_access" }, "id": { "description": "Unique ID for the document.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "is_demo": { "description": "Whether this document is a demo document created during FTUE onboarding.", "title": "is_demo", "type": "boolean" }, "last_viewed_at": { "description": "Timestamp when the authenticated user last viewed this document.\n Absent if the user has never viewed it.", "format": "date-time", "title": "last_viewed_at", "type": "string" }, "owner_organization_id": { "description": "Organization that owns this document (via the document creator).\n Empty if the owner's organization could not be resolved.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "title": "owner_organization_id", "type": "string" }, "permission_set": { "$ref": "#/components/schemas/DocumentPermissionSet", "description": "Permissions the authenticated user has on this document.\n Present in list and get responses when the caller is authenticated.", "title": "permission_set" }, "processing_status": { "$ref": "#/components/schemas/ProcessingStatus", "description": "Processing status.", "title": "processing_status" }, "shared_at": { "description": "Timestamp when this document was last shared to the authenticated user.\n Absent if the document was never shared to them.", "format": "date-time", "title": "shared_at", "type": "string" }, "source_format": { "description": "Original file format of the document's current version (e.g., \"pdf\", \"docx\", \"xlsx\", \"csv\", \"markdown\").\n Output-only field — not validated on input. Values are always one of the canonical format names\n written by the upload layer; arbitrary strings will not appear here.", "title": "source_format", "type": "string" }, "thumbnail_url": { "description": "URL of the document thumbnail image.", "title": "thumbnail_url", "type": "string" }, "title": { "description": "Document title.", "example": "Q4 2024 Financial Report", "maxLength": 255, "minLength": 1, "title": "title", "type": "string" }, "trashed_at": { "description": "Timestamp when the document was trashed, if applicable.\n Absent if the document is not trashed.", "format": "date-time", "title": "trashed_at", "type": "string" }, "updated_at": { "description": "Timestamp when document was last updated.", "format": "date-time", "title": "updated_at", "type": "string" }, "url": { "description": "URL for accessing the document on Factify.", "example": "https://app.factify.com/d/01h2xcejqtf2nbrexx3vqjhp41", "format": "uri", "title": "url", "type": "string" } }, "required": [ "id", "url", "title", "access_level", "processing_status", "created_at", "created_by" ], "title": "Document", "type": "object" }, "DocumentBundle": { "additionalProperties": false, "description": "DocumentBundle groups a document record with its optional spatial layout.", "properties": { "layout": { "$ref": "#/components/schemas/qcr.v1alpha.DocumentLayout", "description": "Spatial layout overlay. Absent for format-only sources (e.g. markdown).", "title": "layout" }, "record": { "$ref": "#/components/schemas/qcr.v1alpha.DocumentRecord", "description": "Parsed document content blocks (paragraphs, headings, tables, images, etc.).", "title": "record" } }, "title": "DocumentBundle", "type": "object" }, "DocumentOwnership": { "enum": [ "owned", "not_owned" ] }, "DocumentPermissionSet": { "additionalProperties": false, "description": "DocumentPermissionSet contains the permissions the authenticated user has on a document.", "properties": { "attach_policy": { "title": "attach_policy", "type": "boolean" }, "comment_private": { "title": "comment_private", "type": "boolean" }, "comment_public": { "title": "comment_public", "type": "boolean" }, "copy_content": { "title": "copy_content", "type": "boolean" }, "create_version": { "title": "create_version", "type": "boolean" }, "export": { "title": "export", "type": "boolean" }, "grant_access": { "title": "grant_access", "type": "boolean" }, "list_versions": { "title": "list_versions", "type": "boolean" }, "manage_access": { "title": "manage_access", "type": "boolean" }, "open": { "title": "open", "type": "boolean" }, "screenshot": { "title": "screenshot", "type": "boolean" }, "trash": { "title": "trash", "type": "boolean" }, "view": { "title": "view", "type": "boolean" }, "view_analytics": { "title": "view_analytics", "type": "boolean" }, "view_leads": { "title": "view_leads", "type": "boolean" }, "view_timeline": { "title": "view_timeline", "type": "boolean" } }, "title": "DocumentPermissionSet", "type": "object" }, "DocumentPolicy": { "additionalProperties": false, "description": "DocumentPolicy represents a policy attached to a document.", "properties": { "attached_at": { "description": "Timestamp when policy was attached.", "format": "date-time", "title": "attached_at", "type": "string" }, "document_id": { "description": "Document ID this policy is attached to.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "policy": { "$ref": "#/components/schemas/Policy", "description": "The policy details.", "title": "policy" } }, "required": [ "document_id", "attached_at", "policy" ], "title": "DocumentPolicy", "type": "object" }, "DocumentRole": { "enum": [ "viewer", "commenter", "collaborator", "admin", "owner" ] }, "DocumentTrashState": { "enum": [ "active", "trashed" ] }, "DuplicateDocument": { "additionalProperties": false, "description": "DuplicateDocument represents a document that is a visual duplicate.", "properties": { "document_id": { "description": "Document ID of the duplicate.", "title": "document_id", "type": "string" }, "last_viewed_at": { "description": "When the caller last viewed this document.", "format": "date-time", "title": "last_viewed_at", "type": "string" }, "title": { "description": "Document title.", "title": "title", "type": "string" }, "version_id": { "description": "Version ID of the duplicate.", "title": "version_id", "type": "string" }, "version_title": { "description": "Version title.", "title": "version_title", "type": "string" } }, "title": "DuplicateDocument", "type": "object" }, "Empty": { "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 }", "type": "object" }, "ErrorDetail": { "properties": { "param": { "description": "The parameter that caused the error (only set for validation errors)", "type": "string" }, "reason": { "description": "Machine-readable error reason for programmatic handling", "enum": [ "missing_required_field", "invalid_field_value", "invalid_enum_value", "invalid_cursor", "invalid_id_format", "missing_api_key", "invalid_api_key", "expired_api_key", "invalid_token", "expired_token", "authentication_required", "insufficient_permissions", "resource_not_found", "resource_already_exists", "rate_limit_exceeded", "quota_exceeded", "precondition_failed", "feature_disabled", "internal_error", "service_unavailable", "unimplemented" ], "type": "string" }, "request_id": { "description": "Request correlation ID for tracing and log lookup (e.g., \"req_01arwx4k8xrgqskvxq69gdn019\")", "type": "string" } }, "type": "object" }, "ErrorResponse": { "properties": { "code": { "description": "ConnectRPC error code. Maps to HTTP status codes:\n- invalid_argument, failed_precondition -> 400\n- unauthenticated -> 401\n- permission_denied -> 403\n- not_found -> 404\n- already_exists -> 409\n- resource_exhausted -> 429\n- deadline_exceeded -> 408\n- canceled -> 499\n- internal, unknown -> 500 (unknown may appear as 400 for malformed JSON requests)\n- unimplemented -> 501\n- unavailable -> 503\n", "enum": [ "unknown", "invalid_argument", "unauthenticated", "permission_denied", "not_found", "already_exists", "resource_exhausted", "failed_precondition", "internal", "unavailable", "unimplemented", "canceled", "deadline_exceeded" ], "type": "string" }, "details": { "description": "Structured error details for programmatic handling", "items": { "$ref": "#/components/schemas/ErrorDetail" }, "type": "array" }, "message": { "description": "Human-readable error message", "type": "string" } }, "required": [ "code", "message" ], "type": "object" }, "ExportDocumentRequest": { "additionalProperties": false, "description": "ExportDocumentRequest identifies the document to export.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "version_id": { "description": "Optional version ID. If omitted, exports the current version.", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": [ "string", "null" ] } }, "title": "ExportDocumentRequest", "type": "object" }, "ExportDocumentResponse": { "additionalProperties": false, "description": "ExportDocumentResponse contains the download URL.", "properties": { "expires_at": { "description": "Timestamp when the download URL expires.", "format": "date-time", "title": "expires_at", "type": "string" }, "headers": { "additionalProperties": { "title": "value", "type": "string" }, "description": "HTTP headers to include when fetching the URL.", "title": "headers", "type": "object" }, "url": { "description": "Presigned URL to download the document PDF.", "title": "url", "type": "string" } }, "required": [ "url", "expires_at" ], "title": "ExportDocumentResponse", "type": "object" }, "ExportDocumentResponse.HeadersEntry": { "additionalProperties": false, "properties": { "key": { "title": "key", "type": "string" }, "value": { "title": "value", "type": "string" } }, "title": "HeadersEntry", "type": "object" }, "GeneralAccessLevel": { "enum": [ "restricted", "organization", "anyone_with_link" ] }, "GenerateEntryPageRequest": { "additionalProperties": false, "description": "GenerateEntryPageRequest identifies a document to generate an entry page for.", "properties": { "document_id": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "GenerateEntryPageRequest", "type": "object" }, "GenerateEntryPageResponse": { "additionalProperties": false, "description": "GenerateEntryPageResponse contains the download URL for the entry page.", "properties": { "download_url": { "description": "Temporary download URL for the entry page PDF.", "example": "https://storage.factify.com/entry-pages/abc123.pdf?token=xyz", "format": "uri", "title": "download_url", "type": "string" } }, "required": [ "download_url" ], "title": "GenerateEntryPageResponse", "type": "object" }, "GetDocumentQuotaRequest": { "additionalProperties": false, "description": "GetDocumentQuotaRequest retrieves the document quota for the authenticated user's organization.\n No fields needed; the organization is derived from the caller's auth context.", "title": "GetDocumentQuotaRequest", "type": "object" }, "GetDocumentQuotaResponse": { "additionalProperties": false, "description": "GetDocumentQuotaResponse contains the document quota for the organization.", "properties": { "available": { "description": "Remaining documents that can be created (limit minus used, floored at 0).\n When limit is 0 (unlimited), this field is 0 and should be ignored by clients.", "format": "int32", "title": "available", "type": "integer" }, "limit": { "description": "Maximum documents allowed for this organization.\n 0 means unlimited (no quota enforced).", "format": "int32", "title": "limit", "type": "integer" }, "used": { "description": "Number of documents counting against quota (excludes demo, includes trashed).", "format": "int32", "title": "used", "type": "integer" } }, "title": "GetDocumentQuotaResponse", "type": "object" }, "GetDocumentRequest": { "additionalProperties": false, "description": "GetDocumentRequest identifies a document to retrieve.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "GetDocumentRequest", "type": "object" }, "GetDocumentResponse": { "additionalProperties": false, "description": "GetDocumentResponse contains the requested document.", "properties": { "document": { "$ref": "#/components/schemas/Document", "description": "The requested document.", "title": "document" } }, "required": [ "document" ], "title": "GetDocumentResponse", "type": "object" }, "GetGeneralAccessRequest": { "additionalProperties": false, "description": "GetGeneralAccessRequest retrieves the general access level.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "GetGeneralAccessRequest", "type": "object" }, "GetGeneralAccessResponse": { "additionalProperties": false, "description": "GetGeneralAccessResponse contains the current general access level.", "properties": { "document_id": { "description": "Document ID.", "title": "document_id", "type": "string" }, "general_access_level": { "$ref": "#/components/schemas/GeneralAccessLevel", "description": "Current general access level.", "title": "general_access_level" } }, "title": "GetGeneralAccessResponse", "type": "object" }, "GetMeRequest": { "additionalProperties": false, "description": "GetMeRequest is empty — the caller is identified via auth context.", "title": "GetMeRequest", "type": "object" }, "GetMeResponse": { "additionalProperties": false, "description": "GetMeResponse contains the authenticated user's profile.", "properties": { "organizations": { "description": "Organizations the user is a member of.", "items": { "$ref": "#/components/schemas/Organization" }, "title": "organizations", "type": "array" }, "user": { "$ref": "#/components/schemas/User", "description": "The authenticated user.", "title": "user" } }, "required": [ "user" ], "title": "GetMeResponse", "type": "object" }, "GetOrganizationPublicProfileRequest": { "additionalProperties": false, "description": "GetOrganizationPublicProfileRequest identifies an organization to retrieve the public profile for.", "properties": { "organization_id": { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id" ], "title": "GetOrganizationPublicProfileRequest", "type": "object" }, "GetOrganizationPublicProfileResponse": { "additionalProperties": false, "description": "GetOrganizationPublicProfileResponse contains the public-facing profile of an organization.", "properties": { "display_name": { "description": "Human-readable organization name.", "title": "display_name", "type": "string" }, "logo_image_url": { "description": "URL of the organization's logo image, if set.", "title": "logo_image_url", "type": [ "string", "null" ] } }, "title": "GetOrganizationPublicProfileResponse", "type": "object" }, "GetOrganizationQuotaRequest": { "additionalProperties": false, "description": "GetOrganizationQuotaRequest is a request to get quota status.", "properties": { "organization_id": { "description": "Optional: organization ID to query. If not provided, uses the caller's organization.\n Only admins can query other organizations.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": [ "string", "null" ] } }, "title": "GetOrganizationQuotaRequest", "type": "object" }, "GetOrganizationQuotaResponse": { "additionalProperties": false, "description": "GetOrganizationQuotaResponse returns the quota status.", "properties": { "quota": { "$ref": "#/components/schemas/OrganizationQuota", "description": "The organization's quota status.", "title": "quota" } }, "title": "GetOrganizationQuotaResponse", "type": "object" }, "GetOrganizationRequest": { "additionalProperties": false, "description": "GetOrganizationRequest identifies an organization to retrieve.", "properties": { "organization_id": { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id" ], "title": "GetOrganizationRequest", "type": "object" }, "GetOrganizationResponse": { "additionalProperties": false, "description": "GetOrganizationResponse contains the requested organization.", "properties": { "organization": { "$ref": "#/components/schemas/Organization", "description": "The requested organization.", "title": "organization" } }, "required": [ "organization" ], "title": "GetOrganizationResponse", "type": "object" }, "GetRecordRequest": { "additionalProperties": false, "description": "GetRecordRequest identifies a version whose record to retrieve.", "properties": { "version_id": { "description": "Version ID to retrieve the record for.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": "string" } }, "required": [ "version_id" ], "title": "GetRecordRequest", "type": "object" }, "GetRecordResponse": { "additionalProperties": false, "allOf": [ { "properties": { "id": { "description": "Unique record ID (UUID format).", "example": "019d3b1b-c4a7-7376-b6f9-229f44354d27", "title": "id", "type": "string" }, "source_format": { "description": "Source format of the original upload (e.g., pdf, docx, xlsx, csv).", "title": "source_format", "type": "string" } } }, { "oneOf": [ { "properties": { "document": { "$ref": "#/components/schemas/DocumentBundle", "description": "Populated for pdf, docx, and markdown formats.", "title": "document" } }, "required": [ "document" ], "title": "document", "type": "object" }, { "properties": { "spreadsheet": { "$ref": "#/components/schemas/SpreadsheetBundle", "description": "Populated for xlsx and csv formats.", "title": "spreadsheet" } }, "required": [ "spreadsheet" ], "title": "spreadsheet", "type": "object" } ] } ], "description": "GetRecordResponse contains the processed content and layout for a version.\n The content oneof is populated based on source_format:\n - document formats (pdf, docx, markdown): document field\n - spreadsheet formats (xlsx, csv): spreadsheet field", "title": "GetRecordResponse", "type": "object" }, "GetTimelineRequest": { "additionalProperties": false, "properties": { "cursor": { "title": "cursor", "type": [ "string", "null" ] }, "document_id": { "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "page_size": { "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] } }, "title": "GetTimelineRequest", "type": "object" }, "GetTimelineResponse": { "additionalProperties": false, "properties": { "events": { "items": { "$ref": "#/components/schemas/TimelineEvent" }, "title": "events", "type": "array" }, "has_more": { "title": "has_more", "type": "boolean" }, "next_cursor": { "title": "next_cursor", "type": [ "string", "null" ] } }, "title": "GetTimelineResponse", "type": "object" }, "GetUsageHistoryRequest": { "additionalProperties": false, "description": "GetUsageHistoryRequest is a request to get usage history.\ndate_range_valid // date.before must be after date.after\n", "properties": { "date": { "description": "Filter by date range.\n REST: ?date.after=2026-01-01T00:00:00Z&date.before=2026-02-01T00:00:00Z", "oneOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "date" }, "organization_id": { "description": "Optional: organization ID to query. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": [ "string", "null" ] } }, "title": "GetUsageHistoryRequest", "type": "object" }, "GetUsageHistoryResponse": { "additionalProperties": false, "description": "GetUsageHistoryResponse returns usage history.", "properties": { "daily_usage": { "description": "Daily usage records.", "items": { "$ref": "#/components/schemas/DailyUsage" }, "title": "daily_usage", "type": "array" }, "organization_id": { "description": "The organization ID.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "total_requests": { "description": "Total requests in the period.", "format": "int32", "title": "total_requests", "type": "integer" } }, "title": "GetUsageHistoryResponse", "type": "object" }, "GetUserPreferencesRequest": { "additionalProperties": false, "description": "GetUserPreferencesRequest is empty — the caller is identified via auth context.", "title": "GetUserPreferencesRequest", "type": "object" }, "GetUserPreferencesResponse": { "additionalProperties": false, "description": "GetUserPreferencesResponse contains the user's onboarding preferences.", "properties": { "has_completed_document_tour": { "description": "Whether the user has completed the document tour.", "title": "has_completed_document_tour", "type": "boolean" }, "has_completed_hub_onboarding": { "description": "Whether the user has completed the hub onboarding flow.", "title": "has_completed_hub_onboarding", "type": "boolean" } }, "title": "GetUserPreferencesResponse", "type": "object" }, "GetVersionRequest": { "additionalProperties": false, "description": "GetVersionRequest identifies a specific version to retrieve.", "properties": { "version_id": { "description": "Version ID to retrieve.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": "string" } }, "title": "GetVersionRequest", "type": "object" }, "GrantDocumentAccessRequest": { "additionalProperties": false, "description": "GrantDocumentAccessRequest grants access to one or more recipients.", "properties": { "custom_message": { "description": "Custom message to include in the notification email.", "title": "custom_message", "type": [ "string", "null" ] }, "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "recipients": { "description": "Recipients to grant access to (1-50).", "items": { "$ref": "#/components/schemas/RecipientGrant" }, "maxItems": 50, "minItems": 1, "title": "recipients", "type": "array" }, "should_send_notification": { "description": "Whether to send email notifications.", "title": "should_send_notification", "type": [ "boolean", "null" ] } }, "title": "GrantDocumentAccessRequest", "type": "object" }, "GrantDocumentAccessResponse": { "additionalProperties": false, "description": "GrantDocumentAccessResponse contains the results of granting access.", "properties": { "document_id": { "description": "Document ID.", "title": "document_id", "type": "string" }, "failed": { "description": "Number of failed grants.", "title": "failed", "type": "integer" }, "results": { "description": "Results for each recipient.", "items": { "$ref": "#/components/schemas/AccessGrantResult" }, "title": "results", "type": "array" }, "successful": { "description": "Number of successful grants.", "title": "successful", "type": "integer" }, "total": { "description": "Total number of recipients processed.", "title": "total", "type": "integer" } }, "title": "GrantDocumentAccessResponse", "type": "object" }, "InspectAccessRequest": { "additionalProperties": false, "description": "InspectAccessRequest requests the caller's permissions on a document.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "InspectAccessRequest", "type": "object" }, "InspectAccessResponse": { "additionalProperties": false, "description": "InspectAccessResponse contains the caller's permissions.", "properties": { "document_id": { "description": "Document ID.", "title": "document_id", "type": "string" }, "permission_set": { "$ref": "#/components/schemas/DocumentPermissionSet", "description": "Boolean permission set for the caller.", "title": "permission_set" } }, "title": "InspectAccessResponse", "type": "object" }, "ListAPIKeyQuotasRequest": { "additionalProperties": false, "description": "ListAPIKeyQuotasRequest lists all key-level quotas for an organization.", "properties": { "organization_id": { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": [ "string", "null" ] } }, "title": "ListAPIKeyQuotasRequest", "type": "object" }, "ListAPIKeyQuotasResponse": { "additionalProperties": false, "description": "ListAPIKeyQuotasResponse returns all key-level quotas.", "properties": { "quotas": { "description": "Per-key quota configurations and usage.", "items": { "$ref": "#/components/schemas/APIKeyQuota" }, "title": "quotas", "type": "array" } }, "title": "ListAPIKeyQuotasResponse", "type": "object" }, "ListAccessRequestsRequest": { "additionalProperties": false, "description": "ListAccessRequestsRequest lists access requests for a document.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "ListAccessRequestsRequest", "type": "object" }, "ListAccessRequestsResponse": { "additionalProperties": false, "description": "ListAccessRequestsResponse contains the list of access requests.", "properties": { "has_more": { "title": "has_more", "type": "boolean" }, "items": { "items": { "$ref": "#/components/schemas/AccessRequest" }, "title": "items", "type": "array" } }, "title": "ListAccessRequestsResponse", "type": "object" }, "ListApiKeysRequest": { "additionalProperties": false, "description": "ListApiKeysRequest specifies filters and pagination for listing API keys.", "properties": { "include_revoked": { "description": "Whether to include revoked keys in the response.\n Default: false (only active and expired-but-not-revoked keys are returned).\n When true, all keys including revoked ones are returned.\n Note: Expired keys are always included unless also revoked; use is_active to filter.", "title": "include_revoked", "type": "boolean" }, "organization_id": { "description": "Organization ID to list keys for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "page_size": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] }, "page_token": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" } }, "required": [ "organization_id" ], "title": "ListApiKeysRequest", "type": "object" }, "ListApiKeysResponse": { "additionalProperties": false, "description": "ListApiKeysResponse contains a page of API keys.", "properties": { "items": { "description": "List of API keys (secrets are never included).", "items": { "$ref": "#/components/schemas/ApiKey" }, "title": "items", "type": "array" }, "pagination": { "$ref": "#/components/schemas/Pagination", "description": "Pagination metadata.", "title": "pagination" } }, "required": [ "pagination" ], "title": "ListApiKeysResponse", "type": "object" }, "ListDocumentAccessRequest": { "additionalProperties": false, "description": "ListDocumentAccessRequest lists all recipients with access.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "ListDocumentAccessRequest", "type": "object" }, "ListDocumentAccessResponse": { "additionalProperties": false, "description": "ListDocumentAccessResponse contains the access list and general access level.", "properties": { "document_id": { "description": "Document ID.", "title": "document_id", "type": "string" }, "general_access_level": { "$ref": "#/components/schemas/GeneralAccessLevel", "description": "Current general access level.", "title": "general_access_level" }, "recipients": { "description": "Recipients with access.", "items": { "$ref": "#/components/schemas/Recipient" }, "title": "recipients", "type": "array" } }, "title": "ListDocumentAccessResponse", "type": "object" }, "ListDocumentDuplicatesRequest": { "additionalProperties": false, "description": "ListDocumentDuplicatesRequest identifies the document to check for duplicates.", "properties": { "document_id": { "description": "Document ID to check for duplicates.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "file_contents_hash": { "description": "SHA256 hash of the document's visual content for duplicate matching.", "maxLength": 64, "minLength": 64, "title": "file_contents_hash", "type": "string" } }, "title": "ListDocumentDuplicatesRequest", "type": "object" }, "ListDocumentDuplicatesResponse": { "additionalProperties": false, "description": "ListDocumentDuplicatesResponse contains the duplicate documents.", "properties": { "items": { "description": "Duplicate documents found. Empty if none found or accessible.", "items": { "$ref": "#/components/schemas/DuplicateDocument" }, "title": "items", "type": "array" } }, "title": "ListDocumentDuplicatesResponse", "type": "object" }, "ListDocumentPoliciesRequest": { "additionalProperties": false, "description": "ListDocumentPoliciesRequest specifies pagination for listing document policies.\n Follows Google AIP-158 for pagination field naming.", "properties": { "document_id": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "page_size": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] }, "page_token": { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "example": "eyJpZCI6InBvbF8wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0", "title": "page_token", "type": "string" } }, "title": "ListDocumentPoliciesRequest", "type": "object" }, "ListDocumentPoliciesResponse": { "additionalProperties": false, "description": "ListDocumentPoliciesResponse contains a page of policy attachments.", "properties": { "items": { "description": "List of policy attachments.", "items": { "$ref": "#/components/schemas/DocumentPolicy" }, "title": "items", "type": "array" }, "pagination": { "$ref": "#/components/schemas/Pagination", "description": "Pagination metadata.", "title": "pagination" } }, "required": [ "pagination" ], "title": "ListDocumentPoliciesResponse", "type": "object" }, "ListDocumentsRequest": { "additionalProperties": false, "description": "ListDocumentsRequest specifies filters and pagination for listing documents.\n Follows Google AIP-158 for pagination field naming.\n Uses Vanguard-compatible dot notation for nested filters: ?created.after=...&created.before=...\ncreated_time_range // created.after must be before created.before\n", "properties": { "access_level": { "description": "Filter by access level(s). Returns documents matching ANY of the specified levels.\n REST: ?access_level=private or ?access_level=private&access_level=organization", "items": { "$ref": "#/components/schemas/AccessLevel" }, "title": "access_level", "type": "array" }, "created": { "description": "Filter by creation time range.\n REST: ?created.after=2024-01-01T00:00:00Z&created.before=2024-12-31T23:59:59Z", "oneOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "created" }, "created_by_id": { "description": "Filter by creator ID(s) (user or bot). Returns documents matching ANY of the specified IDs.\n REST: ?created_by_id=user_01h2xcejqtf2nbrexx3vqjhp41 or ?created_by_id=user_xxx&created_by_id=bot_yyy", "items": { "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$", "type": "string" }, "title": "created_by_id", "type": "array" }, "description_contains": { "description": "Case-insensitive substring match on document description.\n Documents with no description set will not match this filter.\n REST: ?description_contains=financial", "maxLength": 255, "title": "description_contains", "type": [ "string", "null" ] }, "organization_scope": { "description": "Organization scope filter. When true, restrict to documents within the user's organization.\n REST: ?organization_scope=true", "title": "organization_scope", "type": [ "boolean", "null" ] }, "ownership": { "description": "Ownership filter. Returns documents matching the specified ownership state.\n REST: ?ownership=owned or ?ownership=not_owned", "items": { "$ref": "#/components/schemas/DocumentOwnership" }, "title": "ownership", "type": "array" }, "page_size": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] }, "page_token": { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "example": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0", "title": "page_token", "type": "string" }, "processing_status": { "description": "Filter by processing status(es). Returns documents matching ANY of the specified statuses.\n REST: ?processing_status=ready or ?processing_status=processing&processing_status=ready", "items": { "$ref": "#/components/schemas/ProcessingStatus" }, "title": "processing_status", "type": "array" }, "query": { "description": "Full-text search filter. Case-insensitive substring match on document name and description.\n REST: ?query=budget", "title": "query", "type": [ "string", "null" ] }, "sort": { "description": "Sort field and direction. Prefix with `-` for descending order.\n Allowed values: created_at, updated_at, name, last_viewed_at, last_shared_at.\n Default (omitted): created_at descending.\n REST: ?sort=last_viewed_at or ?sort=-name", "title": "sort", "type": [ "string", "null" ] }, "source_format": { "description": "Filter by source format(s). Returns documents matching ANY of the specified formats.\n Allowed values: pdf, docx, xlsx, csv, markdown.\n REST: ?source_format=pdf or ?source_format=docx&source_format=xlsx", "items": { "enum": [ "pdf", "docx", "xlsx", "csv", "markdown" ], "type": "string" }, "title": "source_format", "type": "array" }, "title_contains": { "description": "Case-insensitive substring match on document title.\n REST: ?title_contains=quarterly", "maxLength": 255, "title": "title_contains", "type": [ "string", "null" ] }, "trash_state": { "description": "Trash state filter. Returns documents matching the specified trash state.\n REST: ?trash_state=active or ?trash_state=trashed or ?trash_state=active&trash_state=trashed\n Default (omitted): active documents only.", "items": { "$ref": "#/components/schemas/DocumentTrashState" }, "title": "trash_state", "type": "array" } }, "title": "ListDocumentsRequest", "type": "object" }, "ListDocumentsResponse": { "additionalProperties": false, "description": "ListDocumentsResponse contains a page of documents.", "properties": { "items": { "description": "List of documents.", "items": { "$ref": "#/components/schemas/Document" }, "title": "items", "type": "array" }, "pagination": { "$ref": "#/components/schemas/Pagination", "description": "Pagination metadata.", "title": "pagination" } }, "required": [ "pagination" ], "title": "ListDocumentsResponse", "type": "object" }, "ListOrganizationInvitesRequest": { "additionalProperties": false, "description": "ListOrganizationInvitesRequest specifies filters for listing invitations.\ncreated_time_range // created.after must be before created.before\nexpires_time_range // expires.after must be before expires.before\n", "properties": { "created": { "description": "Filter by creation time range.\n REST: ?created.after=2024-01-01T00:00:00Z&created.before=2024-12-31T23:59:59Z", "oneOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "created" }, "email": { "description": "Filter by email address.\n REST: ?email.contains=dwight or ?email.exact=dwight@dundermifflin.com", "oneOf": [ { "$ref": "#/components/schemas/StringFilter" }, { "type": "null" } ], "title": "email" }, "expires": { "description": "Filter by expiration time range.\n Useful for finding invitations expiring soon (expires.before) or still valid beyond a date (expires.after).\n REST: ?expires.after=2024-01-01T00:00:00Z&expires.before=2024-01-31T23:59:59Z", "oneOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "expires" }, "organization_id": { "description": "Organization to list invitations for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "page_size": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] }, "page_token": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" }, "sender_id": { "description": "Filter by sender. Only returns invitations sent by this user.\n REST: ?sender_id=user_01h2xcejqtf2nbrexx3vqjhp41\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "sender_id", "type": [ "string", "null" ] }, "status": { "description": "Filter by invitation status.\n If empty, returns all invitations.\n REST: ?status=pending or ?status=pending&status=expired", "items": { "$ref": "#/components/schemas/OrganizationInviteStatus" }, "title": "status", "type": "array" } }, "required": [ "organization_id" ], "title": "ListOrganizationInvitesRequest", "type": "object" }, "ListOrganizationInvitesResponse": { "additionalProperties": false, "description": "ListOrganizationInvitesResponse contains a page of invitations.", "properties": { "items": { "description": "List of invitations.", "items": { "$ref": "#/components/schemas/OrganizationInvite" }, "title": "items", "type": "array" }, "pagination": { "$ref": "#/components/schemas/Pagination", "description": "Pagination metadata.", "title": "pagination" } }, "required": [ "pagination" ], "title": "ListOrganizationInvitesResponse", "type": "object" }, "ListOrganizationMembersRequest": { "additionalProperties": false, "description": "ListOrganizationMembersRequest specifies the organization and pagination.", "properties": { "organization_id": { "description": "Organization to list members for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "page_size": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] }, "page_token": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" } }, "required": [ "organization_id" ], "title": "ListOrganizationMembersRequest", "type": "object" }, "ListOrganizationMembersResponse": { "additionalProperties": false, "description": "ListOrganizationMembersResponse contains a page of organization members.", "properties": { "items": { "description": "List of organization members.", "items": { "$ref": "#/components/schemas/OrganizationMember" }, "title": "items", "type": "array" }, "pagination": { "$ref": "#/components/schemas/Pagination", "description": "Pagination metadata.", "title": "pagination" } }, "required": [ "pagination" ], "title": "ListOrganizationMembersResponse", "type": "object" }, "ListOrganizationsRequest": { "additionalProperties": false, "description": "ListOrganizationsRequest specifies pagination for listing organizations.", "properties": { "page_size": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] }, "page_token": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" }, "role": { "description": "Filter by the caller's role in the organization.\n If omitted or empty, returns all organizations the caller can view (no filtering).\n REST: ?role=admin or ?role=admin&role=owner", "items": { "$ref": "#/components/schemas/OrganizationRole" }, "title": "role", "type": "array" } }, "title": "ListOrganizationsRequest", "type": "object" }, "ListOrganizationsResponse": { "additionalProperties": false, "description": "ListOrganizationsResponse contains a page of organizations.", "properties": { "items": { "description": "List of organizations.", "items": { "$ref": "#/components/schemas/Organization" }, "title": "items", "type": "array" }, "pagination": { "$ref": "#/components/schemas/Pagination", "description": "Pagination metadata.", "title": "pagination" } }, "required": [ "pagination" ], "title": "ListOrganizationsResponse", "type": "object" }, "ListValue": { "additionalProperties": false, "description": "`ListValue` is a wrapper around a repeated field of values.\n\n The JSON representation for `ListValue` is JSON array.", "properties": { "values": { "description": "Repeated field of dynamically typed values.", "items": { "$ref": "#/components/schemas/Value" }, "title": "values", "type": "array" } }, "title": "ListValue", "type": "object" }, "ListVersionsRequest": { "additionalProperties": false, "description": "ListVersionsRequest specifies filters and pagination for listing versions.\n Follows Google AIP-158 for pagination field naming.", "properties": { "document_id": { "description": "Document ID to list versions for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "page_size": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": [ "integer", "null" ] }, "page_token": { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "example": "eyJpZCI6InZlcl8wMWgyYWJjZDEyMzRlZmdoNTY3OGprbW5wdCIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0", "title": "page_token", "type": "string" } }, "title": "ListVersionsRequest", "type": "object" }, "ListVersionsResponse": { "additionalProperties": false, "description": "ListVersionsResponse contains a page of versions.", "properties": { "items": { "description": "List of versions.", "items": { "$ref": "#/components/schemas/Version" }, "title": "items", "type": "array" }, "pagination": { "$ref": "#/components/schemas/Pagination", "description": "Pagination metadata.", "title": "pagination" } }, "required": [ "pagination" ], "title": "ListVersionsResponse", "type": "object" }, "NullValue": { "description": "`NullValue` is a singleton enumeration to represent the null value for the\n `Value` type union.\n\n The JSON representation for `NullValue` is JSON `null`.", "enum": [ "NULL_VALUE" ], "title": "NullValue", "type": "string" }, "Organization": { "additionalProperties": false, "description": "Organization represents a Factify organization.", "properties": { "created_at": { "description": "Timestamp when the organization was created.", "format": "date-time", "title": "created_at", "type": "string" }, "id": { "description": "Unique ID for the organization.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "logo_image_url": { "description": "Optional — organizations may not have a logo.", "title": "logo_image_url", "type": [ "string", "null" ] }, "name": { "description": "Human-readable organization name.", "example": "Acme Corporation", "maxLength": 255, "minLength": 1, "title": "name", "type": "string" } }, "required": [ "id", "name", "created_at" ], "title": "Organization", "type": "object" }, "OrganizationInvite": { "additionalProperties": false, "description": "OrganizationInvite represents an invitation to join an organization.\naccepted_fields_consistency // accepted_at and accepted_by must both be set or both be unset\n", "properties": { "accepted_at": { "description": "When the invitation was accepted (if accepted).", "format": "date-time", "title": "accepted_at", "type": "string" }, "accepted_by": { "$ref": "#/components/schemas/User", "description": "User who accepted the invitation (if accepted).", "title": "accepted_by" }, "created_at": { "description": "When the invitation was created.", "format": "date-time", "title": "created_at", "type": "string" }, "email": { "description": "Email address of the recipient.", "example": "dwight@dundermifflin.com", "format": "email", "title": "email", "type": "string" }, "expires_at": { "description": "When the invitation expires.", "format": "date-time", "title": "expires_at", "type": "string" }, "id": { "description": "Unique identifier for the invitation.", "example": "inv_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^inv_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "message": { "description": "Custom message from sender to recipient (if provided).\n Max 2000 bytes to support ~500 multibyte characters.", "maxLength": 2000, "title": "message", "type": [ "string", "null" ] }, "organization_id": { "description": "Organization the invitation is for.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "sender": { "$ref": "#/components/schemas/User", "description": "User who sent the invitation (point-in-time snapshot at creation).", "title": "sender" }, "status": { "$ref": "#/components/schemas/OrganizationInviteStatus", "description": "Current status of the invitation.", "title": "status" } }, "required": [ "id", "organization_id", "email", "status", "sender", "created_at", "expires_at" ], "title": "OrganizationInvite", "type": "object" }, "OrganizationInviteStatus": { "enum": [ "pending", "accepted", "expired", "revoked" ] }, "OrganizationMember": { "additionalProperties": false, "description": "OrganizationMember represents a member of an organization.", "properties": { "joined_at": { "description": "When the member joined the organization.", "format": "date-time", "title": "joined_at", "type": "string" }, "role": { "$ref": "#/components/schemas/OrganizationRole", "description": "Role of the member within the organization.", "title": "role" }, "user": { "$ref": "#/components/schemas/User", "description": "User account details for this member.", "title": "user" } }, "required": [ "user", "joined_at", "role" ], "title": "OrganizationMember", "type": "object" }, "OrganizationQuota": { "additionalProperties": false, "description": "OrganizationQuota represents the quota status for an organization.", "properties": { "current_usage": { "description": "Current usage in the billing period.", "format": "int32", "title": "current_usage", "type": "integer" }, "effective_limit": { "description": "The effective monthly limit (explicit limit if set, otherwise tier default).", "format": "int32", "title": "effective_limit", "type": "integer" }, "is_exceeded": { "description": "Whether quota is exceeded.", "title": "is_exceeded", "type": "boolean" }, "organization_id": { "description": "The organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "period_start": { "description": "Start of current billing period.", "format": "date-time", "title": "period_start", "type": "string" }, "remaining": { "description": "Remaining requests in the billing period.", "format": "int32", "title": "remaining", "type": "integer" }, "reset_at": { "description": "When the quota resets (start of next billing period).", "format": "date-time", "title": "reset_at", "type": "string" }, "tier": { "$ref": "#/components/schemas/QuotaTier", "description": "The quota tier (free or custom).", "title": "tier" }, "usage_percent": { "description": "Usage as a percentage (0-100+).", "format": "int32", "title": "usage_percent", "type": "integer" } }, "title": "OrganizationQuota", "type": "object" }, "OrganizationRole": { "enum": [ "owner", "admin", "member" ] }, "Pagination": { "additionalProperties": false, "description": "Pagination contains cursor-based pagination metadata.\n Follows Google AIP-158 for pagination field naming.", "properties": { "has_more": { "description": "Whether there are more results in the forward direction.", "title": "has_more", "type": "boolean" }, "next_page_token": { "description": "Token to retrieve the next page of results.\n Empty if there are no more results in the forward direction.", "example": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0", "title": "next_page_token", "type": "string" }, "prev_page_token": { "description": "Token to retrieve the previous page of results.\n Empty if this is the first page.", "example": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJwcmV2In0", "title": "prev_page_token", "type": "string" } }, "title": "Pagination", "type": "object" }, "Policy": { "additionalProperties": false, "description": "Policy represents a governance policy.", "properties": { "created_at": { "description": "Timestamp when policy was created.", "format": "date-time", "title": "created_at", "type": "string" }, "id": { "description": "Unique ID for the policy.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}", "example": "pol_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "name": { "description": "Policy name.", "example": "GDPR Compliance Policy", "minLength": 1, "title": "name", "type": "string" } }, "required": [ "id", "name", "created_at" ], "title": "Policy", "type": "object" }, "ProcessDocumentRequest": { "additionalProperties": false, "description": "ProcessDocumentRequest triggers processing for a document version.", "properties": { "async": { "description": "If true, returns immediately without waiting for processing to complete.", "title": "async", "type": "boolean" }, "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "version_id": { "description": "Optional version ID. If omitted, processes the current version.", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": [ "string", "null" ] } }, "title": "ProcessDocumentRequest", "type": "object" }, "ProcessDocumentResponse": { "additionalProperties": false, "description": "ProcessDocumentResponse contains the processing result.", "properties": { "document_id": { "description": "Document ID being processed.", "title": "document_id", "type": "string" }, "status": { "$ref": "#/components/schemas/ProcessingOutcome", "description": "Outcome of the processing trigger.", "title": "status" }, "version_id": { "description": "Version ID being processed.", "title": "version_id", "type": "string" } }, "title": "ProcessDocumentResponse", "type": "object" }, "ProcessingOutcome": { "description": "ProcessingOutcome describes the result of a processing trigger request.", "enum": [ "PROCESSING_OUTCOME_UNSPECIFIED", "PROCESSING_OUTCOME_STARTED", "PROCESSING_OUTCOME_ALREADY_PROCESSING", "PROCESSING_OUTCOME_ALREADY_COMPLETED", "PROCESSING_OUTCOME_FAILED" ], "title": "ProcessingOutcome", "type": "string" }, "ProcessingStatus": { "enum": [ "processing", "ready", "failed" ] }, "QuotaTier": { "enum": [ "free", "custom" ] }, "Recipient": { "additionalProperties": false, "description": "Recipient represents an entity with access to a document.", "properties": { "document_role": { "$ref": "#/components/schemas/DocumentRole", "description": "Role on the document.", "title": "document_role" }, "email": { "description": "Email (only for user recipients).", "title": "email", "type": "string" }, "id": { "description": "Recipient ID (TypeID: user_xxx, bot_xxx, or org_xxx).", "title": "id", "type": "string" }, "name": { "description": "Display name.", "title": "name", "type": "string" }, "type": { "$ref": "#/components/schemas/RecipientType", "description": "Type of recipient.", "title": "type" } }, "required": [ "id", "type", "document_role" ], "title": "Recipient", "type": "object" }, "RecipientGrant": { "additionalProperties": false, "description": "RecipientGrant specifies a recipient and role for granting access.", "properties": { "recipient": { "description": "Recipient email address or TypeID (user_xxx, bot_xxx).", "maxLength": 320, "minLength": 1, "title": "recipient", "type": "string" }, "role": { "$ref": "#/components/schemas/DocumentRole", "description": "Role to grant.", "title": "role" } }, "required": [ "role" ], "title": "RecipientGrant", "type": "object" }, "RecipientType": { "enum": [ "user", "bot", "organization" ] }, "RemoveOrganizationMemberRequest": { "additionalProperties": false, "description": "RemoveOrganizationMemberRequest identifies a member to remove.", "properties": { "organization_id": { "description": "Organization to remove the member from.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "user_id": { "description": "User account ID of the member to remove.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "user_id", "type": "string" } }, "required": [ "organization_id", "user_id" ], "title": "RemoveOrganizationMemberRequest", "type": "object" }, "RemoveOrganizationMemberResponse": { "additionalProperties": false, "description": "RemoveOrganizationMemberResponse is empty on success.", "title": "RemoveOrganizationMemberResponse", "type": "object" }, "ResendOrganizationInviteRequest": { "additionalProperties": false, "description": "ResendOrganizationInviteRequest identifies an invitation to resend.", "properties": { "invite_id": { "description": "Invitation ID to resend.\n Pattern: inv_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^inv_[0-9a-hjkmnp-tv-z]{26}$", "title": "invite_id", "type": "string" }, "organization_id": { "description": "Organization the invitation belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id", "invite_id" ], "title": "ResendOrganizationInviteRequest", "type": "object" }, "ResendOrganizationInviteResponse": { "additionalProperties": false, "description": "ResendOrganizationInviteResponse contains the updated invitation.", "properties": { "invite": { "$ref": "#/components/schemas/OrganizationInvite", "description": "The invitation with updated send count and timestamp.", "title": "invite" } }, "required": [ "invite" ], "title": "ResendOrganizationInviteResponse", "type": "object" }, "RevokeApiKeyRequest": { "additionalProperties": false, "description": "RevokeApiKeyRequest identifies an API key to revoke.", "properties": { "api_key_id": { "description": "API key ID to revoke.\n Pattern: key_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "api_key_id", "type": "string" }, "reason": { "description": "Optional reason for revocation (for audit purposes).\n The revoking user's identity and timestamp are captured in audit logs separately.", "maxLength": 500, "minLength": 1, "title": "reason", "type": [ "string", "null" ] } }, "required": [ "api_key_id" ], "title": "RevokeApiKeyRequest", "type": "object" }, "RevokeApiKeyResponse": { "additionalProperties": false, "description": "RevokeApiKeyResponse contains the revoked API key.", "properties": { "api_key": { "$ref": "#/components/schemas/ApiKey", "description": "The revoked API key with updated revoked_at timestamp.", "title": "api_key" } }, "required": [ "api_key" ], "title": "RevokeApiKeyResponse", "type": "object" }, "RevokeDocumentAccessRequest": { "additionalProperties": false, "description": "RevokeDocumentAccessRequest revokes access from a single recipient.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "recipient_id": { "description": "Recipient ID (TypeID: user_xxx or bot_xxx).", "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$", "title": "recipient_id", "type": "string" } }, "title": "RevokeDocumentAccessRequest", "type": "object" }, "RevokeDocumentAccessResponse": { "additionalProperties": false, "description": "RevokeDocumentAccessResponse contains the result of revoking access.", "properties": { "error": { "description": "Error message if the revocation failed.", "title": "error", "type": "string" }, "success": { "description": "Whether the revocation succeeded.", "title": "success", "type": "boolean" } }, "title": "RevokeDocumentAccessResponse", "type": "object" }, "RevokeOrganizationInviteRequest": { "additionalProperties": false, "description": "RevokeOrganizationInviteRequest identifies an invitation to revoke.", "properties": { "invite_id": { "description": "Invitation ID to revoke.\n Pattern: inv_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^inv_[0-9a-hjkmnp-tv-z]{26}$", "title": "invite_id", "type": "string" }, "organization_id": { "description": "Organization the invitation belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id", "invite_id" ], "title": "RevokeOrganizationInviteRequest", "type": "object" }, "RevokeOrganizationInviteResponse": { "additionalProperties": false, "description": "RevokeOrganizationInviteResponse contains the revoked invitation.", "properties": { "invite": { "$ref": "#/components/schemas/OrganizationInvite", "description": "The revoked invitation with updated status.", "title": "invite" } }, "required": [ "invite" ], "title": "RevokeOrganizationInviteResponse", "type": "object" }, "SetAPIKeyQuotaRequest": { "additionalProperties": false, "description": "SetAPIKeyQuotaRequest creates or updates a per-key quota.", "properties": { "api_key_id": { "description": "The API key ID (required).", "minLength": 1, "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "api_key_id", "type": "string" }, "limit": { "description": "The limit for this key. Must be > 0.", "exclusiveMinimum": 0, "format": "int32", "title": "limit", "type": [ "integer", "null" ] }, "organization_id": { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": [ "string", "null" ] } }, "title": "SetAPIKeyQuotaRequest", "type": "object" }, "SetAPIKeyQuotaResponse": { "additionalProperties": false, "description": "SetAPIKeyQuotaResponse returns the updated key quota.", "properties": { "quota": { "$ref": "#/components/schemas/APIKeyQuota", "description": "The updated key quota status.", "title": "quota" } }, "title": "SetAPIKeyQuotaResponse", "type": "object" }, "SetGeneralAccessRequest": { "additionalProperties": false, "description": "SetGeneralAccessRequest sets the general access level.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "general_access_level": { "$ref": "#/components/schemas/GeneralAccessLevel", "description": "General access level to set.", "title": "general_access_level" } }, "required": [ "general_access_level" ], "title": "SetGeneralAccessRequest", "type": "object" }, "SetGeneralAccessResponse": { "additionalProperties": false, "description": "SetGeneralAccessResponse contains the updated general access level.", "properties": { "document_id": { "description": "Document ID.", "title": "document_id", "type": "string" }, "general_access_level": { "$ref": "#/components/schemas/GeneralAccessLevel", "description": "The applied general access level.", "title": "general_access_level" } }, "title": "SetGeneralAccessResponse", "type": "object" }, "ShareLink": { "additionalProperties": false, "description": "ShareLink represents a shareable link for a document.", "properties": { "created_at": { "description": "When the link was created.", "format": "date-time", "title": "created_at", "type": "string" }, "creator_id": { "description": "ID of the user who created this link.", "title": "creator_id", "type": "string" }, "document_id": { "description": "Document ID this link belongs to.", "title": "document_id", "type": "string" }, "id": { "description": "Share link ID.", "title": "id", "type": "string" } }, "title": "ShareLink", "type": "object" }, "SpreadsheetBundle": { "additionalProperties": false, "description": "SpreadsheetBundle groups a spreadsheet record with its optional grid layout.", "properties": { "layout": { "$ref": "#/components/schemas/qcr.v1alpha.SpreadsheetLayout", "description": "Grid layout overlay (column widths, row heights, cell formatting).\n Absent when layout has not been generated.", "title": "layout" }, "record": { "$ref": "#/components/schemas/qcr.v1alpha.SpreadsheetRecord", "description": "Parsed spreadsheet content (sheets, tables, images, charts).", "title": "record" } }, "title": "SpreadsheetBundle", "type": "object" }, "StringFilter": { "additionalProperties": false, "description": "StringFilter provides flexible string matching options.\n Used with Vanguard dot notation: ?email.contains=john or ?email.exact=john@example.com\n\n Note on case sensitivity: `contains` is case-insensitive for user-friendly partial\n matching (e.g., finding \"john\" matches \"John.Doe@...\"). `exact` is case-sensitive\n for precise lookups where the caller knows the exact value. For email addresses,\n this matches RFC 5321 behavior where the domain is case-insensitive but local-part\n handling varies by provider.\nmutually_exclusive // only one of contains or exact can be specified\n", "properties": { "contains": { "description": "Case-insensitive substring match.\n REST: ?field.contains=value", "title": "contains", "type": [ "string", "null" ] }, "exact": { "description": "Exact match (case-sensitive).\n REST: ?field.exact=value", "title": "exact", "type": [ "string", "null" ] } }, "title": "StringFilter", "type": "object" }, "Struct": { "additionalProperties": { "$ref": "#/components/schemas/Value" }, "description": "`Struct` represents a structured data value, consisting of fields\n which map to dynamically typed values. In some languages, `Struct`\n might be supported by a native representation. For example, in\n scripting languages like JS a struct is represented as an\n object. The details of that representation are described together\n with the proto support for the language.\n\n The JSON representation for `Struct` is JSON object.", "type": "object" }, "Struct.FieldsEntry": { "additionalProperties": false, "properties": { "key": { "title": "key", "type": "string" }, "value": { "$ref": "#/components/schemas/Value", "title": "value" } }, "title": "FieldsEntry", "type": "object" }, "Subject": { "additionalProperties": false, "description": "Subject is a lightweight reference to either a user or a bot.\n Used in embedded fields like created_by.\n For full details, call GetUser or GetBot with the subject's id.\nsubject_type_matches_id_prefix // id prefix must match type (user_ for user, bot_ for bot)\n", "discriminator": { "propertyName": "type" }, "properties": { "id": { "description": "Unique ID. user_xxx for users, bot_xxx for bots.", "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "name": { "description": "Display name of the user or bot.", "minLength": 1, "title": "name", "type": "string" }, "type": { "$ref": "#/components/schemas/SubjectType", "description": "Discriminator indicating whether this subject is a user or a bot.", "title": "type" } }, "required": [ "id", "type", "name" ], "title": "Subject", "type": "object" }, "SubjectType": { "enum": [ "user", "bot" ] }, "TimelineEvent": { "additionalProperties": false, "properties": { "event_id": { "example": "550e8400-e29b-41d4-a716-446655440000", "format": "uuid", "title": "event_id", "type": "string" }, "event_type": { "$ref": "#/components/schemas/TimelineEventType", "title": "event_type" }, "occurred_at": { "format": "date-time", "title": "occurred_at", "type": "string" }, "payload": { "$ref": "#/components/schemas/Struct", "title": "payload" } }, "title": "TimelineEvent", "type": "object" }, "TimelineEventType": { "enum": [ "comment_created", "comment_updated", "thread_created", "thread_updated", "approval_voted", "approval_started", "approval_terminated", "document_loaded", "approval_ready", "approval_submitted", "approval_skip_dissemination", "document_created", "document_updated", "comment_deleted", "document_user_access_granted", "document_user_access_revoked", "document_entry_page_downloaded", "document_version_uploaded", "document_printed", "document_settings_access_changed", "annotation_added", "annotation_edited", "annotation_deleted", "annotation_resolved" ] }, "TimestampFilter": { "additionalProperties": false, "description": "TimestampFilter specifies a time range for filtering.\n Used with Vanguard dot notation: ?created.after=...&created.before=...", "properties": { "after": { "description": "Return results after this timestamp (inclusive).", "oneOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "after" }, "before": { "description": "Return results before this timestamp (inclusive).", "oneOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "before" } }, "title": "TimestampFilter", "type": "object" }, "TransferDocumentOwnershipRequest": { "additionalProperties": false, "description": "TransferDocumentOwnershipRequest specifies the document and new owner.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "new_owner_id": { "description": "User ID of the new owner.", "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "new_owner_id", "type": "string" } }, "title": "TransferDocumentOwnershipRequest", "type": "object" }, "TransferDocumentOwnershipResponse": { "additionalProperties": false, "description": "TransferDocumentOwnershipResponse confirms the transfer.", "properties": { "document_id": { "description": "Document ID that was transferred.", "title": "document_id", "type": "string" }, "new_owner_id": { "description": "User ID of the new owner.", "title": "new_owner_id", "type": "string" } }, "title": "TransferDocumentOwnershipResponse", "type": "object" }, "TrashDocumentRequest": { "additionalProperties": false, "description": "TrashDocumentRequest identifies the document to trash.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "TrashDocumentRequest", "type": "object" }, "TrashDocumentResponse": { "additionalProperties": false, "description": "TrashDocumentResponse is empty on success.", "title": "TrashDocumentResponse", "type": "object" }, "UntrashDocumentRequest": { "additionalProperties": false, "description": "UntrashDocumentRequest identifies the document to restore.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, "title": "UntrashDocumentRequest", "type": "object" }, "UntrashDocumentResponse": { "additionalProperties": false, "description": "UntrashDocumentResponse is empty on success.", "title": "UntrashDocumentResponse", "type": "object" }, "UpdateDocumentAccessRequest": { "additionalProperties": false, "description": "UpdateDocumentAccessRequest updates a single recipient's role.", "properties": { "document_id": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "document_role": { "$ref": "#/components/schemas/DocumentRole", "description": "New role to assign.", "title": "document_role" }, "recipient_id": { "description": "Recipient ID (TypeID: user_xxx or bot_xxx).", "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$", "title": "recipient_id", "type": "string" } }, "required": [ "document_role" ], "title": "UpdateDocumentAccessRequest", "type": "object" }, "UpdateDocumentAccessResponse": { "additionalProperties": false, "description": "UpdateDocumentAccessResponse contains the result of updating access.", "properties": { "error": { "description": "Error message if the update failed.", "title": "error", "type": "string" }, "success": { "description": "Whether the update succeeded.", "title": "success", "type": "boolean" } }, "title": "UpdateDocumentAccessResponse", "type": "object" }, "UpdateDocumentRequest": { "additionalProperties": false, "description": "UpdateDocumentRequest specifies fields to update on a document.", "properties": { "description": { "description": "New description (max 2000 characters).", "maxLength": 2000, "title": "description", "type": [ "string", "null" ] }, "document_id": { "description": "Document ID to update.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "title": { "description": "New title (1-255 characters).", "maxLength": 255, "minLength": 1, "title": "title", "type": [ "string", "null" ] } }, "title": "UpdateDocumentRequest", "type": "object" }, "UpdateDocumentResponse": { "additionalProperties": false, "description": "UpdateDocumentResponse contains the updated document.", "properties": { "document": { "$ref": "#/components/schemas/Document", "description": "The updated document.", "title": "document" } }, "required": [ "document" ], "title": "UpdateDocumentResponse", "type": "object" }, "UpdateOrganizationMemberRequest": { "additionalProperties": false, "description": "UpdateOrganizationMemberRequest identifies a member and the new role.", "properties": { "organization_id": { "description": "Organization the member belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" }, "role": { "$ref": "#/components/schemas/OrganizationRole", "description": "New role for the member. Cannot be UNSPECIFIED or OWNER.\n OWNER transfer is not supported — the owner is set at organization creation.", "title": "role" }, "user_id": { "description": "User account ID of the member to update.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "user_id", "type": "string" } }, "required": [ "organization_id", "user_id", "role" ], "title": "UpdateOrganizationMemberRequest", "type": "object" }, "UpdateOrganizationMemberResponse": { "additionalProperties": false, "description": "UpdateOrganizationMemberResponse contains the updated member.", "properties": { "member": { "$ref": "#/components/schemas/OrganizationMember", "description": "The updated organization member with the new role.", "title": "member" } }, "required": [ "member" ], "title": "UpdateOrganizationMemberResponse", "type": "object" }, "UpdateOrganizationRequest": { "additionalProperties": false, "description": "UpdateOrganizationRequest contains the fields to update on an organization.", "properties": { "logo_image_url": { "description": "Optional logo image URL. nil = no change. Pass the URL returned by UploadOrganizationLogo.", "format": "uri", "maxLength": 1024, "title": "logo_image_url", "type": [ "string", "null" ] }, "name": { "description": "Optional new display name. nil = no change. Minimum 1 character.", "minLength": 1, "title": "name", "type": [ "string", "null" ] }, "organization_id": { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id" ], "title": "UpdateOrganizationRequest", "type": "object" }, "UpdateOrganizationResponse": { "additionalProperties": false, "description": "UpdateOrganizationResponse contains the updated organization.", "properties": { "organization": { "$ref": "#/components/schemas/Organization", "description": "The updated organization.", "title": "organization" } }, "required": [ "organization" ], "title": "UpdateOrganizationResponse", "type": "object" }, "UpdateVersionRequest": { "additionalProperties": false, "description": "UpdateVersionRequest specifies fields to update on a version.", "properties": { "description": { "description": "New description.", "title": "description", "type": [ "string", "null" ] }, "title": { "description": "New title (max 255 characters).", "maxLength": 255, "title": "title", "type": [ "string", "null" ] }, "version_id": { "description": "Version ID to update.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": "string" } }, "title": "UpdateVersionRequest", "type": "object" }, "UploadOrganizationLogoRequest": { "additionalProperties": false, "description": "UploadOrganizationLogoRequest contains the logo image to upload.", "properties": { "content_type": { "description": "Informational content type. The server detects format from magic bytes.", "title": "content_type", "type": "string" }, "image_data": { "description": "Raw image bytes. Maximum 2 MB. Accepted formats: JPEG, PNG, WebP, SVG.", "format": "byte", "maxLength": 2097152, "minLength": 1, "title": "image_data", "type": "string" }, "organization_id": { "description": "Organization ID.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, "required": [ "organization_id" ], "title": "UploadOrganizationLogoRequest", "type": "object" }, "UploadOrganizationLogoResponse": { "additionalProperties": false, "description": "UploadOrganizationLogoResponse contains the URL of the uploaded logo.", "properties": { "logo_url": { "description": "Public URL of the uploaded logo image.", "title": "logo_url", "type": "string" } }, "title": "UploadOrganizationLogoResponse", "type": "object" }, "User": { "additionalProperties": false, "description": "User represents a human user account.\n Returned by GetUser (endpoint deferred).", "properties": { "email": { "format": "email", "title": "email", "type": "string" }, "family_name": { "description": "Family name (last name) of the user.", "maxLength": 255, "title": "family_name", "type": [ "string", "null" ] }, "given_name": { "description": "Given name (first name) of the user.", "maxLength": 255, "title": "given_name", "type": [ "string", "null" ] }, "id": { "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "name": { "description": "Display name of the user.", "minLength": 1, "title": "name", "type": "string" }, "profile_image_url": { "description": "URL of the user's profile image.", "maxLength": 2048, "title": "profile_image_url", "type": [ "string", "null" ] } }, "required": [ "id", "name", "email" ], "title": "User", "type": "object" }, "Value": { "description": "`Value` represents a dynamically typed value which can be either\n null, a number, a string, a boolean, a recursive struct value, or a\n list of values. A producer of value is expected to set one of these\n variants. Absence of any variant indicates an error.\n\n The JSON representation for `Value` is JSON value.", "oneOf": [ { "type": "null" }, { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "type": "array" }, { "additionalProperties": true, "type": "object" } ] }, "Version": { "additionalProperties": false, "description": "Version represents a document version.", "properties": { "created_at": { "description": "Timestamp when version was created.", "format": "date-time", "title": "created_at", "type": "string" }, "created_by": { "$ref": "#/components/schemas/Subject", "description": "Subject who created the version.", "title": "created_by" }, "description": { "description": "Description of changes in this version.", "title": "description", "type": [ "string", "null" ] }, "document_id": { "description": "Parent document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" }, "id": { "description": "Unique ID for the version.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" }, "processing_status": { "$ref": "#/components/schemas/ProcessingStatus", "description": "Processing status.", "title": "processing_status" }, "title": { "description": "Optional version title.", "example": "Version 2.0", "maxLength": 255, "title": "title", "type": [ "string", "null" ] }, "url": { "description": "URL for accessing this version on Factify.", "example": "https://app.factify.com/d/01h2xcejqtf2nbrexx3vqjhp41/v/1", "format": "uri", "title": "url", "type": "string" } }, "required": [ "id", "document_id", "url", "processing_status", "created_at", "created_by" ], "title": "Version", "type": "object" }, "VersionRef": { "additionalProperties": false, "description": "VersionRef is a lightweight reference to a version.", "properties": { "id": { "description": "Version ID.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "id", "type": "string" } }, "required": [ "id" ], "title": "VersionRef", "type": "object" }, "connect-protocol-version": { "const": 1, "description": "Define the version of the Connect protocol", "enum": [ 1 ], "title": "Connect-Protocol-Version", "type": "number" }, "connect-timeout-header": { "description": "Define the timeout, in ms", "title": "Connect-Timeout-Ms", "type": "number" }, "connect.error": { "additionalProperties": true, "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation", "properties": { "code": { "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", "enum": [ "canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated" ], "example": "not_found", "type": "string" }, "details": { "description": "A list of messages that carry the error details. There is no limit on the number of messages.", "items": { "$ref": "#/components/schemas/connect.error_details.Any" }, "type": "array" }, "message": { "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", "type": "string" } }, "title": "Connect Error", "type": "object" }, "connect.error_details.Any": { "additionalProperties": true, "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details.", "properties": { "debug": { "description": "Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", "discriminator": { "propertyName": "type" }, "oneOf": [ { "additionalProperties": true, "description": "Detailed error information.", "title": "Any", "type": "object" } ], "title": "Debug" }, "type": { "description": "A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", "type": "string" }, "value": { "description": "The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", "format": "binary", "type": "string" } }, "type": "object" }, "qcr.v1alpha.Block": { "additionalProperties": false, "allOf": [ { "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "description": "per-block extraction metadata", "title": "attributes" }, "id": { "description": "Optional stable ID for external references (claim anchoring, annotations).\n Not used for layout addressing — positional paths serve that purpose.", "title": "id", "type": "string" } } }, { "oneOf": [ { "properties": { "code_block": { "$ref": "#/components/schemas/qcr.v1alpha.CodeBlockData", "title": "code_block" } }, "required": [ "code_block" ], "title": "code_block", "type": "object" }, { "properties": { "figure": { "$ref": "#/components/schemas/qcr.v1alpha.VectorImageData", "title": "figure" } }, "required": [ "figure" ], "title": "figure", "type": "object" }, { "properties": { "footnote": { "$ref": "#/components/schemas/qcr.v1alpha.FootnoteData", "title": "footnote" } }, "required": [ "footnote" ], "title": "footnote", "type": "object" }, { "properties": { "heading": { "$ref": "#/components/schemas/qcr.v1alpha.HeadingData", "title": "heading" } }, "required": [ "heading" ], "title": "heading", "type": "object" }, { "properties": { "image": { "$ref": "#/components/schemas/qcr.v1alpha.RasterImageData", "title": "image" } }, "required": [ "image" ], "title": "image", "type": "object" }, { "properties": { "list": { "$ref": "#/components/schemas/qcr.v1alpha.ListData", "title": "list" } }, "required": [ "list" ], "title": "list", "type": "object" }, { "properties": { "paragraph": { "$ref": "#/components/schemas/qcr.v1alpha.ParagraphData", "title": "paragraph" } }, "required": [ "paragraph" ], "title": "paragraph", "type": "object" }, { "properties": { "quote": { "$ref": "#/components/schemas/qcr.v1alpha.QuoteData", "title": "quote" } }, "required": [ "quote" ], "title": "quote", "type": "object" }, { "properties": { "section": { "$ref": "#/components/schemas/qcr.v1alpha.SectionData", "title": "section" } }, "required": [ "section" ], "title": "section", "type": "object" }, { "properties": { "table": { "$ref": "#/components/schemas/qcr.v1alpha.TableData", "title": "table" } }, "required": [ "table" ], "title": "table", "type": "object" }, { "properties": { "thematic_break": { "$ref": "#/components/schemas/qcr.v1alpha.ThematicBreakData", "title": "thematic_break" } }, "required": [ "thematic_break" ], "title": "thematic_break", "type": "object" } ] } ], "description": "Block is the unit of document content. Each block carries exactly one\n type-specific payload via oneof. Blocks do not nest generically — only\n SectionData can contain child blocks, enforcing valid containment at the\n schema level.", "title": "Block", "type": "object" }, "qcr.v1alpha.BlockPath": { "additionalProperties": false, "description": "BlockPath addresses an element within the record's typed containment\n hierarchy. Each segment steps into a specific typed child collection.\n\n Examples:\n [block(2)] → blocks[2]\n [block(2), block(0)] → blocks[2].section.blocks[0]\n [block(4), row(1), cell(0)] → blocks[4].table.rows[1].cells[0]\n [block(3), item(2)] → blocks[3].list.items[2]\n [block(3), item(2), item(0)] → nested sub-list item\n\n The path is unambiguous because each segment type implies which child\n collection to descend into (blocks for sections, rows for tables, etc.).", "properties": { "segments": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.PathSegment" }, "title": "segments", "type": "array" } }, "title": "BlockPath", "type": "object" }, "qcr.v1alpha.BlockSpacing": { "additionalProperties": false, "properties": { "after_mm": { "format": "float", "title": "after_mm", "type": "number" }, "before_mm": { "format": "float", "title": "before_mm", "type": "number" }, "line_spacing": { "$ref": "#/components/schemas/qcr.v1alpha.LineSpacingValue", "title": "line_spacing" } }, "title": "BlockSpacing", "type": "object" }, "qcr.v1alpha.BoundingBox": { "additionalProperties": false, "description": "Normalized bounding box relative to the page (0.0–1.0).\n Origin is top-left: (0,0) is the top-left corner of the page,\n x increases rightward, y increases downward.\n Extraction pipelines must flip the y-axis for bottom-left origin formats (PDF).\n To get absolute coordinates, multiply by the page's PhysicalDimensions.", "properties": { "height": { "format": "float", "title": "height", "type": "number" }, "width": { "format": "float", "title": "width", "type": "number" }, "x": { "format": "float", "title": "x", "type": "number" }, "y": { "format": "float", "title": "y", "type": "number" } }, "title": "BoundingBox", "type": "object" }, "qcr.v1alpha.CellAlignment": { "additionalProperties": false, "allOf": [ { "properties": { "horizontal": { "$ref": "#/components/schemas/qcr.v1alpha.HorizontalAlignment", "title": "horizontal" }, "vertical": { "$ref": "#/components/schemas/qcr.v1alpha.VerticalAlignment", "title": "vertical" } } }, { "oneOf": [ { "properties": { "rotation_degrees": { "description": "-90 to 90; positive = counter-clockwise", "format": "int32", "title": "rotation_degrees", "type": "integer" } }, "required": [ "rotation_degrees" ], "title": "rotation_degrees", "type": "object" }, { "properties": { "vertical_text": { "description": "stacked vertical text", "title": "vertical_text", "type": "boolean" } }, "required": [ "vertical_text" ], "title": "vertical_text", "type": "object" } ] } ], "title": "CellAlignment", "type": "object" }, "qcr.v1alpha.CellErrorType": { "enum": [ "CELL_ERROR_TYPE_UNSPECIFIED", "CELL_ERROR_TYPE_NULL", "CELL_ERROR_TYPE_DIV_ZERO", "CELL_ERROR_TYPE_VALUE", "CELL_ERROR_TYPE_REF", "CELL_ERROR_TYPE_NAME", "CELL_ERROR_TYPE_NUM", "CELL_ERROR_TYPE_NA", "CELL_ERROR_TYPE_GETTING_DATA", "CELL_ERROR_TYPE_SPILL", "CELL_ERROR_TYPE_CALC" ], "title": "CellErrorType", "type": "string" }, "qcr.v1alpha.CellLayoutBinding": { "additionalProperties": false, "properties": { "alignment": { "$ref": "#/components/schemas/qcr.v1alpha.CellAlignment", "title": "alignment" }, "col": { "format": "int32", "title": "col", "type": "integer" }, "row": { "format": "int32", "title": "row", "type": "integer" }, "text_wrap": { "title": "text_wrap", "type": "boolean" } }, "title": "CellLayoutBinding", "type": "object" }, "qcr.v1alpha.CellType": { "enum": [ "CELL_TYPE_UNSPECIFIED", "CELL_TYPE_STRING", "CELL_TYPE_NUMBER", "CELL_TYPE_BOOLEAN", "CELL_TYPE_DATE", "CELL_TYPE_ERROR", "CELL_TYPE_TIME", "CELL_TYPE_DATE_TIME" ], "title": "CellType", "type": "string" }, "qcr.v1alpha.CodeBlockData": { "additionalProperties": false, "properties": { "code": { "title": "code", "type": "string" }, "language": { "title": "language", "type": "string" } }, "title": "CodeBlockData", "type": "object" }, "qcr.v1alpha.ColumnDef": { "additionalProperties": false, "description": "ColumnDef defines a single column in a DataTable.", "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "title": "attributes" }, "name": { "description": "header text", "title": "name", "type": "string" }, "number_format_category": { "$ref": "#/components/schemas/qcr.v1alpha.NumberFormatCategory", "title": "number_format_category" }, "type": { "$ref": "#/components/schemas/qcr.v1alpha.CellType", "description": "dominant column type", "title": "type" } }, "title": "ColumnDef", "type": "object" }, "qcr.v1alpha.ColumnFormatBinding": { "additionalProperties": false, "description": "Format binding for a column within a DataTable, used for rendering.", "properties": { "column_index": { "description": "index into DataTable.columns[]", "format": "int32", "title": "column_index", "type": "integer" }, "number_format_category": { "$ref": "#/components/schemas/qcr.v1alpha.NumberFormatCategory", "title": "number_format_category" }, "number_format_pattern": { "description": "e.g. \"#,##0.00\", \"yyyy-mm-dd\", \"0.00%\"", "title": "number_format_pattern", "type": "string" }, "table_name": { "description": "references DataTable.name", "title": "table_name", "type": "string" } }, "title": "ColumnFormatBinding", "type": "object" }, "qcr.v1alpha.ColumnLayout": { "additionalProperties": false, "properties": { "col": { "format": "int32", "title": "col", "type": "integer" }, "is_hidden": { "title": "is_hidden", "type": "boolean" }, "width_mm": { "format": "float", "title": "width_mm", "type": "number" } }, "title": "ColumnLayout", "type": "object" }, "qcr.v1alpha.DataCell": { "additionalProperties": false, "allOf": [ { "properties": { "hyperlink": { "title": "hyperlink", "type": "string" }, "note": { "title": "note", "type": "string" } } }, { "oneOf": [ { "properties": { "bool_value": { "title": "bool_value", "type": "boolean" } }, "required": [ "bool_value" ], "title": "bool_value", "type": "object" }, { "properties": { "error_value": { "$ref": "#/components/schemas/qcr.v1alpha.CellErrorType", "title": "error_value" } }, "required": [ "error_value" ], "title": "error_value", "type": "object" }, { "properties": { "number_value": { "format": "double", "title": "number_value", "type": "number" } }, "required": [ "number_value" ], "title": "number_value", "type": "object" }, { "properties": { "string_value": { "title": "string_value", "type": "string" } }, "required": [ "string_value" ], "title": "string_value", "type": "object" } ] } ], "description": "DataCell holds a single semantic value. Source-format concerns (formulas,\n formatting) are not modeled — the record captures what the data means.", "title": "DataCell", "type": "object" }, "qcr.v1alpha.DataRow": { "additionalProperties": false, "description": "DataRow is a single record in a DataTable.\n cells are positional: cells[i] corresponds to columns[i].", "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "title": "attributes" }, "cells": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.DataCell" }, "title": "cells", "type": "array" } }, "title": "DataRow", "type": "object" }, "qcr.v1alpha.DataSource": { "additionalProperties": false, "allOf": [ { "properties": { "mime_type": { "$ref": "#/components/schemas/qcr.v1alpha.MimeType", "title": "mime_type" } } }, { "oneOf": [ { "properties": { "inline_data": { "description": "raw bytes for small/embedded content", "format": "byte", "title": "inline_data", "type": "string" } }, "required": [ "inline_data" ], "title": "inline_data", "type": "object" }, { "properties": { "storage_ref": { "description": "S3 key, CDN URL, or other stable reference", "title": "storage_ref", "type": "string" } }, "required": [ "storage_ref" ], "title": "storage_ref", "type": "object" } ] } ], "description": "DataSource represents a media payload — either a stable external reference\n or inline bytes — paired with its MIME type.", "title": "DataSource", "type": "object" }, "qcr.v1alpha.DataTable": { "additionalProperties": false, "description": "DataTable is the semantic core: schema + records.\n For CSV: one DataTable per file. For XLSX: one per ListObject or detected\n table region. When a sheet is a single table, there is one DataTable.", "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "title": "attributes" }, "columns": { "description": "the schema", "items": { "$ref": "#/components/schemas/qcr.v1alpha.ColumnDef" }, "title": "columns", "type": "array" }, "has_total_row": { "title": "has_total_row", "type": "boolean" }, "name": { "description": "from ListObject or extractor-assigned", "title": "name", "type": "string" }, "range_ref": { "description": "A1-notation origin, e.g. \"A1:D100\"", "title": "range_ref", "type": "string" }, "rows": { "description": "ordered data rows (excludes header)", "items": { "$ref": "#/components/schemas/qcr.v1alpha.DataRow" }, "title": "rows", "type": "array" } }, "title": "DataTable", "type": "object" }, "qcr.v1alpha.Direction": { "description": "Text direction / reading order.", "enum": [ "DIRECTION_UNSPECIFIED", "DIRECTION_LTR", "DIRECTION_RTL" ], "title": "Direction", "type": "string" }, "qcr.v1alpha.DocumentLayout": { "additionalProperties": false, "description": "Top-level layout structure, joined to a DocumentRecord by record_id.\n Used with the Block-based record representation (DocumentRecord.blocks).", "properties": { "bindings": { "description": "sparse element → layout entries", "items": { "$ref": "#/components/schemas/qcr.v1alpha.LayoutBinding" }, "title": "bindings", "type": "array" }, "defaults": { "$ref": "#/components/schemas/qcr.v1alpha.LayoutDefaults", "title": "defaults" }, "extracted_at": { "format": "date-time", "title": "extracted_at", "type": "string" }, "pages": { "description": "page-level geometry (all pages)", "items": { "$ref": "#/components/schemas/qcr.v1alpha.PageGeometry" }, "title": "pages", "type": "array" }, "record_id": { "description": "references DocumentRecord.id", "title": "record_id", "type": "string" }, "source": { "$ref": "#/components/schemas/qcr.v1alpha.SourceReference", "title": "source" } }, "title": "DocumentLayout", "type": "object" }, "qcr.v1alpha.DocumentMetadata": { "additionalProperties": false, "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "description": "extraction backend, pipeline version, etc.", "title": "attributes" }, "extracted_at": { "format": "date-time", "title": "extracted_at", "type": "string" }, "language": { "title": "language", "type": "string" }, "title": { "title": "title", "type": "string" } }, "title": "DocumentMetadata", "type": "object" }, "qcr.v1alpha.DocumentRecord": { "additionalProperties": false, "description": "DocumentRecord is the QCR representation of an ingested document.\n Immutable once extracted. Source-format-agnostic.\n\n Structure is a flat sequence of blocks. Sections provide optional grouping\n and can nest, but block-level elements (paragraphs, tables, etc.) are leaves\n — they do not contain other blocks. This constrains nesting to only what is\n semantically valid and gives every element a natural positional address.\n\n Addressing convention: every element is addressable by its index path through\n the typed containment hierarchy. Examples:\n blocks[2] → third block\n blocks[2].section.blocks[0] → first block inside a section\n blocks[4].table.rows[1].cells[0] → second row, first cell of a table\n blocks[3].list.items[2] → third item of a list\n\n These addresses are deterministic for a given record and are used by\n DocumentLayout to join layout data to semantic content.", "properties": { "blocks": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.Block" }, "title": "blocks", "type": "array" }, "id": { "title": "id", "type": "string" }, "metadata": { "$ref": "#/components/schemas/qcr.v1alpha.DocumentMetadata", "title": "metadata" }, "source": { "$ref": "#/components/schemas/qcr.v1alpha.SourceReference", "title": "source" } }, "title": "DocumentRecord", "type": "object" }, "qcr.v1alpha.FootnoteData": { "additionalProperties": false, "properties": { "label": { "title": "label", "type": "string" }, "text": { "title": "text", "type": "string" } }, "title": "FootnoteData", "type": "object" }, "qcr.v1alpha.FrozenPane": { "additionalProperties": false, "properties": { "frozen_col": { "description": "0 = no col freeze; N = cols 0..N-1 frozen", "format": "int32", "title": "frozen_col", "type": "integer" }, "frozen_row": { "description": "0 = no row freeze; N = rows 0..N-1 frozen", "format": "int32", "title": "frozen_row", "type": "integer" } }, "title": "FrozenPane", "type": "object" }, "qcr.v1alpha.HeadingData": { "additionalProperties": false, "properties": { "level": { "format": "int32", "title": "level", "type": "integer" }, "text": { "title": "text", "type": "string" } }, "title": "HeadingData", "type": "object" }, "qcr.v1alpha.HorizontalAlignment": { "enum": [ "HORIZONTAL_ALIGNMENT_UNSPECIFIED", "HORIZONTAL_ALIGNMENT_LEFT", "HORIZONTAL_ALIGNMENT_CENTER", "HORIZONTAL_ALIGNMENT_RIGHT", "HORIZONTAL_ALIGNMENT_FILL", "HORIZONTAL_ALIGNMENT_JUSTIFY" ], "title": "HorizontalAlignment", "type": "string" }, "qcr.v1alpha.Indentation": { "additionalProperties": false, "properties": { "first_line_mm": { "description": "positive = indent, negative = hanging", "format": "float", "title": "first_line_mm", "type": "number" }, "left_mm": { "format": "float", "title": "left_mm", "type": "number" }, "right_mm": { "format": "float", "title": "right_mm", "type": "number" } }, "title": "Indentation", "type": "object" }, "qcr.v1alpha.Insets": { "additionalProperties": false, "description": "Directional spacing (padding, insets). Same shape as Margins but distinct\n semantic meaning — internal spacing rather than external.", "properties": { "bottom_mm": { "format": "float", "title": "bottom_mm", "type": "number" }, "left_mm": { "format": "float", "title": "left_mm", "type": "number" }, "right_mm": { "format": "float", "title": "right_mm", "type": "number" }, "top_mm": { "format": "float", "title": "top_mm", "type": "number" } }, "title": "Insets", "type": "object" }, "qcr.v1alpha.LayoutBinding": { "additionalProperties": false, "allOf": [ { "properties": { "fragments": { "description": "Spatial fragments — one per page the element appears on.\n A paragraph spanning pages 3–4 has two fragments.\n Order matches reading order (fragment 0 is the first appearance).", "items": { "$ref": "#/components/schemas/qcr.v1alpha.LayoutFragment" }, "title": "fragments", "type": "array" }, "path": { "$ref": "#/components/schemas/qcr.v1alpha.BlockPath", "title": "path" } } }, { "oneOf": [ { "properties": { "table": { "$ref": "#/components/schemas/qcr.v1alpha.TableLayout", "title": "table" } }, "required": [ "table" ], "title": "table", "type": "object" }, { "properties": { "table_cell": { "$ref": "#/components/schemas/qcr.v1alpha.TableCellLayout", "title": "table_cell" } }, "required": [ "table_cell" ], "title": "table_cell", "type": "object" }, { "properties": { "table_row": { "$ref": "#/components/schemas/qcr.v1alpha.TableRowLayout", "title": "table_row" } }, "required": [ "table_row" ], "title": "table_row", "type": "object" }, { "properties": { "text_block": { "$ref": "#/components/schemas/qcr.v1alpha.TextBlockLayout", "title": "text_block" } }, "required": [ "text_block" ], "title": "text_block", "type": "object" } ] } ], "description": "LayoutBinding attaches layout data to a specific element in the record.\n One binding per addressable element. Elements without layout data have no\n binding entry (sparse).", "title": "LayoutBinding", "type": "object" }, "qcr.v1alpha.LayoutDefaults": { "additionalProperties": false, "description": "Document-wide layout defaults.", "properties": { "dimensions": { "$ref": "#/components/schemas/qcr.v1alpha.PhysicalDimensions", "description": "explicit width/height when page_size is CUSTOM", "title": "dimensions" }, "direction": { "$ref": "#/components/schemas/qcr.v1alpha.Direction", "title": "direction" }, "margins": { "$ref": "#/components/schemas/qcr.v1alpha.Margins", "title": "margins" }, "orientation": { "$ref": "#/components/schemas/qcr.v1alpha.Orientation", "title": "orientation" }, "page_size": { "$ref": "#/components/schemas/qcr.v1alpha.PageSize", "title": "page_size" } }, "title": "LayoutDefaults", "type": "object" }, "qcr.v1alpha.LayoutFragment": { "additionalProperties": false, "description": "A single spatial fragment of an element on a specific page.", "properties": { "bounding_box": { "$ref": "#/components/schemas/qcr.v1alpha.BoundingBox", "description": "normalized 0.0–1.0 relative to the page", "title": "bounding_box" }, "page_number": { "description": "0-indexed, references PageGeometry.page_number", "format": "int32", "title": "page_number", "type": "integer" }, "rotation_degrees": { "format": "float", "title": "rotation_degrees", "type": "number" } }, "title": "LayoutFragment", "type": "object" }, "qcr.v1alpha.LineSpacing": { "enum": [ "LINE_SPACING_UNSPECIFIED", "LINE_SPACING_SINGLE", "LINE_SPACING_ONE_AND_HALF", "LINE_SPACING_DOUBLE" ], "title": "LineSpacing", "type": "string" }, "qcr.v1alpha.LineSpacingValue": { "additionalProperties": false, "description": "Line spacing as mode + optional explicit value.\n Using a message instead of a bare enum avoids a future wire break when\n exact/at-least modes are added (they need a companion float value).", "properties": { "mode": { "$ref": "#/components/schemas/qcr.v1alpha.LineSpacing", "title": "mode" }, "value_mm": { "description": "meaningful only for EXACT / AT_LEAST (future)", "format": "float", "title": "value_mm", "type": "number" } }, "title": "LineSpacingValue", "type": "object" }, "qcr.v1alpha.ListData": { "additionalProperties": false, "properties": { "items": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.ListData.Item" }, "title": "items", "type": "array" }, "start": { "format": "int32", "title": "start", "type": "integer" }, "style": { "$ref": "#/components/schemas/qcr.v1alpha.ListStyle", "title": "style" } }, "title": "ListData", "type": "object" }, "qcr.v1alpha.ListData.Item": { "additionalProperties": false, "properties": { "sub_list": { "$ref": "#/components/schemas/qcr.v1alpha.ListData", "description": "optional single nested list", "title": "sub_list" }, "text": { "title": "text", "type": "string" } }, "title": "Item", "type": "object" }, "qcr.v1alpha.ListStyle": { "enum": [ "LIST_STYLE_UNSPECIFIED", "LIST_STYLE_UNORDERED", "LIST_STYLE_ORDERED" ], "title": "ListStyle", "type": "string" }, "qcr.v1alpha.Margins": { "additionalProperties": false, "description": "Page/section margins in millimeters.", "properties": { "bottom_mm": { "format": "float", "title": "bottom_mm", "type": "number" }, "left_mm": { "format": "float", "title": "left_mm", "type": "number" }, "right_mm": { "format": "float", "title": "right_mm", "type": "number" }, "top_mm": { "format": "float", "title": "top_mm", "type": "number" } }, "title": "Margins", "type": "object" }, "qcr.v1alpha.MergedRegion": { "additionalProperties": false, "description": "Rectangular merge region. All bounds 0-indexed and inclusive.", "properties": { "end_col": { "format": "int32", "title": "end_col", "type": "integer" }, "end_row": { "format": "int32", "title": "end_row", "type": "integer" }, "start_col": { "format": "int32", "title": "start_col", "type": "integer" }, "start_row": { "format": "int32", "title": "start_row", "type": "integer" } }, "title": "MergedRegion", "type": "object" }, "qcr.v1alpha.MimeType": { "enum": [ "MIME_TYPE_UNSPECIFIED", "MIME_TYPE_IMAGE_PNG", "MIME_TYPE_IMAGE_JPEG", "MIME_TYPE_IMAGE_GIF", "MIME_TYPE_IMAGE_WEBP", "MIME_TYPE_IMAGE_BMP", "MIME_TYPE_IMAGE_TIFF", "MIME_TYPE_IMAGE_SVG", "MIME_TYPE_IMAGE_EPS", "MIME_TYPE_APPLICATION_PDF" ], "title": "MimeType", "type": "string" }, "qcr.v1alpha.NamedRange": { "additionalProperties": false, "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "title": "attributes" }, "name": { "title": "name", "type": "string" }, "range_ref": { "description": "A1-notation", "title": "range_ref", "type": "string" }, "sheet_name": { "description": "empty = workbook-scoped", "title": "sheet_name", "type": "string" } }, "title": "NamedRange", "type": "object" }, "qcr.v1alpha.NumberFormatCategory": { "enum": [ "NUMBER_FORMAT_CATEGORY_UNSPECIFIED", "NUMBER_FORMAT_CATEGORY_GENERAL", "NUMBER_FORMAT_CATEGORY_NUMBER", "NUMBER_FORMAT_CATEGORY_CURRENCY", "NUMBER_FORMAT_CATEGORY_ACCOUNTING", "NUMBER_FORMAT_CATEGORY_PERCENTAGE", "NUMBER_FORMAT_CATEGORY_FRACTION", "NUMBER_FORMAT_CATEGORY_SCIENTIFIC", "NUMBER_FORMAT_CATEGORY_TEXT", "NUMBER_FORMAT_CATEGORY_DATE", "NUMBER_FORMAT_CATEGORY_TIME", "NUMBER_FORMAT_CATEGORY_DATE_TIME", "NUMBER_FORMAT_CATEGORY_DURATION" ], "title": "NumberFormatCategory", "type": "string" }, "qcr.v1alpha.Orientation": { "enum": [ "ORIENTATION_UNSPECIFIED", "ORIENTATION_PORTRAIT", "ORIENTATION_LANDSCAPE" ], "title": "Orientation", "type": "string" }, "qcr.v1alpha.PageGeometry": { "additionalProperties": false, "description": "Per-page geometry. Every page gets an entry (indexed by page_number).\n Pages that match defaults can omit dimensions/orientation and inherit.", "properties": { "dimensions": { "$ref": "#/components/schemas/qcr.v1alpha.PhysicalDimensions", "description": "omit to inherit from defaults", "title": "dimensions" }, "orientation": { "$ref": "#/components/schemas/qcr.v1alpha.Orientation", "description": "omit to inherit from defaults", "title": "orientation" }, "page_number": { "description": "0-indexed", "format": "int32", "title": "page_number", "type": "integer" } }, "title": "PageGeometry", "type": "object" }, "qcr.v1alpha.PageSize": { "enum": [ "PAGE_SIZE_UNSPECIFIED", "PAGE_SIZE_A4", "PAGE_SIZE_LETTER", "PAGE_SIZE_LEGAL", "PAGE_SIZE_A3", "PAGE_SIZE_TABLOID", "PAGE_SIZE_CUSTOM" ], "title": "PageSize", "type": "string" }, "qcr.v1alpha.ParagraphData": { "additionalProperties": false, "properties": { "text": { "title": "text", "type": "string" } }, "title": "ParagraphData", "type": "object" }, "qcr.v1alpha.PathSegment": { "additionalProperties": false, "oneOf": [ { "properties": { "block": { "description": "index into blocks[] (document-level or section-level)", "title": "block", "type": "integer" } }, "required": [ "block" ], "title": "block", "type": "object" }, { "properties": { "cell": { "description": "index into Row.cells[]", "title": "cell", "type": "integer" } }, "required": [ "cell" ], "title": "cell", "type": "object" }, { "properties": { "item": { "description": "index into ListData.items[] or sub_list.items[]", "title": "item", "type": "integer" } }, "required": [ "item" ], "title": "item", "type": "object" }, { "properties": { "row": { "description": "index into TableData.rows[]", "title": "row", "type": "integer" } }, "required": [ "row" ], "title": "row", "type": "object" } ], "title": "PathSegment", "type": "object" }, "qcr.v1alpha.PhysicalDimensions": { "additionalProperties": false, "description": "Physical dimensions in millimeters.", "properties": { "height_mm": { "format": "float", "title": "height_mm", "type": "number" }, "width_mm": { "format": "float", "title": "width_mm", "type": "number" } }, "title": "PhysicalDimensions", "type": "object" }, "qcr.v1alpha.QuoteData": { "additionalProperties": false, "properties": { "text": { "title": "text", "type": "string" } }, "title": "QuoteData", "type": "object" }, "qcr.v1alpha.RasterImageData": { "additionalProperties": false, "description": "RasterImageData represents a raster image (PNG, JPEG, WebP, etc.).", "properties": { "alt_text": { "title": "alt_text", "type": "string" }, "source": { "$ref": "#/components/schemas/qcr.v1alpha.DataSource", "title": "source" } }, "title": "RasterImageData", "type": "object" }, "qcr.v1alpha.RowLayout": { "additionalProperties": false, "properties": { "height_mm": { "format": "float", "title": "height_mm", "type": "number" }, "is_hidden": { "title": "is_hidden", "type": "boolean" }, "row": { "format": "int32", "title": "row", "type": "integer" } }, "title": "RowLayout", "type": "object" }, "qcr.v1alpha.SectionData": { "additionalProperties": false, "description": "Section groups blocks under a logical heading. Only sections can nest blocks.", "properties": { "blocks": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.Block" }, "title": "blocks", "type": "array" } }, "title": "SectionData", "type": "object" }, "qcr.v1alpha.Sheet": { "additionalProperties": false, "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "title": "attributes" }, "charts": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.SheetChart" }, "title": "charts", "type": "array" }, "images": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.SheetImage" }, "title": "images", "type": "array" }, "name": { "description": "unique within workbook, used as join key by SheetLayout", "title": "name", "type": "string" }, "tables": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.DataTable" }, "title": "tables", "type": "array" } }, "title": "Sheet", "type": "object" }, "qcr.v1alpha.SheetChart": { "additionalProperties": false, "description": "Chart rendered as a figure plus metadata.", "properties": { "anchor_col": { "format": "int32", "title": "anchor_col", "type": "integer" }, "anchor_row": { "format": "int32", "title": "anchor_row", "type": "integer" }, "attributes": { "$ref": "#/components/schemas/Struct", "title": "attributes" }, "chart_type": { "description": "e.g., \"bar\", \"line\", \"pie\"", "title": "chart_type", "type": "string" }, "rendered": { "$ref": "#/components/schemas/qcr.v1alpha.VectorImageData", "title": "rendered" }, "source_ranges": { "description": "A1-notation data ranges", "items": { "type": "string" }, "title": "source_ranges", "type": "array" }, "title": { "title": "title", "type": "string" } }, "title": "SheetChart", "type": "object" }, "qcr.v1alpha.SheetImage": { "additionalProperties": false, "properties": { "anchor_col": { "format": "int32", "title": "anchor_col", "type": "integer" }, "anchor_row": { "format": "int32", "title": "anchor_row", "type": "integer" }, "height_mm": { "format": "float", "title": "height_mm", "type": "number" }, "image": { "$ref": "#/components/schemas/qcr.v1alpha.RasterImageData", "title": "image" }, "offset_x_mm": { "description": "horizontal offset within anchor cell", "format": "float", "title": "offset_x_mm", "type": "number" }, "offset_y_mm": { "description": "vertical offset within anchor cell", "format": "float", "title": "offset_y_mm", "type": "number" }, "width_mm": { "format": "float", "title": "width_mm", "type": "number" } }, "title": "SheetImage", "type": "object" }, "qcr.v1alpha.SheetLayout": { "additionalProperties": false, "properties": { "cell_bindings": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.CellLayoutBinding" }, "title": "cell_bindings", "type": "array" }, "column_formats": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.ColumnFormatBinding" }, "title": "column_formats", "type": "array" }, "columns": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.ColumnLayout" }, "title": "columns", "type": "array" }, "direction": { "$ref": "#/components/schemas/qcr.v1alpha.Direction", "title": "direction" }, "frozen_pane": { "$ref": "#/components/schemas/qcr.v1alpha.FrozenPane", "title": "frozen_pane" }, "is_hidden": { "title": "is_hidden", "type": "boolean" }, "merged_regions": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.MergedRegion" }, "title": "merged_regions", "type": "array" }, "rows": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.RowLayout" }, "title": "rows", "type": "array" }, "sheet_name": { "description": "references Sheet.name", "title": "sheet_name", "type": "string" } }, "title": "SheetLayout", "type": "object" }, "qcr.v1alpha.SourceReference": { "additionalProperties": false, "description": "SourceReference links a record back to the source it was extracted from.\n\n Three typed fields identify WHAT, WHERE, and WHEN. Everything else —\n format, content hash, storage location, checksums, external URLs — goes\n in the attributes bag, because the relevant metadata varies by source type.\n\n Examples by source type:\n\n File upload:\n source_id = \"intg_01j8k...\" (upload channel instance)\n remote_id = \"req_01h2xcejqtf2nbrexx3vqjhp41\" (upload request ID)\n attributes = {format: \"pdf\", location: \"uploads/.../original.pdf\",\n content_hash: \"a1b2c3...\", storage_etag: \"\\\"abc\\\"\"}\n\n Gmail integration:\n source_id = \"intg_01k9m...\" (Gmail connector instance)\n remote_id = \"18abc123def\" (Gmail message ID)\n attributes = {format: \"eml\", thread_id: \"...\",\n external_url: \"https://mail.google.com/...\"}\n\n Confluence sync:\n source_id = \"intg_01p3q...\" (Confluence connector instance)\n remote_id = \"12345678\" (Confluence page ID)\n attributes = {format: \"html\", space_key: \"ENG\",\n external_url: \"https://acme.atlassian.net/wiki/...\"}", "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "description": "Source-type-specific metadata. The relevant keys vary by integration:\n format, location, content_hash, external_url, checksum, etag, etc.", "title": "attributes" }, "ingested_at": { "description": "When this content was ingested into the system.", "format": "date-time", "title": "ingested_at", "type": "string" }, "remote_id": { "description": "The content's coordinates in the external system — whatever identifier\n the source system uses for this specific piece of content.\n Examples: upload request ID, Gmail message ID, Confluence page ID,\n S3 object key, Merge remote_id.", "title": "remote_id", "type": "string" }, "source_id": { "description": "Identifies the integration or connector instance that produced this\n record. Stable across re-syncs of the same source.\n Example: \"intg_01j8k...\" (opaque ID from integration registry).", "title": "source_id", "type": "string" } }, "title": "SourceReference", "type": "object" }, "qcr.v1alpha.SpreadsheetLayout": { "additionalProperties": false, "properties": { "defaults": { "$ref": "#/components/schemas/qcr.v1alpha.SpreadsheetLayoutDefaults", "title": "defaults" }, "extracted_at": { "format": "date-time", "title": "extracted_at", "type": "string" }, "record_id": { "title": "record_id", "type": "string" }, "sheet_layouts": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.SheetLayout" }, "title": "sheet_layouts", "type": "array" }, "source": { "$ref": "#/components/schemas/qcr.v1alpha.SourceReference", "title": "source" } }, "title": "SpreadsheetLayout", "type": "object" }, "qcr.v1alpha.SpreadsheetLayoutDefaults": { "additionalProperties": false, "properties": { "column_width_mm": { "format": "float", "title": "column_width_mm", "type": "number" }, "row_height_mm": { "format": "float", "title": "row_height_mm", "type": "number" } }, "title": "SpreadsheetLayoutDefaults", "type": "object" }, "qcr.v1alpha.SpreadsheetMetadata": { "additionalProperties": false, "properties": { "attributes": { "$ref": "#/components/schemas/Struct", "title": "attributes" }, "extracted_at": { "format": "date-time", "title": "extracted_at", "type": "string" }, "title": { "title": "title", "type": "string" } }, "title": "SpreadsheetMetadata", "type": "object" }, "qcr.v1alpha.SpreadsheetRecord": { "additionalProperties": false, "description": "SpreadsheetRecord is the QCR representation of an ingested spreadsheet\n workbook (XLSX, CSV, Parquet). Immutable once extracted. Source-format-agnostic.\n\n Hierarchy: SpreadsheetRecord 1:M Sheet 1:M DataTable/SheetImage/SheetChart.\n The semantic core is DataTable: named, typed columns applied to ordered rows.\n The extractor identifies headers and schemas so consumers don't have to.", "properties": { "id": { "title": "id", "type": "string" }, "metadata": { "$ref": "#/components/schemas/qcr.v1alpha.SpreadsheetMetadata", "title": "metadata" }, "named_ranges": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.NamedRange" }, "title": "named_ranges", "type": "array" }, "sheets": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.Sheet" }, "title": "sheets", "type": "array" }, "source": { "$ref": "#/components/schemas/qcr.v1alpha.SourceReference", "title": "source" } }, "title": "SpreadsheetRecord", "type": "object" }, "qcr.v1alpha.TableCellLayout": { "additionalProperties": false, "properties": { "padding": { "$ref": "#/components/schemas/qcr.v1alpha.Insets", "title": "padding" } }, "title": "TableCellLayout", "type": "object" }, "qcr.v1alpha.TableData": { "additionalProperties": false, "properties": { "rows": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.TableData.Row" }, "title": "rows", "type": "array" } }, "title": "TableData", "type": "object" }, "qcr.v1alpha.TableData.Row": { "additionalProperties": false, "properties": { "cells": { "items": { "$ref": "#/components/schemas/qcr.v1alpha.TableData.Row.Cell" }, "title": "cells", "type": "array" } }, "title": "Row", "type": "object" }, "qcr.v1alpha.TableData.Row.Cell": { "additionalProperties": false, "properties": { "col_span": { "format": "int32", "title": "col_span", "type": "integer" }, "is_header": { "title": "is_header", "type": "boolean" }, "row_span": { "format": "int32", "title": "row_span", "type": "integer" }, "text": { "title": "text", "type": "string" } }, "title": "Cell", "type": "object" }, "qcr.v1alpha.TableLayout": { "additionalProperties": false, "properties": { "column_widths_mm": { "items": { "format": "float", "type": "number" }, "title": "column_widths_mm", "type": "array" }, "width_mode": { "$ref": "#/components/schemas/qcr.v1alpha.TableWidthMode", "title": "width_mode" } }, "title": "TableLayout", "type": "object" }, "qcr.v1alpha.TableRowLayout": { "additionalProperties": false, "properties": { "height_mm": { "format": "float", "title": "height_mm", "type": "number" } }, "title": "TableRowLayout", "type": "object" }, "qcr.v1alpha.TableWidthMode": { "enum": [ "TABLE_WIDTH_MODE_UNSPECIFIED", "TABLE_WIDTH_MODE_AUTO", "TABLE_WIDTH_MODE_FIXED" ], "title": "TableWidthMode", "type": "string" }, "qcr.v1alpha.TextAlignment": { "enum": [ "TEXT_ALIGNMENT_UNSPECIFIED", "TEXT_ALIGNMENT_LEFT", "TEXT_ALIGNMENT_CENTER", "TEXT_ALIGNMENT_RIGHT", "TEXT_ALIGNMENT_JUSTIFY" ], "title": "TextAlignment", "type": "string" }, "qcr.v1alpha.TextBlockLayout": { "additionalProperties": false, "description": "Layout for block-level text elements (paragraphs, headings, list items, quotes).", "properties": { "alignment": { "$ref": "#/components/schemas/qcr.v1alpha.TextAlignment", "title": "alignment" }, "indentation": { "$ref": "#/components/schemas/qcr.v1alpha.Indentation", "title": "indentation" }, "spacing": { "$ref": "#/components/schemas/qcr.v1alpha.BlockSpacing", "title": "spacing" } }, "title": "TextBlockLayout", "type": "object" }, "qcr.v1alpha.ThematicBreakData": { "additionalProperties": false, "description": "Explicit authorial boundary (e.g. markdown `---`). Leaf block, no children.", "title": "ThematicBreakData", "type": "object" }, "qcr.v1alpha.VectorImageData": { "additionalProperties": false, "description": "VectorImageData represents a vector graphic (SVG, diagram, chart).", "properties": { "alt_text": { "title": "alt_text", "type": "string" }, "source": { "$ref": "#/components/schemas/qcr.v1alpha.DataSource", "title": "source" } }, "title": "VectorImageData", "type": "object" }, "qcr.v1alpha.VerticalAlignment": { "enum": [ "VERTICAL_ALIGNMENT_UNSPECIFIED", "VERTICAL_ALIGNMENT_TOP", "VERTICAL_ALIGNMENT_CENTER", "VERTICAL_ALIGNMENT_BOTTOM" ], "title": "VerticalAlignment", "type": "string" } }, "securitySchemes": { "bearerAuth": { "bearerFormat": "API Key", "description": "Bearer authentication header of the form Bearer , where is your auth token.", "scheme": "bearer", "type": "http" } } }, "info": { "contact": { "email": "api@factify.com", "name": "Factify API Support", "url": "https://factify.com/support" }, "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 , where 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\nusing the [ConnectRPC error format](https://connectrpc.com/docs/protocol#error-codes):\n\n```json\n{\n \"code\": \"invalid_argument\",\n \"message\": \"limit must be positive\",\n \"details\": [\n {\n \"reason\": \"invalid_field_value\",\n \"request_id\": \"req_01arwx4k8xrgqskvxq69gdn019\",\n \"param\": \"limit\"\n }\n ]\n}\n```\n", "license": { "name": "Proprietary", "url": "https://factify.com/terms" }, "title": "Factify API", "version": "1.1.0-rc.13" }, "openapi": "3.1.0", "paths": { "/v1beta/api-keys": { "get": { "description": "Lists API keys for an organization.", "operationId": "listApiKeys", "parameters": [ { "description": "Organization ID to list keys for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "query", "name": "organization_id", "required": true, "schema": { "description": "Organization ID to list keys for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "Whether to include revoked keys in the response.\n Default: false (only active and expired-but-not-revoked keys are returned).\n When true, all keys including revoked ones are returned.\n Note: Expired keys are always included unless also revoked; use is_active to filter.", "in": "query", "name": "include_revoked", "schema": { "description": "Whether to include revoked keys in the response.\n Default: false (only active and expired-but-not-revoked keys are returned).\n When true, all keys including revoked ones are returned.\n Note: Expired keys are always included unless also revoked; use is_active to filter.", "title": "include_revoked", "type": "boolean" } }, { "description": "Opaque pagination token from a previous response.", "in": "query", "name": "page_token", "schema": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" } }, { "description": "Maximum number of items to return per page (1-100). Default: 50.", "in": "query", "name": "page_size", "schema": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListApiKeysResponse" } } }, "description": "Success" }, "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" } }, "summary": "List API keys", "tags": [ "API Keys" ], "x-codeSamples": [ { "label": "listApiKeys", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.apiKeys.list({\n organizationId: \"\",\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();" }, { "label": "listApiKeys", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.api_keys.list(organization_id=\"\")\n\n while res is not None:\n # Handle items\n\n res = res.next()" } ], "x-speakeasy-name-override": "list", "x-speakeasy-pagination": { "inputs": [ { "in": "parameters", "name": "page_token", "type": "cursor" } ], "outputs": { "nextCursor": "$.pagination.next_page_token" }, "type": "cursor" } }, "post": { "description": "Creates a new API key for the specified organization. The secret is only returned once in the response and cannot be retrieved later.", "operationId": "createApiKey", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateApiKeyRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateApiKeyResponse" } } }, "description": "Success" }, "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" } }, "summary": "Create an API key", "tags": [ "API Keys" ], "x-codeSamples": [ { "label": "createApiKey", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.apiKeys.create({\n name: \"\",\n organizationId: \"\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "createApiKey", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.api_keys.create(name=\"\", organization_id=\"\")\n\n assert res.create_api_key_response is not None\n\n # Handle response\n print(res.create_api_key_response)" } ], "x-speakeasy-name-override": "create" } }, "/v1beta/api-keys/{api_key_id}/revoke": { "post": { "description": "Revokes an API key, immediately preventing it from being used for authentication.", "operationId": "revokeApiKey", "parameters": [ { "description": "API key ID to revoke.\n Pattern: key_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "api_key_id", "required": true, "schema": { "description": "API key ID to revoke.\n Pattern: key_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "api_key_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "RevokeApiKeyRequest identifies an API key to revoke.", "properties": { "reason": { "description": "Optional reason for revocation (for audit purposes).\n The revoking user's identity and timestamp are captured in audit logs separately.", "maxLength": 500, "minLength": 1, "title": "reason", "type": [ "string", "null" ] } }, "required": [], "title": "RevokeApiKeyRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevokeApiKeyResponse" } } }, "description": "Success" }, "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" } }, "summary": "Revoke an API key", "tags": [ "API Keys" ], "x-codeSamples": [ { "label": "revokeApiKey", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.apiKeys.revoke({\n apiKeyId: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "revokeApiKey", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.api_keys.revoke(api_key_id=\"\")\n\n assert res.revoke_api_key_response is not None\n\n # Handle response\n print(res.revoke_api_key_response)" } ], "x-speakeasy-name-override": "revoke" } }, "/v1beta/documents": { "get": { "description": "List documents with cursor-based pagination.", "operationId": "listDocuments", "parameters": [ { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "in": "query", "name": "page_token", "schema": { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "example": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0", "title": "page_token", "type": "string" } }, { "description": "Maximum number of items to return per page (1-100). Default: 50.", "in": "query", "name": "page_size", "schema": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } }, { "description": "Return results after this timestamp (inclusive).", "in": "query", "name": "created.after", "schema": { "description": "A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n ) to obtain a formatter capable of generating timestamps in this format.", "example": "2023-01-15T01:30:15.01Z", "format": "date-time", "type": "string" } }, { "description": "Return results before this timestamp (inclusive).", "in": "query", "name": "created.before", "schema": { "description": "A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n ) to obtain a formatter capable of generating timestamps in this format.", "example": "2023-01-15T01:30:15.01Z", "format": "date-time", "type": "string" } }, { "description": "Filter by creator ID(s) (user or bot). Returns documents matching ANY of the specified IDs.\n REST: ?created_by_id=user_01h2xcejqtf2nbrexx3vqjhp41 or ?created_by_id=user_xxx&created_by_id=bot_yyy", "in": "query", "name": "created_by_id", "schema": { "description": "Filter by creator ID(s) (user or bot). Returns documents matching ANY of the specified IDs.\n REST: ?created_by_id=user_01h2xcejqtf2nbrexx3vqjhp41 or ?created_by_id=user_xxx&created_by_id=bot_yyy", "items": { "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$", "type": "string" }, "title": "created_by_id", "type": "array" } }, { "description": "Filter by access level(s). Returns documents matching ANY of the specified levels.\n REST: ?access_level=private or ?access_level=private&access_level=organization", "in": "query", "name": "access_level", "schema": { "description": "Filter by access level(s). Returns documents matching ANY of the specified levels.\n REST: ?access_level=private or ?access_level=private&access_level=organization", "items": { "$ref": "#/components/schemas/AccessLevel" }, "title": "access_level", "type": "array" } }, { "description": "Filter by processing status(es). Returns documents matching ANY of the specified statuses.\n REST: ?processing_status=ready or ?processing_status=processing&processing_status=ready", "in": "query", "name": "processing_status", "schema": { "description": "Filter by processing status(es). Returns documents matching ANY of the specified statuses.\n REST: ?processing_status=ready or ?processing_status=processing&processing_status=ready", "items": { "$ref": "#/components/schemas/ProcessingStatus" }, "title": "processing_status", "type": "array" } }, { "description": "Sort field and direction. Prefix with `-` for descending order.\n Allowed values: created_at, updated_at, name, last_viewed_at, last_shared_at.\n Default (omitted): created_at descending.\n REST: ?sort=last_viewed_at or ?sort=-name", "in": "query", "name": "sort", "schema": { "description": "Sort field and direction. Prefix with `-` for descending order.\n Allowed values: created_at, updated_at, name, last_viewed_at, last_shared_at.\n Default (omitted): created_at descending.\n REST: ?sort=last_viewed_at or ?sort=-name", "title": "sort", "type": "string" } }, { "description": "Full-text search filter. Case-insensitive substring match on document name and description.\n REST: ?query=budget", "in": "query", "name": "query", "schema": { "description": "Full-text search filter. Case-insensitive substring match on document name and description.\n REST: ?query=budget", "title": "query", "type": "string" } }, { "description": "Ownership filter. Returns documents matching the specified ownership state.\n REST: ?ownership=owned or ?ownership=not_owned", "in": "query", "name": "ownership", "schema": { "description": "Ownership filter. Returns documents matching the specified ownership state.\n REST: ?ownership=owned or ?ownership=not_owned", "items": { "$ref": "#/components/schemas/DocumentOwnership" }, "title": "ownership", "type": "array" } }, { "description": "Trash state filter. Returns documents matching the specified trash state.\n REST: ?trash_state=active or ?trash_state=trashed or ?trash_state=active&trash_state=trashed\n Default (omitted): active documents only.", "in": "query", "name": "trash_state", "schema": { "description": "Trash state filter. Returns documents matching the specified trash state.\n REST: ?trash_state=active or ?trash_state=trashed or ?trash_state=active&trash_state=trashed\n Default (omitted): active documents only.", "items": { "$ref": "#/components/schemas/DocumentTrashState" }, "title": "trash_state", "type": "array" } }, { "description": "Organization scope filter. When true, restrict to documents within the user's organization.\n REST: ?organization_scope=true", "in": "query", "name": "organization_scope", "schema": { "description": "Organization scope filter. When true, restrict to documents within the user's organization.\n REST: ?organization_scope=true", "title": "organization_scope", "type": "boolean" } }, { "description": "Case-insensitive substring match on document title.\n REST: ?title_contains=quarterly", "in": "query", "name": "title_contains", "schema": { "description": "Case-insensitive substring match on document title.\n REST: ?title_contains=quarterly", "maxLength": 255, "title": "title_contains", "type": "string" } }, { "description": "Case-insensitive substring match on document description.\n Documents with no description set will not match this filter.\n REST: ?description_contains=financial", "in": "query", "name": "description_contains", "schema": { "description": "Case-insensitive substring match on document description.\n Documents with no description set will not match this filter.\n REST: ?description_contains=financial", "maxLength": 255, "title": "description_contains", "type": "string" } }, { "description": "Filter by source format(s). Returns documents matching ANY of the specified formats.\n Allowed values: pdf, docx, xlsx, csv, markdown.\n REST: ?source_format=pdf or ?source_format=docx&source_format=xlsx", "in": "query", "name": "source_format", "schema": { "description": "Filter by source format(s). Returns documents matching ANY of the specified formats.\n Allowed values: pdf, docx, xlsx, csv, markdown.\n REST: ?source_format=pdf or ?source_format=docx&source_format=xlsx", "items": { "enum": [ "pdf", "docx", "xlsx", "csv", "markdown" ], "type": "string" }, "title": "source_format", "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListDocumentsResponse" } } }, "description": "Success" }, "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" } }, "summary": "List documents", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "listDocuments", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.list({\n pageToken: \"eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0\",\n createdAfter: new Date(\"2023-01-15T01:30:15.01Z\"),\n createdBefore: new Date(\"2023-01-15T01:30:15.01Z\"),\n createdById: [\n \"user_01h2xcejqtf2nbrexx3vqjhp41\",\n ],\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();" }, { "label": "listDocuments", "lang": "python", "source": "from factify import Factify\nfrom factify.utils import parse_datetime\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.list(page_token=\"eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0\", created_after=parse_datetime(\"2023-01-15T01:30:15.01Z\"), created_before=parse_datetime(\"2023-01-15T01:30:15.01Z\"), created_by_id=[\n \"user_01h2xcejqtf2nbrexx3vqjhp41\",\n ])\n\n while res is not None:\n # Handle items\n\n res = res.next()" } ], "x-speakeasy-name-override": "list", "x-speakeasy-pagination": { "inputs": [ { "in": "parameters", "name": "page_token", "type": "cursor" } ], "outputs": { "nextCursor": "$.pagination.next_page_token" }, "type": "cursor" }, "x-speakeasy-usage-example": true }, "post": { "description": "Creates a new document by uploading a PDF file.", "operationId": "createDocument", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/CreateDocumentRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDocumentResponse" } } }, "description": "Success" }, "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" } }, "summary": "Create a document", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "createDocument", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.create({\n payload: await openAsBlob(\"example.file\"),\n title: \"\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "createDocument", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.create(payload={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n }, title=\"\")\n\n assert res.create_document_response is not None\n\n # Handle response\n print(res.create_document_response)" } ], "x-speakeasy-name-override": "create" } }, "/v1beta/documents/quota": { "get": { "description": "Returns the document quota status for the authenticated user's organization, including the number of documents used, the configured limit, and remaining capacity.", "operationId": "getDocumentQuota", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDocumentQuotaResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get document quota", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "getDocumentQuota", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.getQuota();\n\n console.log(result);\n}\n\nrun();" }, { "label": "getDocumentQuota", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.get_quota()\n\n assert res.get_document_quota_response is not None\n\n # Handle response\n print(res.get_document_quota_response)" } ], "x-speakeasy-name-override": "getQuota" } }, "/v1beta/documents/{document_id}": { "get": { "description": "Retrieve a document by ID.", "operationId": "getDocument", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDocumentResponse" } } }, "description": "Success" }, "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" } }, "summary": "Retrieve a document", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "getDocument", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.get({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getDocument", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.get(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.get_document_response is not None\n\n # Handle response\n print(res.get_document_response)" } ], "x-speakeasy-name-override": "get" }, "patch": { "description": "Update document title and description.", "operationId": "updateDocument", "parameters": [ { "description": "Document ID to update.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID to update.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "UpdateDocumentRequest specifies fields to update on a document.", "properties": { "description": { "description": "New description (max 2000 characters).", "maxLength": 2000, "title": "description", "type": [ "string", "null" ] }, "title": { "description": "New title (1-255 characters).", "maxLength": 255, "minLength": 1, "title": "title", "type": [ "string", "null" ] } }, "title": "UpdateDocumentRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateDocumentResponse" } } }, "description": "Success" }, "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" } }, "summary": "Update a document", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "updateDocument", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.update({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "updateDocument", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.update(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.update_document_response is not None\n\n # Handle response\n print(res.update_document_response)" } ], "x-speakeasy-name-override": "update" } }, "/v1beta/documents/{document_id}/access": { "get": { "description": "Get general access level for a document.", "operationId": "getGeneralAccess", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetGeneralAccessResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get general access", "tags": [ "Sharings" ], "x-codeSamples": [ { "label": "getGeneralAccess", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.sharing.getGeneralAccess({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getGeneralAccess", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.sharing.get_general_access(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.get_general_access_response is not None\n\n # Handle response\n print(res.get_general_access_response)" } ], "x-speakeasy-group": "sharing", "x-speakeasy-name-override": "getGeneralAccess" }, "put": { "description": "Set general access level for a document.", "operationId": "setGeneralAccess", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "SetGeneralAccessRequest sets the general access level.", "properties": { "general_access_level": { "$ref": "#/components/schemas/GeneralAccessLevel", "description": "General access level to set.", "title": "general_access_level" } }, "required": [ "general_access_level" ], "title": "SetGeneralAccessRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetGeneralAccessResponse" } } }, "description": "Success" }, "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" } }, "summary": "Set general access", "tags": [ "Sharings" ], "x-codeSamples": [ { "label": "setGeneralAccess", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.sharing.setGeneralAccess({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {\n generalAccessLevel: \"organization\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "setGeneralAccess", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.sharing.set_general_access(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", general_access_level=\"organization\")\n\n assert res.set_general_access_response is not None\n\n # Handle response\n print(res.set_general_access_response)" } ], "x-speakeasy-group": "sharing", "x-speakeasy-name-override": "setGeneralAccess" } }, "/v1beta/documents/{document_id}/access-requests": { "get": { "description": "Lists pending access requests for the specified document.", "operationId": "listAccessRequests", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListAccessRequestsResponse" } } }, "description": "Success" }, "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" } }, "summary": "List access requests", "tags": [ "Access Requests" ], "x-codeSamples": [ { "label": "listAccessRequests", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.accessRequests.list({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "listAccessRequests", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.access_requests.list(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.list_access_requests_response is not None\n\n # Handle response\n print(res.list_access_requests_response)" } ], "x-speakeasy-group": "accessRequests", "x-speakeasy-name-override": "list" }, "post": { "description": "Creates a new access request for the specified document.", "operationId": "createAccessRequest", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "CreateAccessRequestRequest creates a new access request.", "properties": { "message": { "description": "Optional message from the requester.", "example": "Need access for quarterly review", "maxLength": 1024, "title": "message", "type": [ "string", "null" ] }, "permission": { "$ref": "#/components/schemas/AccessRequestPermission", "description": "Permission level being requested.", "title": "permission" } }, "required": [ "permission" ], "title": "CreateAccessRequestRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAccessRequestResponse" } } }, "description": "Success" }, "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" } }, "summary": "Create an access request", "tags": [ "Access Requests" ], "x-codeSamples": [ { "label": "createAccessRequest", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.accessRequests.create({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {\n message: \"Need access for quarterly review\",\n permission: \"view\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "createAccessRequest", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.access_requests.create(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", permission=\"view\", message=\"Need access for quarterly review\")\n\n assert res.create_access_request_response is not None\n\n # Handle response\n print(res.create_access_request_response)" } ], "x-speakeasy-group": "accessRequests", "x-speakeasy-name-override": "create" } }, "/v1beta/documents/{document_id}/access-requests/status": { "get": { "description": "Returns whether the caller has a pending access request for the document.", "operationId": "checkAccessRequestStatus", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckAccessRequestStatusResponse" } } }, "description": "Success" }, "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" } }, "summary": "Check access request status", "tags": [ "Access Requests" ], "x-codeSamples": [ { "label": "checkAccessRequestStatus", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.accessRequests.checkStatus({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "checkAccessRequestStatus", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.access_requests.check_status(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.check_access_request_status_response is not None\n\n # Handle response\n print(res.check_access_request_status_response)" } ], "x-speakeasy-group": "accessRequests", "x-speakeasy-name-override": "checkStatus" } }, "/v1beta/documents/{document_id}/access-requests/{access_request_id}/approve": { "post": { "description": "Approve an access request.", "operationId": "approveAccessRequest", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Access request ID to approve.", "in": "path", "name": "access_request_id", "required": true, "schema": { "description": "Access request ID to approve.", "example": "acr_01h2xcejqtf2nbrexx3vqjhp42", "pattern": "^acr_[0-9a-hjkmnp-tv-z]{26}$", "title": "access_request_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "ApproveAccessRequestRequest approves an access request.", "properties": {}, "required": [], "title": "ApproveAccessRequestRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApproveAccessRequestResponse" } } }, "description": "Success" }, "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" } }, "summary": "Approve an access request", "tags": [ "Access Requests" ], "x-codeSamples": [ { "label": "approveAccessRequest", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.accessRequests.approve({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n accessRequestId: \"acr_01h2xcejqtf2nbrexx3vqjhp42\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "approveAccessRequest", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.access_requests.approve(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", access_request_id=\"acr_01h2xcejqtf2nbrexx3vqjhp42\", body={})\n\n assert res.approve_access_request_response is not None\n\n # Handle response\n print(res.approve_access_request_response)" } ], "x-speakeasy-group": "accessRequests", "x-speakeasy-name-override": "approve" } }, "/v1beta/documents/{document_id}/access-requests/{access_request_id}/deny": { "post": { "description": "Deny an access request.", "operationId": "denyAccessRequest", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Access request ID to deny.", "in": "path", "name": "access_request_id", "required": true, "schema": { "description": "Access request ID to deny.", "example": "acr_01h2xcejqtf2nbrexx3vqjhp42", "pattern": "^acr_[0-9a-hjkmnp-tv-z]{26}$", "title": "access_request_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "DenyAccessRequestRequest denies an access request.", "properties": {}, "required": [], "title": "DenyAccessRequestRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DenyAccessRequestResponse" } } }, "description": "Success" }, "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" } }, "summary": "Deny an access request", "tags": [ "Access Requests" ], "x-codeSamples": [ { "label": "denyAccessRequest", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.accessRequests.deny({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n accessRequestId: \"acr_01h2xcejqtf2nbrexx3vqjhp42\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "denyAccessRequest", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.access_requests.deny(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", access_request_id=\"acr_01h2xcejqtf2nbrexx3vqjhp42\", body={})\n\n assert res.deny_access_request_response is not None\n\n # Handle response\n print(res.deny_access_request_response)" } ], "x-speakeasy-group": "accessRequests", "x-speakeasy-name-override": "deny" } }, "/v1beta/documents/{document_id}/capabilities": { "get": { "description": "Returns the caller's permissions and any access policies on a document.", "operationId": "inspectDocumentAccess", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InspectAccessResponse" } } }, "description": "Success" }, "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" } }, "summary": "Inspect document access", "tags": [ "Access Requests" ], "x-codeSamples": [ { "label": "inspectDocumentAccess", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.accessRequests.inspect({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "inspectDocumentAccess", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.access_requests.inspect(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.inspect_access_response is not None\n\n # Handle response\n print(res.inspect_access_response)" } ], "x-speakeasy-group": "accessRequests", "x-speakeasy-name-override": "inspect" } }, "/v1beta/documents/{document_id}/duplicates": { "get": { "description": "Finds documents that are visual duplicates of the specified document using perceptual hashing.", "operationId": "listDocumentDuplicates", "parameters": [ { "description": "Document ID to check for duplicates.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID to check for duplicates.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "SHA256 hash of the document's visual content for duplicate matching.", "in": "query", "name": "file_contents_hash", "schema": { "description": "SHA256 hash of the document's visual content for duplicate matching.", "maxLength": 64, "minLength": 64, "title": "file_contents_hash", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListDocumentDuplicatesResponse" } } }, "description": "Success" }, "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" } }, "summary": "List duplicate documents", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "listDocumentDuplicates", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.listDuplicates({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "listDocumentDuplicates", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.list_duplicates(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.list_document_duplicates_response is not None\n\n # Handle response\n print(res.list_document_duplicates_response)" } ], "x-speakeasy-name-override": "listDuplicates" } }, "/v1beta/documents/{document_id}/entry_page": { "post": { "description": "Generate and return a temporary downloadable URL for the document entry page PDF.", "operationId": "generateDocumentEntryPage", "parameters": [ { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateEntryPageResponse" } } }, "description": "Success" }, "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" } }, "summary": "Generate entry page", "tags": [ "Sharing & Distribution" ], "x-codeSamples": [ { "label": "generateDocumentEntryPage", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.entryPages.generate({\n documentId: \"\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "generateDocumentEntryPage", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.entry_pages.generate(document_id=\"\")\n\n assert res.generate_entry_page_response is not None\n\n # Handle response\n print(res.generate_entry_page_response)" } ], "x-speakeasy-group": "entryPages", "x-speakeasy-name-override": "generate" } }, "/v1beta/documents/{document_id}/export": { "get": { "description": "Generates a time-limited download URL for the document PDF.", "operationId": "exportDocument", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Optional version ID. If omitted, exports the current version.", "in": "query", "name": "version_id", "schema": { "description": "Optional version ID. If omitted, exports the current version.", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExportDocumentResponse" } } }, "description": "Success" }, "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" } }, "summary": "Export a document", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "exportDocument", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.export({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n versionId: \"ver_01h2abcd1234efgh5678jkmnpt\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "exportDocument", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.export(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", version_id=\"ver_01h2abcd1234efgh5678jkmnpt\")\n\n assert res.export_document_response is not None\n\n # Handle response\n print(res.export_document_response)" } ], "x-speakeasy-name-override": "export" } }, "/v1beta/documents/{document_id}/policies": { "get": { "description": "List policies attached to a document.", "operationId": "listDocumentPolicies", "parameters": [ { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "in": "query", "name": "page_token", "schema": { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "example": "eyJpZCI6InBvbF8wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0", "title": "page_token", "type": "string" } }, { "description": "Maximum number of items to return per page (1-100). Default: 50.", "in": "query", "name": "page_size", "schema": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListDocumentPoliciesResponse" } } }, "description": "Success" }, "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" } }, "summary": "List document policies", "tags": [ "Policies" ], "x-codeSamples": [ { "label": "listDocumentPolicies", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.policies.list({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n pageToken: \"eyJpZCI6InBvbF8wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0\",\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();" }, { "label": "listDocumentPolicies", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.policies.list(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", page_token=\"eyJpZCI6InBvbF8wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0\")\n\n while res is not None:\n # Handle items\n\n res = res.next()" } ], "x-speakeasy-name-override": "list", "x-speakeasy-pagination": { "inputs": [ { "in": "parameters", "name": "page_token", "type": "cursor" } ], "outputs": { "nextCursor": "$.pagination.next_page_token" }, "type": "cursor" } }, "post": { "description": "Attach a policy to a document.", "operationId": "attachDocumentPolicy", "parameters": [ { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "AttachPolicyRequest specifies a policy to attach to a document.", "properties": { "policy_id": { "description": "Policy ID to attach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}", "example": "pol_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$", "title": "policy_id", "type": "string" } }, "required": [ "policy_id" ], "title": "AttachPolicyRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentPolicy" } } }, "description": "Success" }, "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" } }, "summary": "Attach a policy", "tags": [ "Policies" ], "x-codeSamples": [ { "label": "attachDocumentPolicy", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.policies.attach({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {\n policyId: \"pol_01h2xcejqtf2nbrexx3vqjhp41\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "attachDocumentPolicy", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.policies.attach(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", policy_id=\"pol_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.document_policy is not None\n\n # Handle response\n print(res.document_policy)" } ], "x-speakeasy-name-override": "attach" } }, "/v1beta/documents/{document_id}/policies/{policy_id}": { "delete": { "description": "Detach a policy from a document.", "operationId": "detachDocumentPolicy", "parameters": [ { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Policy ID to detach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "policy_id", "required": true, "schema": { "description": "Policy ID to detach.\n Pattern: pol_[0-9a-hjkmnp-tv-z]{26}", "example": "pol_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^pol_[0-9a-hjkmnp-tv-z]{26}$", "title": "policy_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Empty" } } }, "description": "Success" }, "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" } }, "summary": "Detach a policy", "tags": [ "Policies" ], "x-codeSamples": [ { "label": "detachDocumentPolicy", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.policies.detach({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n policyId: \"pol_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "detachDocumentPolicy", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.policies.detach(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", policy_id=\"pol_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.empty is not None\n\n # Handle response\n print(res.empty)" } ], "x-speakeasy-name-override": "detach" } }, "/v1beta/documents/{document_id}/process": { "post": { "description": "Triggers the AI processing pipeline (extraction and summarization) for the document's current or specified version.", "operationId": "processDocument", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "ProcessDocumentRequest triggers processing for a document version.", "properties": { "async": { "description": "If true, returns immediately without waiting for processing to complete.", "title": "async", "type": "boolean" }, "version_id": { "description": "Optional version ID. If omitted, processes the current version.", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": [ "string", "null" ] } }, "title": "ProcessDocumentRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProcessDocumentResponse" } } }, "description": "Success" }, "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" } }, "summary": "Process a document", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "processDocument", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.process({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {\n versionId: \"ver_01h2abcd1234efgh5678jkmnpt\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "processDocument", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.process(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", version_id=\"ver_01h2abcd1234efgh5678jkmnpt\")\n\n assert res.process_document_response is not None\n\n # Handle response\n print(res.process_document_response)" } ], "x-speakeasy-name-override": "process" } }, "/v1beta/documents/{document_id}/share": { "get": { "description": "List all recipients with access to a document.", "operationId": "listDocumentAccess", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListDocumentAccessResponse" } } }, "description": "Success" }, "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" } }, "summary": "List document access", "tags": [ "Sharings" ], "x-codeSamples": [ { "label": "listDocumentAccess", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.sharing.list({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "listDocumentAccess", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.sharing.list(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.list_document_access_response is not None\n\n # Handle response\n print(res.list_document_access_response)" } ], "x-speakeasy-group": "sharing", "x-speakeasy-name-override": "list" }, "post": { "description": "Grant access to one or more recipients.", "operationId": "grantDocumentAccess", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "GrantDocumentAccessRequest grants access to one or more recipients.", "properties": { "custom_message": { "description": "Custom message to include in the notification email.", "title": "custom_message", "type": [ "string", "null" ] }, "recipients": { "description": "Recipients to grant access to (1-50).", "items": { "$ref": "#/components/schemas/RecipientGrant" }, "maxItems": 50, "minItems": 1, "title": "recipients", "type": "array" }, "should_send_notification": { "description": "Whether to send email notifications.", "title": "should_send_notification", "type": [ "boolean", "null" ] } }, "title": "GrantDocumentAccessRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GrantDocumentAccessResponse" } } }, "description": "Success" }, "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" } }, "summary": "Grant document access", "tags": [ "Sharings" ], "x-codeSamples": [ { "label": "grantDocumentAccess", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.sharing.grant({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "grantDocumentAccess", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.sharing.grant(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.grant_document_access_response is not None\n\n # Handle response\n print(res.grant_document_access_response)" } ], "x-speakeasy-group": "sharing", "x-speakeasy-name-override": "grant" } }, "/v1beta/documents/{document_id}/share-links": { "post": { "description": "Create a share link for a document.", "operationId": "createShareLink", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "CreateShareLinkRequest creates a share link for a document.", "properties": {}, "title": "CreateShareLinkRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateShareLinkResponse" } } }, "description": "Success" }, "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" } }, "summary": "Create share link", "tags": [ "Sharings" ], "x-codeSamples": [ { "label": "createShareLink", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.sharing.createShareLink({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "createShareLink", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.sharing.create_share_link(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", body={})\n\n assert res.create_share_link_response is not None\n\n # Handle response\n print(res.create_share_link_response)" } ], "x-speakeasy-group": "sharing", "x-speakeasy-name-override": "createShareLink" } }, "/v1beta/documents/{document_id}/share/{recipient_id}": { "delete": { "description": "Revoke access from a recipient.", "operationId": "revokeDocumentAccess", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Recipient ID (TypeID: user_xxx or bot_xxx).", "in": "path", "name": "recipient_id", "required": true, "schema": { "description": "Recipient ID (TypeID: user_xxx or bot_xxx).", "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$", "title": "recipient_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevokeDocumentAccessResponse" } } }, "description": "Success" }, "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" } }, "summary": "Revoke document access", "tags": [ "Sharings" ], "x-codeSamples": [ { "label": "revokeDocumentAccess", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.sharing.revoke({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n recipientId: \"user_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "revokeDocumentAccess", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.sharing.revoke(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", recipient_id=\"user_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.revoke_document_access_response is not None\n\n # Handle response\n print(res.revoke_document_access_response)" } ], "x-speakeasy-group": "sharing", "x-speakeasy-name-override": "revoke" }, "patch": { "description": "Update a recipient's role.", "operationId": "updateDocumentAccess", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Recipient ID (TypeID: user_xxx or bot_xxx).", "in": "path", "name": "recipient_id", "required": true, "schema": { "description": "Recipient ID (TypeID: user_xxx or bot_xxx).", "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$", "title": "recipient_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "UpdateDocumentAccessRequest updates a single recipient's role.", "properties": { "document_role": { "$ref": "#/components/schemas/DocumentRole", "description": "New role to assign.", "title": "document_role" } }, "required": [ "document_role" ], "title": "UpdateDocumentAccessRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateDocumentAccessResponse" } } }, "description": "Success" }, "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" } }, "summary": "Update document access", "tags": [ "Sharings" ], "x-codeSamples": [ { "label": "updateDocumentAccess", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.sharing.update({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n recipientId: \"user_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {\n documentRole: \"admin\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "updateDocumentAccess", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.sharing.update(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", recipient_id=\"user_01h2xcejqtf2nbrexx3vqjhp41\", document_role=\"admin\")\n\n assert res.update_document_access_response is not None\n\n # Handle response\n print(res.update_document_access_response)" } ], "x-speakeasy-group": "sharing", "x-speakeasy-name-override": "update" } }, "/v1beta/documents/{document_id}/timeline": { "get": { "description": "Retrieves timeline events for a document. Admins see all events; viewers see only their own.", "operationId": "getDocumentTimeline", "parameters": [ { "in": "path", "name": "document_id", "required": true, "schema": { "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "in": "query", "name": "cursor", "schema": { "title": "cursor", "type": "string" } }, { "in": "query", "name": "page_size", "schema": { "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetTimelineResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get document timeline", "tags": [ "Timelines" ], "x-codeSamples": [ { "label": "getDocumentTimeline", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.timelines.get({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getDocumentTimeline", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.timelines.get(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.get_timeline_response is not None\n\n # Handle response\n print(res.get_timeline_response)" } ], "x-speakeasy-name-override": "get" } }, "/v1beta/documents/{document_id}/transfer": { "post": { "description": "Transfers ownership of a document to another user in the organization.", "operationId": "transferDocumentOwnership", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "TransferDocumentOwnershipRequest specifies the document and new owner.", "properties": { "new_owner_id": { "description": "User ID of the new owner.", "example": "user_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "new_owner_id", "type": "string" } }, "title": "TransferDocumentOwnershipRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TransferDocumentOwnershipResponse" } } }, "description": "Success" }, "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" } }, "summary": "Transfer document ownership", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "transferDocumentOwnership", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.transferOwnership({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {\n newOwnerId: \"user_01h2xcejqtf2nbrexx3vqjhp41\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "transferDocumentOwnership", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.transfer_ownership(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", new_owner_id=\"user_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.transfer_document_ownership_response is not None\n\n # Handle response\n print(res.transfer_document_ownership_response)" } ], "x-speakeasy-name-override": "transferOwnership" } }, "/v1beta/documents/{document_id}/trash": { "post": { "description": "Moves a document to trash and revokes all non-owner access.", "operationId": "trashDocument", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "TrashDocumentRequest identifies the document to trash.", "properties": {}, "title": "TrashDocumentRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrashDocumentResponse" } } }, "description": "Success" }, "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" } }, "summary": "Trash a document", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "trashDocument", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.trash({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "trashDocument", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.trash(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", body={})\n\n assert res.trash_document_response is not None\n\n # Handle response\n print(res.trash_document_response)" } ], "x-speakeasy-name-override": "trash" } }, "/v1beta/documents/{document_id}/untrash": { "post": { "description": "Restores a document from trash. Previous sharing and access permissions are NOT restored.", "operationId": "untrashDocument", "parameters": [ { "description": "Document ID.", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID.", "example": "doc_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "UntrashDocumentRequest identifies the document to restore.", "properties": {}, "title": "UntrashDocumentRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UntrashDocumentResponse" } } }, "description": "Success" }, "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" } }, "summary": "Restore a document from trash", "tags": [ "Documents" ], "x-codeSamples": [ { "label": "untrashDocument", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.documents.untrash({\n documentId: \"doc_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "untrashDocument", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.documents.untrash(document_id=\"doc_01h2xcejqtf2nbrexx3vqjhp41\", body={})\n\n assert res.untrash_document_response is not None\n\n # Handle response\n print(res.untrash_document_response)" } ], "x-speakeasy-name-override": "untrash" } }, "/v1beta/documents/{document_id}/versions": { "get": { "description": "List versions for a document with cursor-based pagination.", "operationId": "listDocumentVersions", "parameters": [ { "description": "Document ID to list versions for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID to list versions for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } }, { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "in": "query", "name": "page_token", "schema": { "description": "Opaque pagination token from a previous response.\n Pass next_page_token or prev_page_token from a previous response to continue pagination.\n Empty or omitted for the first page.", "example": "eyJpZCI6InZlcl8wMWgyYWJjZDEyMzRlZmdoNTY3OGprbW5wdCIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0", "title": "page_token", "type": "string" } }, { "description": "Maximum number of items to return per page (1-100). Default: 50.", "in": "query", "name": "page_size", "schema": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListVersionsResponse" } } }, "description": "Success" }, "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" } }, "summary": "List document versions", "tags": [ "Versions" ], "x-codeSamples": [ { "label": "listDocumentVersions", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.versions.list({\n documentId: \"\",\n pageToken: \"eyJpZCI6InZlcl8wMWgyYWJjZDEyMzRlZmdoNTY3OGprbW5wdCIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0\",\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();" }, { "label": "listDocumentVersions", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.versions.list(document_id=\"\", page_token=\"eyJpZCI6InZlcl8wMWgyYWJjZDEyMzRlZmdoNTY3OGprbW5wdCIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0\")\n\n while res is not None:\n # Handle items\n\n res = res.next()" } ], "x-speakeasy-name-override": "list", "x-speakeasy-pagination": { "inputs": [ { "in": "parameters", "name": "page_token", "type": "cursor" } ], "outputs": { "nextCursor": "$.pagination.next_page_token" }, "type": "cursor" } }, "post": { "description": "Creates a new version by uploading a PDF file.", "operationId": "createDocumentVersion", "parameters": [ { "description": "Document ID to create version for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "document_id", "required": true, "schema": { "description": "Document ID to create version for.\n Pattern: doc_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^doc_[0-9a-hjkmnp-tv-z]{26}$", "title": "document_id", "type": "string" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/CreateVersionRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Version" } } }, "description": "Success" }, "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" } }, "summary": "Create a new version", "tags": [ "Versions" ], "x-codeSamples": [ { "label": "createDocumentVersion", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\nimport { openAsBlob } from \"node:fs\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.versions.create({\n documentId: \"\",\n body: {\n payload: await openAsBlob(\"example.file\"),\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "createDocumentVersion", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.versions.create(document_id=\"\", payload={\n \"file_name\": \"example.file\",\n \"content\": open(\"example.file\", \"rb\"),\n })\n\n assert res.version is not None\n\n # Handle response\n print(res.version)" } ], "x-speakeasy-name-override": "create" } }, "/v1beta/me": { "get": { "description": "Returns the authenticated user's profile and organization memberships. Only available for user accounts (JWT auth), not API keys.", "operationId": "getMe", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetMeResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get current user", "tags": [ "Users" ], "x-codeSamples": [ { "label": "getMe", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.users.getMe();\n\n console.log(result);\n}\n\nrun();" }, { "label": "getMe", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.users.get_me()\n\n assert res.get_me_response is not None\n\n # Handle response\n print(res.get_me_response)" } ], "x-speakeasy-name-override": "getMe" } }, "/v1beta/organizations": { "get": { "description": "List organizations the caller has access to.", "operationId": "listOrganizations", "parameters": [ { "description": "Opaque pagination token from a previous response.", "in": "query", "name": "page_token", "schema": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" } }, { "description": "Maximum number of items to return per page (1-100). Default: 50.", "in": "query", "name": "page_size", "schema": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } }, { "description": "Filter by the caller's role in the organization.\n If omitted or empty, returns all organizations the caller can view (no filtering).\n REST: ?role=admin or ?role=admin&role=owner", "in": "query", "name": "role", "schema": { "description": "Filter by the caller's role in the organization.\n If omitted or empty, returns all organizations the caller can view (no filtering).\n REST: ?role=admin or ?role=admin&role=owner", "items": { "$ref": "#/components/schemas/OrganizationRole" }, "title": "role", "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListOrganizationsResponse" } } }, "description": "Success" }, "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" } }, "summary": "List organizations", "tags": [ "Organizations" ], "x-codeSamples": [ { "label": "listOrganizations", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.list();\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();" }, { "label": "listOrganizations", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.list()\n\n while res is not None:\n # Handle items\n\n res = res.next()" } ], "x-speakeasy-name-override": "list", "x-speakeasy-pagination": { "inputs": [ { "in": "parameters", "name": "page_token", "type": "cursor" } ], "outputs": { "nextCursor": "$.pagination.next_page_token" }, "type": "cursor" } }, "post": { "description": "Creates a new organization. The authenticated user becomes the organization owner.", "operationId": "createOrganization", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrganizationRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrganizationResponse" } } }, "description": "Success" }, "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" } }, "summary": "Create an organization", "tags": [ "Organizations" ], "x-internal": true, "x-speakeasy-ignore": true, "x-speakeasy-name-override": "create" } }, "/v1beta/organizations/{organization_id}": { "get": { "description": "Retrieve an organization by ID.", "operationId": "getOrganization", "parameters": [ { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetOrganizationResponse" } } }, "description": "Success" }, "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" } }, "summary": "Retrieve an organization", "tags": [ "Organizations" ], "x-codeSamples": [ { "label": "getOrganization", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.get({\n organizationId: \"\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getOrganization", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.get(organization_id=\"\")\n\n assert res.get_organization_response is not None\n\n # Handle response\n print(res.get_organization_response)" } ], "x-speakeasy-name-override": "get" }, "patch": { "description": "Update an organization's display name.\n Authorization: Requires organization#administer permission (owner or admin).", "operationId": "updateOrganization", "parameters": [ { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "UpdateOrganizationRequest contains the fields to update on an organization.", "properties": { "logo_image_url": { "description": "Optional logo image URL. nil = no change. Pass the URL returned by UploadOrganizationLogo.", "format": "uri", "maxLength": 1024, "title": "logo_image_url", "type": [ "string", "null" ] }, "name": { "description": "Optional new display name. nil = no change. Minimum 1 character.", "minLength": 1, "title": "name", "type": [ "string", "null" ] } }, "required": [], "title": "UpdateOrganizationRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateOrganizationResponse" } } }, "description": "Success" }, "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" } }, "summary": "Update an organization", "tags": [ "Organizations" ], "x-codeSamples": [ { "label": "updateOrganization", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.update({\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "updateOrganization", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.update(organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.update_organization_response is not None\n\n # Handle response\n print(res.update_organization_response)" } ], "x-speakeasy-name-override": "update" } }, "/v1beta/organizations/{organization_id}/invites": { "get": { "description": "List invitations for an organization. Requires permission to invite organization members.", "operationId": "listOrganizationInvites", "parameters": [ { "description": "Organization to list invitations for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization to list invitations for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "Filter by invitation status.\n If empty, returns all invitations.\n REST: ?status=pending or ?status=pending&status=expired", "in": "query", "name": "status", "schema": { "description": "Filter by invitation status.\n If empty, returns all invitations.\n REST: ?status=pending or ?status=pending&status=expired", "items": { "$ref": "#/components/schemas/OrganizationInviteStatus" }, "title": "status", "type": "array" } }, { "description": "Opaque pagination token from a previous response.", "in": "query", "name": "page_token", "schema": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" } }, { "description": "Maximum number of items to return per page (1-100). Default: 50.", "in": "query", "name": "page_size", "schema": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } }, { "description": "Case-insensitive substring match.\n REST: ?field.contains=value", "in": "query", "name": "email.contains", "schema": { "description": "Case-insensitive substring match.\n REST: ?field.contains=value", "title": "contains", "type": "string" } }, { "description": "Exact match (case-sensitive).\n REST: ?field.exact=value", "in": "query", "name": "email.exact", "schema": { "description": "Exact match (case-sensitive).\n REST: ?field.exact=value", "title": "exact", "type": "string" } }, { "description": "Filter by sender. Only returns invitations sent by this user.\n REST: ?sender_id=user_01h2xcejqtf2nbrexx3vqjhp41\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "in": "query", "name": "sender_id", "schema": { "description": "Filter by sender. Only returns invitations sent by this user.\n REST: ?sender_id=user_01h2xcejqtf2nbrexx3vqjhp41\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "sender_id", "type": "string" } }, { "description": "Return results after this timestamp (inclusive).", "in": "query", "name": "created.after", "schema": { "description": "A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n ) to obtain a formatter capable of generating timestamps in this format.", "example": "2023-01-15T01:30:15.01Z", "format": "date-time", "type": "string" } }, { "description": "Return results before this timestamp (inclusive).", "in": "query", "name": "created.before", "schema": { "description": "A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n ) to obtain a formatter capable of generating timestamps in this format.", "example": "2023-01-15T01:30:15.01Z", "format": "date-time", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListOrganizationInvitesResponse" } } }, "description": "Success" }, "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" } }, "summary": "List organization invitations", "tags": [ "Invites" ], "x-codeSamples": [ { "label": "listOrganizationInvites", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.invites.list({\n organizationId: \"\",\n createdAfter: new Date(\"2023-01-15T01:30:15.01Z\"),\n createdBefore: new Date(\"2023-01-15T01:30:15.01Z\"),\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();" }, { "label": "listOrganizationInvites", "lang": "python", "source": "from factify import Factify\nfrom factify.utils import parse_datetime\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.invites.list(organization_id=\"\", created_after=parse_datetime(\"2023-01-15T01:30:15.01Z\"), created_before=parse_datetime(\"2023-01-15T01:30:15.01Z\"))\n\n while res is not None:\n # Handle items\n\n res = res.next()" } ], "x-speakeasy-group": "organizations.invites", "x-speakeasy-name-override": "list", "x-speakeasy-pagination": { "inputs": [ { "in": "parameters", "name": "page_token", "type": "cursor" } ], "outputs": { "nextCursor": "$.pagination.next_page_token" }, "type": "cursor" } }, "post": { "description": "Creates an invitation and sends an email to the specified address. Returns FAILED_PRECONDITION if the email belongs to an existing organization member. Idempotency: If a PENDING invitation already exists for this email, the existing invitation is resent with a new token and refreshed expiration. Expired or revoked invitations are ignored - a new invitation is created.", "operationId": "createOrganizationInvite", "parameters": [ { "description": "Organization to invite the user to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization to invite the user to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "CreateOrganizationInviteRequest contains the data needed to create an invitation.", "properties": { "email": { "description": "Email address of the recipient.", "format": "email", "title": "email", "type": "string" }, "idempotency_key": { "description": "Reserved for future use. Currently, idempotency is based on email matching:\n if a PENDING invitation exists for the same email in this organization,\n that invitation is resent rather than creating a duplicate.", "maxLength": 255, "title": "idempotency_key", "type": [ "string", "null" ] }, "message": { "description": "Optional custom message from the sender (max 2000 bytes to support ~500 multibyte characters).", "maxLength": 2000, "title": "message", "type": [ "string", "null" ] } }, "required": [ "email" ], "title": "CreateOrganizationInviteRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrganizationInviteResponse" } } }, "description": "Success" }, "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" } }, "summary": "Invite a user to join an organization", "tags": [ "Invites" ], "x-codeSamples": [ { "label": "createOrganizationInvite", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.invites.create({\n organizationId: \"\",\n body: {\n email: \"Willie_Parisian16@hotmail.com\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "createOrganizationInvite", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.invites.create(organization_id=\"\", email=\"Willie_Parisian16@hotmail.com\")\n\n assert res.create_organization_invite_response is not None\n\n # Handle response\n print(res.create_organization_invite_response)" } ], "x-speakeasy-group": "organizations.invites", "x-speakeasy-name-override": "create" } }, "/v1beta/organizations/{organization_id}/invites/accept": { "post": { "description": "Accepts the invitation and adds the authenticated user as a member of the organization. The authenticated user's verified email must match the invitation email (case-insensitive). Returns PERMISSION_DENIED if emails don't match, FAILED_PRECONDITION if the user is already a member, or NOT_FOUND if the invitation is invalid/expired.", "operationId": "acceptOrganizationInvite", "parameters": [ { "description": "Organization the invitation belongs to (for validation).\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization the invitation belongs to (for validation).\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "AcceptOrganizationInviteRequest contains the token to accept an invitation.", "properties": { "token": { "description": "The invitation token from the email link.", "maxLength": 128, "title": "token", "type": "string" } }, "required": [ "token" ], "title": "AcceptOrganizationInviteRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AcceptOrganizationInviteResponse" } } }, "description": "Success" }, "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" } }, "summary": "Accept an invitation", "tags": [ "Invites" ], "x-codeSamples": [ { "label": "acceptOrganizationInvite", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.invites.accept({\n organizationId: \"\",\n body: {\n token: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "acceptOrganizationInvite", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.invites.accept(organization_id=\"\", token=\"\")\n\n assert res.accept_organization_invite_response is not None\n\n # Handle response\n print(res.accept_organization_invite_response)" } ], "x-speakeasy-group": "organizations.invites", "x-speakeasy-name-override": "accept" } }, "/v1beta/organizations/{organization_id}/invites/{invite_id}/resend": { "post": { "description": "Resend an invitation email to the recipient. Useful if the original email was lost or expired. Requires permission to invite organization members.", "operationId": "resendOrganizationInvite", "parameters": [ { "description": "Organization the invitation belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization the invitation belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "Invitation ID to resend.\n Pattern: inv_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "invite_id", "required": true, "schema": { "description": "Invitation ID to resend.\n Pattern: inv_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^inv_[0-9a-hjkmnp-tv-z]{26}$", "title": "invite_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "ResendOrganizationInviteRequest identifies an invitation to resend.", "properties": {}, "required": [], "title": "ResendOrganizationInviteRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResendOrganizationInviteResponse" } } }, "description": "Success" }, "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" } }, "summary": "Resend an invitation email", "tags": [ "Invites" ], "x-codeSamples": [ { "label": "resendOrganizationInvite", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.invites.resend({\n organizationId: \"\",\n inviteId: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "resendOrganizationInvite", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.invites.resend(organization_id=\"\", invite_id=\"\", body={})\n\n assert res.resend_organization_invite_response is not None\n\n # Handle response\n print(res.resend_organization_invite_response)" } ], "x-speakeasy-group": "organizations.invites", "x-speakeasy-name-override": "resend" } }, "/v1beta/organizations/{organization_id}/invites/{invite_id}/revoke": { "post": { "description": "Revoke a pending invitation, preventing the recipient from joining. Requires permission to manage organization members.", "operationId": "revokeOrganizationInvite", "parameters": [ { "description": "Organization the invitation belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization the invitation belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "Invitation ID to revoke.\n Pattern: inv_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "invite_id", "required": true, "schema": { "description": "Invitation ID to revoke.\n Pattern: inv_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^inv_[0-9a-hjkmnp-tv-z]{26}$", "title": "invite_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "RevokeOrganizationInviteRequest identifies an invitation to revoke.", "properties": {}, "required": [], "title": "RevokeOrganizationInviteRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevokeOrganizationInviteResponse" } } }, "description": "Success" }, "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" } }, "summary": "Revoke an invitation", "tags": [ "Invites" ], "x-codeSamples": [ { "label": "revokeOrganizationInvite", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.invites.revoke({\n organizationId: \"\",\n inviteId: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "revokeOrganizationInvite", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.invites.revoke(organization_id=\"\", invite_id=\"\", body={})\n\n assert res.revoke_organization_invite_response is not None\n\n # Handle response\n print(res.revoke_organization_invite_response)" } ], "x-speakeasy-group": "organizations.invites", "x-speakeasy-name-override": "revoke" } }, "/v1beta/organizations/{organization_id}/logo": { "post": { "description": "Uploads a logo image for an organization. Accepts JPEG, PNG, WebP, or SVG formats up to 2 MB.", "operationId": "uploadOrganizationLogo", "parameters": [ { "description": "Organization ID.", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization ID.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "UploadOrganizationLogoRequest contains the logo image to upload.", "properties": { "content_type": { "description": "Informational content type. The server detects format from magic bytes.", "title": "content_type", "type": "string" }, "image_data": { "description": "Raw image bytes. Maximum 2 MB. Accepted formats: JPEG, PNG, WebP, SVG.", "format": "byte", "maxLength": 2097152, "minLength": 1, "title": "image_data", "type": "string" } }, "required": [], "title": "UploadOrganizationLogoRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UploadOrganizationLogoResponse" } } }, "description": "Success" }, "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" } }, "summary": "Upload organization logo", "tags": [ "Organizations" ], "x-codeSamples": [ { "label": "uploadOrganizationLogo", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.logo.upload({\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "uploadOrganizationLogo", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.logo.upload(organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.upload_organization_logo_response is not None\n\n # Handle response\n print(res.upload_organization_logo_response)" } ], "x-speakeasy-group": "organizations.logo", "x-speakeasy-name-override": "upload" } }, "/v1beta/organizations/{organization_id}/members": { "get": { "description": "List members of an organization. Requires organization membership.", "operationId": "listOrganizationMembers", "parameters": [ { "description": "Organization to list members for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization to list members for.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "Opaque pagination token from a previous response.", "in": "query", "name": "page_token", "schema": { "description": "Opaque pagination token from a previous response.", "title": "page_token", "type": "string" } }, { "description": "Maximum number of items to return per page (1-100). Default: 50.", "in": "query", "name": "page_size", "schema": { "description": "Maximum number of items to return per page (1-100). Default: 50.", "format": "int32", "maximum": 100, "minimum": 1, "title": "page_size", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListOrganizationMembersResponse" } } }, "description": "Success" }, "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" } }, "summary": "List organization members", "tags": [ "Members" ], "x-codeSamples": [ { "label": "listOrganizationMembers", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.members.list({\n organizationId: \"\",\n });\n\n for await (const page of result) {\n console.log(page);\n }\n}\n\nrun();" }, { "label": "listOrganizationMembers", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.members.list(organization_id=\"\")\n\n while res is not None:\n # Handle items\n\n res = res.next()" } ], "x-speakeasy-group": "organizations.members", "x-speakeasy-name-override": "list", "x-speakeasy-pagination": { "inputs": [ { "in": "parameters", "name": "page_token", "type": "cursor" } ], "outputs": { "nextCursor": "$.pagination.next_page_token" }, "type": "cursor" } }, "post": { "description": "Directly adds a user as a member of an organization. Requires manage permission (owner or admin).", "operationId": "addOrganizationMember", "parameters": [ { "description": "Organization to add the member to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization to add the member to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "AddOrganizationMemberRequest identifies a user to add as a member.", "properties": { "role": { "$ref": "#/components/schemas/OrganizationRole", "description": "Role for the new member. Cannot be UNSPECIFIED or OWNER.", "title": "role" }, "user_id": { "description": "User account ID of the member to add.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "user_id", "type": "string" } }, "required": [ "user_id", "role" ], "title": "AddOrganizationMemberRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddOrganizationMemberResponse" } } }, "description": "Success" }, "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" } }, "summary": "Add a member to an organization", "tags": [ "Members" ], "x-codeSamples": [ { "label": "addOrganizationMember", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.members.add({\n organizationId: \"\",\n body: {\n role: \"member\",\n userId: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "addOrganizationMember", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.members.add(organization_id=\"\", role=\"member\", user_id=\"\")\n\n assert res.add_organization_member_response is not None\n\n # Handle response\n print(res.add_organization_member_response)" } ], "x-speakeasy-group": "organizations.members", "x-speakeasy-name-override": "add" } }, "/v1beta/organizations/{organization_id}/members/{user_id}": { "delete": { "description": "Remove a member from an organization. Requires manage permission, or the member can remove themselves. The organization owner cannot be removed.", "operationId": "removeOrganizationMember", "parameters": [ { "description": "Organization to remove the member from.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization to remove the member from.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "User account ID of the member to remove.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "user_id", "required": true, "schema": { "description": "User account ID of the member to remove.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "user_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RemoveOrganizationMemberResponse" } } }, "description": "Success" }, "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" } }, "summary": "Remove an organization member", "tags": [ "Members" ], "x-codeSamples": [ { "label": "removeOrganizationMember", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.members.remove({\n organizationId: \"\",\n userId: \"\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "removeOrganizationMember", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.members.remove(organization_id=\"\", user_id=\"\")\n\n assert res.remove_organization_member_response is not None\n\n # Handle response\n print(res.remove_organization_member_response)" } ], "x-speakeasy-group": "organizations.members", "x-speakeasy-name-override": "remove" }, "patch": { "description": "Update a member's role within an organization. Requires manage permission (owner or admin). The organization owner's role cannot be changed.", "operationId": "updateOrganizationMember", "parameters": [ { "description": "Organization the member belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization the member belongs to.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "User account ID of the member to update.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "user_id", "required": true, "schema": { "description": "User account ID of the member to update.\n Pattern: user_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^user_[0-9a-hjkmnp-tv-z]{26}$", "title": "user_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "UpdateOrganizationMemberRequest identifies a member and the new role.", "properties": { "role": { "$ref": "#/components/schemas/OrganizationRole", "description": "New role for the member. Cannot be UNSPECIFIED or OWNER.\n OWNER transfer is not supported — the owner is set at organization creation.", "title": "role" } }, "required": [ "role" ], "title": "UpdateOrganizationMemberRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateOrganizationMemberResponse" } } }, "description": "Success" }, "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" } }, "summary": "Update an organization member", "tags": [ "Members" ], "x-codeSamples": [ { "label": "updateOrganizationMember", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.members.update({\n organizationId: \"\",\n userId: \"\",\n body: {\n role: \"member\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "updateOrganizationMember", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.members.update(organization_id=\"\", user_id=\"\", role=\"member\")\n\n assert res.update_organization_member_response is not None\n\n # Handle response\n print(res.update_organization_member_response)" } ], "x-speakeasy-group": "organizations.members", "x-speakeasy-name-override": "update" } }, "/v1beta/organizations/{organization_id}/public-profile": { "get": { "description": "Returns the public-facing profile of an organization. This endpoint does not require authentication.", "operationId": "getOrganizationPublicProfile", "parameters": [ { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "organization_id", "required": true, "schema": { "description": "Organization ID.\n Pattern: org_[0-9a-hjkmnp-tv-z]{26}", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetOrganizationPublicProfileResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get an organization's public profile", "tags": [ "Organizations" ], "x-codeSamples": [ { "label": "getOrganizationPublicProfile", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.organizations.getPublicProfile({\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getOrganizationPublicProfile", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.organizations.get_public_profile(organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.get_organization_public_profile_response is not None\n\n # Handle response\n print(res.get_organization_public_profile_response)" } ], "x-speakeasy-name-override": "getPublicProfile" } }, "/v1beta/quota": { "get": { "description": "Returns the current quota status for an organization including usage, limits, tier, and reset date.", "operationId": "getOrganizationQuota", "parameters": [ { "description": "Optional: organization ID to query. If not provided, uses the caller's organization.\n Only admins can query other organizations.", "in": "query", "name": "organization_id", "schema": { "description": "Optional: organization ID to query. If not provided, uses the caller's organization.\n Only admins can query other organizations.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetOrganizationQuotaResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get organization quota status", "tags": [ "Usage" ], "x-codeSamples": [ { "label": "getOrganizationQuota", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.usage.get({\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getOrganizationQuota", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.usage.get(organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.get_organization_quota_response is not None\n\n # Handle response\n print(res.get_organization_quota_response)" } ], "x-speakeasy-name-override": "get" } }, "/v1beta/quota/keys": { "get": { "description": "Returns all per-key quota configurations and current usage for an organization.", "operationId": "listAPIKeyQuotas", "parameters": [ { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "in": "query", "name": "organization_id", "schema": { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListAPIKeyQuotasResponse" } } }, "description": "Success" }, "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" } }, "summary": "List API key quotas", "tags": [ "Usage" ], "x-codeSamples": [ { "label": "listAPIKeyQuotas", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.usage.listKeyQuotas({\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "listAPIKeyQuotas", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.usage.list_key_quotas(organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.list_api_key_quotas_response is not None\n\n # Handle response\n print(res.list_api_key_quotas_response)" } ], "x-speakeasy-name-override": "listKeyQuotas" } }, "/v1beta/quota/keys/{api_key_id}": { "delete": { "description": "Removes the per-key quota limit. The key will only be subject to the organization-level quota.", "operationId": "deleteAPIKeyQuota", "parameters": [ { "description": "The API key ID (required).", "in": "path", "name": "api_key_id", "required": true, "schema": { "description": "The API key ID (required).", "minLength": 1, "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "api_key_id", "type": "string" } }, { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "in": "query", "name": "organization_id", "schema": { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteAPIKeyQuotaResponse" } } }, "description": "Success" }, "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" } }, "summary": "Delete API key quota", "tags": [ "Usage" ], "x-codeSamples": [ { "label": "deleteAPIKeyQuota", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.usage.deleteKeyQuota({\n apiKeyId: \"\",\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "deleteAPIKeyQuota", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.usage.delete_key_quota(api_key_id=\"\", organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.delete_api_key_quota_response is not None\n\n # Handle response\n print(res.delete_api_key_quota_response)" } ], "x-speakeasy-name-override": "deleteKeyQuota" }, "put": { "description": "Creates or updates a per-key quota limit. The key will be enforced independently of the organization quota.", "operationId": "setAPIKeyQuota", "parameters": [ { "description": "The API key ID (required).", "in": "path", "name": "api_key_id", "required": true, "schema": { "description": "The API key ID (required).", "minLength": 1, "pattern": "^key_[0-9a-hjkmnp-tv-z]{26}$", "title": "api_key_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "SetAPIKeyQuotaRequest creates or updates a per-key quota.", "properties": { "limit": { "description": "The limit for this key. Must be > 0.", "exclusiveMinimum": 0, "format": "int32", "title": "limit", "type": [ "integer", "null" ] }, "organization_id": { "description": "Optional: organization ID. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": [ "string", "null" ] } }, "title": "SetAPIKeyQuotaRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetAPIKeyQuotaResponse" } } }, "description": "Success" }, "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" } }, "summary": "Set API key quota", "tags": [ "Usage" ], "x-codeSamples": [ { "label": "setAPIKeyQuota", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.usage.setKeyQuota({\n apiKeyId: \"\",\n body: {\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n },\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "setAPIKeyQuota", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.usage.set_key_quota(api_key_id=\"\", organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\")\n\n assert res.set_api_key_quota_response is not None\n\n # Handle response\n print(res.set_api_key_quota_response)" } ], "x-speakeasy-name-override": "setKeyQuota" } }, "/v1beta/quota/usage": { "get": { "description": "Returns daily usage records for an organization within a specified date range.", "operationId": "getUsageHistory", "parameters": [ { "description": "Optional: organization ID to query. If not provided, uses the caller's organization.", "in": "query", "name": "organization_id", "schema": { "description": "Optional: organization ID to query. If not provided, uses the caller's organization.", "example": "org_01h2xcejqtf2nbrexx3vqjhp41", "pattern": "^org_[0-9a-hjkmnp-tv-z]{26}$", "title": "organization_id", "type": "string" } }, { "description": "Return results after this timestamp (inclusive).", "in": "query", "name": "date.after", "schema": { "description": "A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n ) to obtain a formatter capable of generating timestamps in this format.", "example": "2023-01-15T01:30:15.01Z", "format": "date-time", "type": "string" } }, { "description": "Return results before this timestamp (inclusive).", "in": "query", "name": "date.before", "schema": { "description": "A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()\n ) to obtain a formatter capable of generating timestamps in this format.", "example": "2023-01-15T01:30:15.01Z", "format": "date-time", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageHistoryResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get usage history", "tags": [ "Usage" ], "x-codeSamples": [ { "label": "getUsageHistory", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.usage.getHistory({\n organizationId: \"org_01h2xcejqtf2nbrexx3vqjhp41\",\n dateAfter: new Date(\"2023-01-15T01:30:15.01Z\"),\n dateBefore: new Date(\"2023-01-15T01:30:15.01Z\"),\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getUsageHistory", "lang": "python", "source": "from factify import Factify\nfrom factify.utils import parse_datetime\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.usage.get_history(organization_id=\"org_01h2xcejqtf2nbrexx3vqjhp41\", date_after=parse_datetime(\"2023-01-15T01:30:15.01Z\"), date_before=parse_datetime(\"2023-01-15T01:30:15.01Z\"))\n\n assert res.get_usage_history_response is not None\n\n # Handle response\n print(res.get_usage_history_response)" } ], "x-speakeasy-name-override": "getHistory" } }, "/v1beta/user-preferences": { "get": { "description": "Returns the authenticated user's onboarding preferences. Only available for user accounts, not API keys.", "operationId": "getUserPreferences", "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUserPreferencesResponse" } } }, "description": "Success" }, "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" } }, "summary": "Get user preferences", "tags": [ "User Preferences" ], "x-codeSamples": [ { "label": "getUserPreferences", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.users.preferences.get();\n\n console.log(result);\n}\n\nrun();" }, { "label": "getUserPreferences", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.users.preferences.get()\n\n assert res.get_user_preferences_response is not None\n\n # Handle response\n print(res.get_user_preferences_response)" } ], "x-speakeasy-group": "users.preferences", "x-speakeasy-name-override": "get" } }, "/v1beta/versions/{version_id}": { "get": { "description": "Retrieve a specific version by ID.", "operationId": "getVersion", "parameters": [ { "description": "Version ID to retrieve.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "version_id", "required": true, "schema": { "description": "Version ID to retrieve.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Version" } } }, "description": "Success" }, "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" } }, "summary": "Retrieve a version", "tags": [ "Versions" ], "x-codeSamples": [ { "label": "getVersion", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.versions.get({\n versionId: \"\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getVersion", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.versions.get(version_id=\"\")\n\n assert res.version is not None\n\n # Handle response\n print(res.version)" } ], "x-speakeasy-name-override": "get" }, "patch": { "description": "Update version title and description.", "operationId": "updateVersion", "parameters": [ { "description": "Version ID to update.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "version_id", "required": true, "schema": { "description": "Version ID to update.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": false, "description": "UpdateVersionRequest specifies fields to update on a version.", "properties": { "description": { "description": "New description.", "title": "description", "type": [ "string", "null" ] }, "title": { "description": "New title (max 255 characters).", "maxLength": 255, "title": "title", "type": [ "string", "null" ] } }, "title": "UpdateVersionRequest", "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Version" } } }, "description": "Success" }, "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" } }, "summary": "Update a version", "tags": [ "Versions" ], "x-codeSamples": [ { "label": "updateVersion", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.versions.update({\n versionId: \"\",\n body: {},\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "updateVersion", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.versions.update(version_id=\"\")\n\n assert res.version is not None\n\n # Handle response\n print(res.version)" } ], "x-speakeasy-name-override": "update" } }, "/v1beta/versions/{version_id}/record": { "get": { "description": "Retrieves the processed content record for a given version. The content oneof is populated based on source_format: document formats (pdf, docx, markdown) populate the document field; spreadsheet formats (xlsx, csv) populate the spreadsheet field.", "operationId": "getVersionRecord", "parameters": [ { "description": "Version ID to retrieve the record for.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "in": "path", "name": "version_id", "required": true, "schema": { "description": "Version ID to retrieve the record for.\n Pattern: ver_[0-9a-hjkmnp-tv-z]{26}", "example": "ver_01h2abcd1234efgh5678jkmnpt", "pattern": "^ver_[0-9a-hjkmnp-tv-z]{26}$", "title": "version_id", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetRecordResponse" } } }, "description": "Success" }, "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" } }, "summary": "Retrieve a record", "tags": [ "Versions" ], "x-codeSamples": [ { "label": "getVersionRecord", "lang": "typescript", "source": "import { Factify } from \"@factify/sdk\";\n\nconst factify = new Factify({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await factify.versions.getRecord({\n versionId: \"ver_01h2abcd1234efgh5678jkmnpt\",\n });\n\n console.log(result);\n}\n\nrun();" }, { "label": "getVersionRecord", "lang": "python", "source": "from factify import Factify\n\n\nwith Factify(\n bearer_auth=\"\",\n) as f_client:\n\n res = f_client.versions.get_record(version_id=\"ver_01h2abcd1234efgh5678jkmnpt\")\n\n assert res.get_record_response is not None\n\n # Handle response\n print(res.get_record_response)" } ], "x-speakeasy-name-override": "getRecord" } } }, "security": [ { "bearerAuth": [] } ], "servers": [ { "description": "Production", "url": "https://api.factify.com" }, { "description": "Development (internal only)", "url": "https://api.factify-dev.com" } ], "tags": [ { "description": "Create and manage legally-binding documents.", "name": "Documents" }, { "description": "Document version tracking and management.", "name": "Versions" }, { "description": "Retrieve processed document content records.", "name": "Records" }, { "description": "Create and manage organizations.", "name": "Organizations" }, { "description": "Generate and manage API keys for authentication.", "name": "API Keys" }, { "description": "Query API usage and quota information for your organization.", "name": "Usage" }, { "description": "Attach and manage access policies for documents.", "name": "Policies" }, { "description": "Generate shareable entry pages for documents.", "name": "Sharing & Distribution" }, { "description": "User profile and account information.", "name": "Users" }, { "description": "Manage organization members and their roles.", "name": "Members" }, { "description": "Invite users to join an organization.", "name": "Invites" } ] }