{"openapi": "3.0.3", "info": {"title": "SCRS Enterprise API", "version": "1.6.0", "description": "Enterprise PII redaction, compliance, and data governance API. All endpoints require API key authentication via Bearer token unless otherwise noted. For multi-tenant deployments, include the X-Organization-Id header with all authenticated requests to ensure proper tenant isolation.", "contact": {"name": "SCRS Support", "email": "support@pophastalabs.com"}}, "servers": [{"url": "/api/v1/", "description": "API v1"}], "tags": [{"name": "SCRS Core", "description": "Text processing: redaction, pseudonymization, rehydration, classification"}, {"name": "Policies", "description": "Policy management for PII handling rules"}, {"name": "Collections", "description": "Data collection management"}, {"name": "Rules", "description": "File-type rules for automated processing"}, {"name": "Audit & Compliance", "description": "Audit logs, compliance reports, and usage statistics"}, {"name": "Organization", "description": "Organization settings and member management"}, {"name": "API Keys", "description": "API key lifecycle management"}, {"name": "LLM Config", "description": "LLM provider configuration"}, {"name": "Storage", "description": "Document upload and retrieval"}, {"name": "Health", "description": "Service health checks"}, {"name": "Service Status", "description": "Public service status with per-component health"}, {"name": "Sandbox", "description": "Unauthenticated sandbox for quick testing"}, {"name": "Quota", "description": "Usage quota and billing information"}], "components": {"securitySchemes": {"BearerAuth": {"type": "http", "scheme": "bearer", "description": "API key with sk-scrs- prefix"}}, "schemas": {"SuccessResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object"}}, "required": ["ok", "data"]}, "ErrorResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [false], "example": false}, "error": {"type": "string", "example": "Invalid request"}, "code": {"type": "string", "example": "VALIDATION_ERROR"}}, "required": ["ok", "error", "code"]}, "PaginationMeta": {"type": "object", "properties": {"page": {"type": "integer", "example": 1}, "per_page": {"type": "integer", "example": 25}, "total": {"type": "integer", "example": 87}, "total_pages": {"type": "integer", "example": 4}}, "required": ["page", "per_page", "total", "total_pages"]}, "RedactRequest": {"type": "object", "properties": {"text": {"type": "string", "description": "Text to redact PII from", "example": "My name is John Smith and my SSN is 123-45-6789."}, "patterns": {"type": "array", "items": {"type": "string"}, "description": "Optional list of PII pattern names to target", "example": ["SSN", "EMAIL", "PHONE"]}, "pipeline_id": {"type": "integer", "description": "Optional pipeline ID to use for processing", "example": 42}}, "required": ["text"]}, "RedactResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"redacted_text": {"type": "string", "example": "My name is [REDACTED_NAME] and my SSN is [REDACTED_SSN]."}, "pii_count": {"type": "integer", "example": 2}, "patterns_found": {"type": "array", "items": {"type": "string"}, "example": ["NAME", "SSN"]}, "processing_time_ms": {"type": "integer", "example": 34}}, "required": ["redacted_text", "pii_count", "patterns_found", "processing_time_ms"]}}, "required": ["ok", "data"]}, "BatchRedactRequest": {"type": "object", "properties": {"texts": {"type": "array", "items": {"type": "string"}, "maxItems": 100, "description": "Array of texts to redact (max 100)", "example": ["Contact Jane Doe at jane@example.com", "Call 555-123-4567 for Mike Johnson"]}, "patterns": {"type": "array", "items": {"type": "string"}, "description": "Optional list of PII pattern names to target", "example": ["EMAIL", "PHONE", "NAME"]}}, "required": ["texts"]}, "BatchRedactResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"results": {"type": "array", "items": {"type": "object", "properties": {"redacted_text": {"type": "string"}, "pii_count": {"type": "integer"}, "patterns_found": {"type": "array", "items": {"type": "string"}}}}, "example": [{"redacted_text": "Contact [REDACTED_NAME] at [REDACTED_EMAIL]", "pii_count": 2, "patterns_found": ["NAME", "EMAIL"]}, {"redacted_text": "Call [REDACTED_PHONE] for [REDACTED_NAME]", "pii_count": 2, "patterns_found": ["PHONE", "NAME"]}]}, "total_pii_count": {"type": "integer", "example": 4}, "processing_time_ms": {"type": "integer", "example": 78}}, "required": ["results", "total_pii_count", "processing_time_ms"]}}, "required": ["ok", "data"]}, "PseudonymizeRequest": {"type": "object", "properties": {"text": {"type": "string", "description": "Text to pseudonymize", "example": "Patient Alice Brown visited Dr. Lee on 2024-01-15."}, "patterns": {"type": "array", "items": {"type": "string"}, "description": "Optional list of PII pattern names to target", "example": ["NAME", "DATE"]}}, "required": ["text"]}, "PseudonymizeResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"pseudonymized_text": {"type": "string", "example": "Patient PERSON_A visited PERSON_B on DATE_1."}, "pii_count": {"type": "integer", "example": 3}, "patterns_found": {"type": "array", "items": {"type": "string"}, "example": ["NAME", "NAME", "DATE"]}, "processing_time_ms": {"type": "integer", "example": 41}}, "required": ["pseudonymized_text", "pii_count", "patterns_found", "processing_time_ms"]}}, "required": ["ok", "data"]}, "RehydrateRequest": {"type": "object", "properties": {"text": {"type": "string", "description": "Previously redacted text to restore original PII tokens", "example": "Patient PERSON_A visited PERSON_B on DATE_1."}}, "required": ["text"]}, "RehydrateResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"rehydrated_text": {"type": "string", "example": "Patient Alice Brown visited Dr. Lee on 2024-01-15."}, "tokens_restored": {"type": "integer", "example": 3}, "processing_time_ms": {"type": "integer", "example": 12}}, "required": ["rehydrated_text", "tokens_restored", "processing_time_ms"]}}, "required": ["ok", "data"]}, "ClassifyRequest": {"type": "object", "properties": {"filename": {"type": "string", "description": "Filename to classify by file type and sensitivity", "example": "patient_records_2024.csv"}}, "required": ["filename"]}, "ClassifyResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"filename": {"type": "string", "example": "patient_records_2024.csv"}, "file_type": {"type": "string", "example": "csv"}, "sensitivity": {"type": "string", "example": "high"}, "suggested_collection": {"type": "string", "example": "Healthcare"}, "suggested_patterns": {"type": "array", "items": {"type": "string"}, "example": ["NAME", "DOB", "SSN", "MEDICAL_ID"]}}}}, "required": ["ok", "data"]}, "ProcessRequest": {"type": "object", "properties": {"text": {"type": "string", "description": "Text to process through the SCRS pipeline", "example": "John Smith (SSN 123-45-6789) owes $5,000 on invoice #INV-2024-001."}, "excerpt_only": {"type": "boolean", "description": "Return only the processed excerpt, not full metadata", "example": false}, "max_length": {"type": "integer", "description": "Maximum character length of the processed output", "example": 500}}, "required": ["text"]}, "ProcessResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"processed_text": {"type": "string", "example": "[REDACTED_NAME] (SSN [REDACTED_SSN]) owes $5,000 on invoice #INV-2024-001."}, "pii_count": {"type": "integer", "example": 2}, "patterns_found": {"type": "array", "items": {"type": "string"}, "example": ["NAME", "SSN"]}, "processing_time_ms": {"type": "integer", "example": 29}, "excerpt": {"type": "boolean", "example": false}}}}, "required": ["ok", "data"]}, "Policy": {"type": "object", "properties": {"id": {"type": "integer", "example": 1}, "name": {"type": "string", "example": "HIPAA Compliance"}, "description": {"type": "string", "example": "Redaction policy for healthcare data under HIPAA regulations"}, "sector": {"type": "string", "example": "healthcare"}, "created_at": {"type": "string", "format": "date-time", "example": "2024-06-15T10:30:00Z"}, "updated_at": {"type": "string", "format": "date-time", "example": "2024-09-01T14:22:00Z"}, "rules_count": {"type": "integer", "example": 12}}}, "PolicyCreateRequest": {"type": "object", "properties": {"name": {"type": "string", "example": "HIPAA Compliance"}, "description": {"type": "string", "example": "Redaction policy for healthcare data under HIPAA regulations"}, "sector": {"type": "string", "example": "healthcare"}}, "required": ["name"]}, "Collection": {"type": "object", "properties": {"id": {"type": "integer", "example": 5}, "name": {"type": "string", "example": "Financial Records"}, "description": {"type": "string", "example": "Bank statements, invoices, and tax documents"}, "icon": {"type": "string", "example": "dollar-sign"}, "is_sensitive": {"type": "boolean", "example": true}, "document_count": {"type": "integer", "example": 234}, "created_at": {"type": "string", "format": "date-time", "example": "2024-03-10T08:00:00Z"}}}, "CollectionCreateRequest": {"type": "object", "properties": {"name": {"type": "string", "example": "Financial Records"}, "description": {"type": "string", "example": "Bank statements, invoices, and tax documents"}, "icon": {"type": "string", "example": "dollar-sign"}, "is_sensitive": {"type": "boolean", "example": true}}, "required": ["name"]}, "Rule": {"type": "object", "properties": {"id": {"type": "integer", "example": 8}, "name": {"type": "string", "example": "CSV Financial Gate"}, "file_type": {"type": "string", "example": "csv"}, "collection_id": {"type": "integer", "example": 5}, "granularity": {"type": "string", "enum": ["row", "cell", "document"], "example": "row"}, "gate_redact": {"type": "boolean", "example": true}, "gate_pseudonymize": {"type": "boolean", "example": false}, "gate_block": {"type": "boolean", "example": false}, "gate_flag": {"type": "boolean", "example": true}, "created_at": {"type": "string", "format": "date-time", "example": "2024-07-20T11:00:00Z"}}}, "RuleCreateRequest": {"type": "object", "properties": {"name": {"type": "string", "example": "CSV Financial Gate"}, "file_type": {"type": "string", "example": "csv"}, "collection_id": {"type": "integer", "example": 5}, "granularity": {"type": "string", "enum": ["row", "cell", "document"], "example": "row"}, "gate_redact": {"type": "boolean", "example": true}, "gate_pseudonymize": {"type": "boolean", "example": false}, "gate_block": {"type": "boolean", "example": false}, "gate_flag": {"type": "boolean", "example": true}}, "required": ["name", "file_type", "collection_id"]}, "AuditEntry": {"type": "object", "properties": {"id": {"type": "integer", "example": 10432}, "timestamp": {"type": "string", "format": "date-time", "example": "2024-11-20T09:15:32Z"}, "user": {"type": "string", "example": "alice@acme.com"}, "action": {"type": "string", "example": "redact"}, "gate": {"type": "string", "example": "redact"}, "resource": {"type": "string", "example": "document:1234"}, "pii_count": {"type": "integer", "example": 7}, "ip_address": {"type": "string", "example": "203.0.113.42"}}}, "ComplianceReport": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"generated_at": {"type": "string", "format": "date-time", "example": "2024-11-20T12:00:00Z"}, "period_start": {"type": "string", "format": "date-time", "example": "2024-10-01T00:00:00Z"}, "period_end": {"type": "string", "format": "date-time", "example": "2024-10-31T23:59:59Z"}, "total_requests": {"type": "integer", "example": 24500}, "total_pii_detected": {"type": "integer", "example": 67890}, "total_pii_redacted": {"type": "integer", "example": 67850}, "compliance_score": {"type": "number", "format": "float", "example": 99.94}, "violations": {"type": "integer", "example": 2}, "top_patterns": {"type": "array", "items": {"type": "object", "properties": {"pattern": {"type": "string"}, "count": {"type": "integer"}}}, "example": [{"pattern": "EMAIL", "count": 18200}, {"pattern": "NAME", "count": 15400}, {"pattern": "PHONE", "count": 9800}]}}}}, "required": ["ok", "data"]}, "UsageResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"period": {"type": "string", "example": "2024-11"}, "total_requests": {"type": "integer", "example": 24500}, "total_pii_items": {"type": "integer", "example": 67890}, "breakdown": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string"}, "requests": {"type": "integer"}, "pii_items": {"type": "integer"}}}, "example": [{"date": "2024-11-01", "requests": 820, "pii_items": 2310}, {"date": "2024-11-02", "requests": 915, "pii_items": 2580}]}}}}, "required": ["ok", "data"]}, "Organization": {"type": "object", "properties": {"id": {"type": "integer", "example": 1}, "name": {"type": "string", "example": "Acme Corp"}, "slug": {"type": "string", "example": "acme-corp"}, "default_key_expiry_days": {"type": "integer", "example": 90}, "member_count": {"type": "integer", "example": 15}, "created_at": {"type": "string", "format": "date-time", "example": "2024-01-10T09:00:00Z"}}}, "OrganizationUpdateRequest": {"type": "object", "properties": {"name": {"type": "string", "example": "Acme Corp International"}, "default_key_expiry_days": {"type": "integer", "example": 60}}}, "Member": {"type": "object", "properties": {"id": {"type": "integer", "example": 7}, "email": {"type": "string", "example": "alice@acme.com"}, "name": {"type": "string", "example": "Alice Chen"}, "role": {"type": "string", "enum": ["developer", "viewer", "admin", "billing"], "example": "developer"}, "joined_at": {"type": "string", "format": "date-time", "example": "2024-02-15T10:30:00Z"}, "last_active": {"type": "string", "format": "date-time", "example": "2024-11-19T16:45:00Z"}}}, "InviteMemberRequest": {"type": "object", "properties": {"email": {"type": "string", "format": "email", "example": "bob@acme.com"}, "role": {"type": "string", "enum": ["developer", "viewer", "admin", "billing"], "default": "developer", "example": "developer"}}, "required": ["email"]}, "ApiKey": {"type": "object", "properties": {"id": {"type": "integer", "example": 12}, "name": {"type": "string", "example": "Production Backend"}, "prefix": {"type": "string", "example": "sk-scrs-abc1"}, "permissions": {"type": "object", "properties": {"read": {"type": "boolean", "example": true}, "write": {"type": "boolean", "example": true}, "admin": {"type": "boolean", "example": false}}}, "rate_limit_per_minute": {"type": "integer", "example": 60}, "rate_limit_per_day": {"type": "integer", "example": 10000}, "ip_whitelist": {"type": "array", "items": {"type": "string"}, "example": ["203.0.113.0/24"]}, "created_at": {"type": "string", "format": "date-time", "example": "2024-08-01T12:00:00Z"}, "expires_at": {"type": "string", "format": "date-time", "example": "2024-10-30T12:00:00Z"}, "last_used_at": {"type": "string", "format": "date-time", "example": "2024-11-19T22:10:00Z"}}}, "ApiKeyCreateRequest": {"type": "object", "properties": {"name": {"type": "string", "example": "Production Backend"}, "permissions": {"type": "object", "properties": {"read": {"type": "boolean", "example": true}, "write": {"type": "boolean", "example": true}, "admin": {"type": "boolean", "example": false}}}, "rate_limit_per_minute": {"type": "integer", "example": 60}, "rate_limit_per_day": {"type": "integer", "example": 10000}, "ip_whitelist": {"type": "array", "items": {"type": "string"}, "example": ["203.0.113.0/24"]}}, "required": ["name"]}, "ApiKeyCreateResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"id": {"type": "integer", "example": 13}, "name": {"type": "string", "example": "Production Backend"}, "key": {"type": "string", "description": "Full key shown only once at creation", "example": "sk-scrs-abc123def456ghi789jkl012mno345"}, "prefix": {"type": "string", "example": "sk-scrs-abc1"}, "created_at": {"type": "string", "format": "date-time", "example": "2024-11-20T10:00:00Z"}, "expires_at": {"type": "string", "format": "date-time", "example": "2025-02-18T10:00:00Z"}}}}, "required": ["ok", "data"]}, "LlmConfig": {"type": "object", "properties": {"provider": {"type": "string", "example": "openai"}, "model": {"type": "string", "example": "gpt-4o"}, "is_active": {"type": "boolean", "example": true}, "created_at": {"type": "string", "format": "date-time", "example": "2024-05-01T09:00:00Z"}}}, "LlmConfigCreateRequest": {"type": "object", "properties": {"provider": {"type": "string", "example": "openai"}, "api_key": {"type": "string", "example": "sk-proj-abc123..."}}, "required": ["provider", "api_key"]}, "Document": {"type": "object", "properties": {"id": {"type": "integer", "example": 456}, "name": {"type": "string", "example": "employee_roster.csv"}, "file_type": {"type": "string", "example": "csv"}, "file_size": {"type": "integer", "example": 204800}, "size_display": {"type": "string", "example": "200 KB"}, "processed": {"type": "boolean", "example": true}, "created_at": {"type": "string", "format": "date-time", "example": "2024-11-18T14:30:00Z"}}}, "HealthResponse": {"type": "object", "properties": {"status": {"type": "string", "enum": ["ok", "degraded", "error"], "example": "ok"}, "timestamp": {"type": "string", "format": "date-time", "example": "2024-11-20T12:00:00Z"}, "version": {"type": "string", "example": "1.0"}, "components": {"type": "object", "properties": {"database": {"type": "string", "enum": ["ok", "degraded", "error"], "example": "ok"}, "cache": {"type": "string", "enum": ["ok", "degraded", "error"], "example": "ok"}, "storage": {"type": "string", "enum": ["ok", "degraded", "error"], "example": "ok"}}}}, "required": ["status", "timestamp", "version", "components"]}, "SandboxRedactRequest": {"type": "object", "properties": {"text": {"type": "string", "description": "Text to redact (sandbox mode, no auth required)", "example": "My email is test@example.com and my phone is 555-0100."}}, "required": ["text"]}, "SandboxRedactResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"redacted_text": {"type": "string", "example": "My email is [REDACTED_EMAIL] and my phone is [REDACTED_PHONE]."}, "pii_count": {"type": "integer", "example": 2}, "patterns_found": {"type": "array", "items": {"type": "string"}, "example": ["EMAIL", "PHONE"]}, "processing_time_ms": {"type": "integer", "example": 18}, "sandbox": {"type": "boolean", "enum": [true], "example": true}}, "required": ["redacted_text", "pii_count", "patterns_found", "processing_time_ms", "sandbox"]}}, "required": ["ok", "data"]}, "QuotaResponse": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true], "example": true}, "data": {"type": "object", "properties": {"tier": {"type": "string", "example": "professional"}, "tier_display": {"type": "string", "example": "Professional"}, "included": {"type": "integer", "example": 50000}, "used": {"type": "integer", "example": 32150}, "remaining": {"type": "integer", "example": 17850}, "overage": {"type": "integer", "example": 0}, "overage_rate": {"type": "number", "format": "float", "example": 0.002}, "estimated_overage_cost": {"type": "number", "format": "float", "example": 0.0}, "billing_cycle": {"type": "object", "properties": {"start": {"type": "string", "format": "date", "example": "2024-11-01"}, "end": {"type": "string", "format": "date", "example": "2024-11-30"}}}, "status": {"type": "string", "enum": ["ok", "warning", "exceeded"], "example": "ok"}}, "required": ["tier", "tier_display", "included", "used", "remaining", "overage", "overage_rate", "estimated_overage_cost", "billing_cycle", "status"]}}, "required": ["ok", "data"]}}, "responses": {"BadRequest": {"description": "Bad request - validation error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}, "example": {"ok": false, "error": "Field 'text' is required", "code": "VALIDATION_ERROR"}}}}, "Unauthorized": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}, "example": {"ok": false, "error": "Invalid or expired API key", "code": "UNAUTHORIZED"}}}}, "Forbidden": {"description": "Insufficient permissions", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}, "example": {"ok": false, "error": "You do not have permission to perform this action", "code": "FORBIDDEN"}}}}, "NotFound": {"description": "Resource not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}, "example": {"ok": false, "error": "Resource not found", "code": "NOT_FOUND"}}}}, "RateLimited": {"description": "Rate limit exceeded", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}, "example": {"ok": false, "error": "Rate limit exceeded. Try again in 30 seconds.", "code": "RATE_LIMITED"}}}}}, "parameters": {"PageParam": {"name": "page", "in": "query", "schema": {"type": "integer", "default": 1, "minimum": 1}, "description": "Page number"}, "PerPageParam": {"name": "per_page", "in": "query", "schema": {"type": "integer", "default": 25, "minimum": 1, "maximum": 100}, "description": "Items per page"}, "OrgIdHeader": {"name": "X-Organization-Id", "in": "header", "required": false, "schema": {"type": "integer", "example": 42}, "description": "Organization ID for multi-tenant isolation. Required when an API key has access to multiple organizations."}}}, "security": [{"BearerAuth": []}], "paths": {"/scrs/redact/": {"post": {"tags": ["SCRS Core"], "summary": "Redact PII from text", "description": "Scans the input text for personally identifiable information and replaces detected PII with redaction tokens.", "operationId": "redactText", "security": [{"BearerAuth": []}], "parameters": [{"$ref": "#/components/parameters/OrgIdHeader"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RedactRequest"}}}}, "responses": {"200": {"description": "PII redacted successfully", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RedactResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/batch/redact/": {"post": {"tags": ["SCRS Core"], "summary": "Batch redact PII from multiple texts", "description": "Redacts PII from up to 100 texts in a single request for efficient bulk processing.", "operationId": "batchRedactText", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchRedactRequest"}}}}, "responses": {"200": {"description": "Batch redaction completed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchRedactResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/pseudonymize/": {"post": {"tags": ["SCRS Core"], "summary": "Pseudonymize PII in text", "description": "Replaces detected PII with consistent pseudonyms (e.g., PERSON_A, DATE_1) that preserve referential integrity.", "operationId": "pseudonymizeText", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PseudonymizeRequest"}}}}, "responses": {"200": {"description": "Text pseudonymized successfully", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PseudonymizeResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/rehydrate/": {"post": {"tags": ["SCRS Core"], "summary": "Rehydrate redacted or pseudonymized text", "description": "Restores original PII values from previously redacted or pseudonymized text using stored token mappings.", "operationId": "rehydrateText", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RehydrateRequest"}}}}, "responses": {"200": {"description": "Text rehydrated successfully", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RehydrateResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/classify/": {"post": {"tags": ["SCRS Core"], "summary": "Classify a file by type and sensitivity", "description": "Analyzes a filename to determine file type, sensitivity level, and recommended collection and patterns.", "operationId": "classifyFile", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClassifyRequest"}}}}, "responses": {"200": {"description": "File classified successfully", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClassifyResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/process/": {"post": {"tags": ["SCRS Core"], "summary": "Process text through the SCRS pipeline", "description": "Runs the full SCRS processing pipeline on the input text, applying all configured gates and rules.", "operationId": "processText", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProcessRequest"}}}}, "responses": {"200": {"description": "Text processed successfully", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ProcessResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/policies/": {"get": {"tags": ["Policies"], "summary": "List all policies", "description": "Returns a paginated list of all PII handling policies for the organization.", "operationId": "listPolicies", "security": [{"BearerAuth": []}], "parameters": [{"$ref": "#/components/parameters/PageParam"}, {"$ref": "#/components/parameters/PerPageParam"}], "responses": {"200": {"description": "Policies retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Policy"}}, "meta": {"$ref": "#/components/schemas/PaginationMeta"}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "post": {"tags": ["Policies"], "summary": "Create a policy", "description": "Creates a new PII handling policy for the organization.", "operationId": "createPolicy", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyCreateRequest"}}}}, "responses": {"201": {"description": "Policy created", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Policy"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/policies/{policy_id}/": {"parameters": [{"name": "policy_id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Policy ID", "example": 1}], "get": {"tags": ["Policies"], "summary": "Get a policy", "description": "Returns the details of a specific policy.", "operationId": "getPolicy", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Policy details", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Policy"}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "put": {"tags": ["Policies"], "summary": "Update a policy", "description": "Updates an existing policy. All fields in the request body are optional.", "operationId": "updatePolicy", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyCreateRequest"}}}}, "responses": {"200": {"description": "Policy updated", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Policy"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "delete": {"tags": ["Policies"], "summary": "Delete a policy", "description": "Permanently deletes a policy and all associated rules.", "operationId": "deletePolicy", "security": [{"BearerAuth": []}], "responses": {"204": {"description": "Policy deleted"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/collections/": {"get": {"tags": ["Collections"], "summary": "List all collections", "description": "Returns all data collections for the organization.", "operationId": "listCollections", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Collections retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Collection"}}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "post": {"tags": ["Collections"], "summary": "Create a collection", "description": "Creates a new data collection for organizing documents.", "operationId": "createCollection", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CollectionCreateRequest"}}}}, "responses": {"201": {"description": "Collection created", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Collection"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/collections/{collection_id}/": {"parameters": [{"name": "collection_id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Collection ID", "example": 5}], "put": {"tags": ["Collections"], "summary": "Update a collection", "description": "Updates an existing collection's metadata.", "operationId": "updateCollection", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CollectionCreateRequest"}}}}, "responses": {"200": {"description": "Collection updated", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Collection"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/rules/": {"get": {"tags": ["Rules"], "summary": "List all rules", "description": "Returns all file-type processing rules for the organization.", "operationId": "listRules", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Rules retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Rule"}}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "post": {"tags": ["Rules"], "summary": "Create a rule", "description": "Creates a new file-type processing rule with gate configuration.", "operationId": "createRule", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RuleCreateRequest"}}}}, "responses": {"201": {"description": "Rule created", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Rule"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/rules/{rule_id}/": {"parameters": [{"name": "rule_id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Rule ID", "example": 8}], "put": {"tags": ["Rules"], "summary": "Update a rule", "description": "Updates an existing file-type processing rule.", "operationId": "updateRule", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RuleCreateRequest"}}}}, "responses": {"200": {"description": "Rule updated", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Rule"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/audit/": {"get": {"tags": ["Audit & Compliance"], "summary": "Query audit log", "description": "Returns a paginated, filterable audit trail of all SCRS operations.", "operationId": "queryAuditLog", "security": [{"BearerAuth": []}], "parameters": [{"name": "gate", "in": "query", "schema": {"type": "string", "enum": ["redact", "pseudonymize", "block", "flag"]}, "description": "Filter by gate type"}, {"name": "action", "in": "query", "schema": {"type": "string"}, "description": "Filter by action (e.g., redact, rehydrate, upload)", "example": "redact"}, {"name": "date_from", "in": "query", "schema": {"type": "string", "format": "date"}, "description": "Start date filter (inclusive)", "example": "2024-11-01"}, {"name": "date_to", "in": "query", "schema": {"type": "string", "format": "date"}, "description": "End date filter (inclusive)", "example": "2024-11-30"}, {"$ref": "#/components/parameters/PageParam"}, {"$ref": "#/components/parameters/PerPageParam"}], "responses": {"200": {"description": "Audit entries retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/AuditEntry"}}, "meta": {"$ref": "#/components/schemas/PaginationMeta"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/compliance/report/": {"get": {"tags": ["Audit & Compliance"], "summary": "Generate compliance report", "description": "Generates a compliance report summarizing PII detection and redaction metrics for the current billing period.", "operationId": "getComplianceReport", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Compliance report generated", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ComplianceReport"}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/scrs/usage/": {"get": {"tags": ["Audit & Compliance"], "summary": "Get usage statistics", "description": "Returns usage statistics for the organization, optionally grouped by day, week, or month.", "operationId": "getUsage", "security": [{"BearerAuth": []}], "parameters": [{"name": "period", "in": "query", "schema": {"type": "string"}, "description": "Billing period in YYYY-MM format", "example": "2024-11"}, {"name": "group_by", "in": "query", "schema": {"type": "string", "enum": ["day", "week", "month"]}, "description": "Group results by time interval", "example": "day"}], "responses": {"200": {"description": "Usage statistics retrieved", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/": {"get": {"tags": ["Organization"], "summary": "Get organization details", "description": "Returns the current organization's settings and metadata.", "operationId": "getOrganization", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Organization details", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Organization"}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "put": {"tags": ["Organization"], "summary": "Update organization settings", "description": "Updates the organization's name or default API key expiry.", "operationId": "updateOrganization", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OrganizationUpdateRequest"}}}}, "responses": {"200": {"description": "Organization updated", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/Organization"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/members/": {"get": {"tags": ["Organization"], "summary": "List organization members", "description": "Returns all members of the current organization with their roles.", "operationId": "listMembers", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Members retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Member"}}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/members/invite/": {"post": {"tags": ["Organization"], "summary": "Invite a member", "description": "Sends an invitation email to a new organization member with the specified role.", "operationId": "inviteMember", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InviteMemberRequest"}}}}, "responses": {"201": {"description": "Invitation sent", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "object", "properties": {"email": {"type": "string", "example": "bob@acme.com"}, "role": {"type": "string", "example": "developer"}, "invited_at": {"type": "string", "format": "date-time", "example": "2024-11-20T10:00:00Z"}}}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/members/{member_id}/": {"parameters": [{"name": "member_id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Member ID", "example": 7}], "delete": {"tags": ["Organization"], "summary": "Remove a member", "description": "Removes a member from the organization and revokes their access.", "operationId": "removeMember", "security": [{"BearerAuth": []}], "responses": {"204": {"description": "Member removed"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/keys/": {"get": {"tags": ["API Keys"], "summary": "List API keys", "description": "Returns all API keys for the organization. Key values are masked; only the prefix is shown.", "operationId": "listApiKeys", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "API keys retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/ApiKey"}}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "post": {"tags": ["API Keys"], "summary": "Create an API key", "description": "Creates a new API key. The full key value is returned only in this response and cannot be retrieved again.", "operationId": "createApiKey", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKeyCreateRequest"}}}}, "responses": {"201": {"description": "API key created (full key shown only once)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKeyCreateResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/keys/{key_id}/": {"parameters": [{"name": "key_id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "API Key ID", "example": 12}], "delete": {"tags": ["API Keys"], "summary": "Revoke an API key", "description": "Permanently revokes an API key. This action cannot be undone.", "operationId": "revokeApiKey", "security": [{"BearerAuth": []}], "responses": {"204": {"description": "API key revoked"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/llm/": {"get": {"tags": ["LLM Config"], "summary": "List LLM configurations", "description": "Returns all configured LLM providers for the organization.", "operationId": "listLlmConfigs", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "LLM configurations retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/LlmConfig"}}}}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}, "post": {"tags": ["LLM Config"], "summary": "Add LLM provider", "description": "Configures a new LLM provider with an API key for the organization.", "operationId": "addLlmConfig", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LlmConfigCreateRequest"}}}}, "responses": {"201": {"description": "LLM provider configured", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"$ref": "#/components/schemas/LlmConfig"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/org/llm/{provider}/": {"parameters": [{"name": "provider", "in": "path", "required": true, "schema": {"type": "string"}, "description": "LLM provider name", "example": "openai"}], "delete": {"tags": ["LLM Config"], "summary": "Remove LLM provider", "description": "Removes an LLM provider configuration and its associated API key.", "operationId": "removeLlmConfig", "security": [{"BearerAuth": []}], "responses": {"204": {"description": "LLM provider removed"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/storage/upload/": {"post": {"tags": ["Storage"], "summary": "Upload a document", "description": "Uploads a document for processing. Accepts multipart/form-data with a file field.", "operationId": "uploadDocument", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "properties": {"file": {"type": "string", "format": "binary", "description": "The file to upload"}, "name": {"type": "string", "description": "Optional display name for the document", "example": "Q4 Employee Roster"}}, "required": ["file"]}}}}, "responses": {"201": {"description": "Document uploaded successfully", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "object", "properties": {"id": {"type": "integer", "example": 457}, "name": {"type": "string", "example": "Q4 Employee Roster"}, "file_type": {"type": "string", "example": "csv"}, "file_size": {"type": "integer", "example": 204800}, "size_display": {"type": "string", "example": "200 KB"}, "created_at": {"type": "string", "format": "date-time", "example": "2024-11-20T10:30:00Z"}}}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/storage/": {"get": {"tags": ["Storage"], "summary": "List documents", "description": "Returns a paginated, filterable list of uploaded documents.", "operationId": "listDocuments", "security": [{"BearerAuth": []}], "parameters": [{"name": "q", "in": "query", "schema": {"type": "string"}, "description": "Search query to filter by document name", "example": "employee"}, {"name": "file_type", "in": "query", "schema": {"type": "string"}, "description": "Filter by file type extension", "example": "csv"}, {"name": "processed", "in": "query", "schema": {"type": "boolean"}, "description": "Filter by processed status"}, {"$ref": "#/components/parameters/PageParam"}, {"$ref": "#/components/parameters/PerPageParam"}], "responses": {"200": {"description": "Documents retrieved", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean", "enum": [true]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Document"}}, "meta": {"$ref": "#/components/schemas/PaginationMeta"}}}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/health/": {"get": {"tags": ["Health"], "summary": "Health check", "description": "Returns the health status of the API and its dependent services. No authentication required.", "operationId": "healthCheck", "security": [], "responses": {"200": {"description": "Service health status", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HealthResponse"}}}}}}}, "/sandbox/redact/": {"post": {"tags": ["Sandbox"], "summary": "Sandbox redact (no auth)", "description": "Redacts PII from text without requiring authentication. Intended for quick testing and evaluation. Rate-limited more aggressively than authenticated endpoints.", "operationId": "sandboxRedact", "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SandboxRedactRequest"}}}}, "responses": {"200": {"description": "Sandbox redaction result", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SandboxRedactResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/status/": {"get": {"tags": ["Service Status"], "summary": "Get service status", "description": "Returns the overall platform status and per-component health for api, chat, storage, and scrs. No authentication required.", "operationId": "getServiceStatus", "security": [], "responses": {"200": {"description": "Service status", "content": {"application/json": {"schema": {"type": "object", "properties": {"status": {"type": "string", "enum": ["operational", "degraded", "outage"], "example": "operational"}, "components": {"type": "object", "properties": {"api": {"type": "object", "properties": {"status": {"type": "string", "example": "operational"}, "message": {"type": "string", "example": ""}, "updated_at": {"type": "string", "format": "date-time", "example": "2026-03-31T12:00:00Z"}}}, "chat": {"type": "object", "properties": {"status": {"type": "string", "example": "operational"}, "message": {"type": "string", "example": ""}, "updated_at": {"type": "string", "format": "date-time", "example": "2026-03-31T12:00:00Z"}}}, "storage": {"type": "object", "properties": {"status": {"type": "string", "example": "operational"}, "message": {"type": "string", "example": ""}, "updated_at": {"type": "string", "format": "date-time", "example": "2026-03-31T12:00:00Z"}}}, "scrs": {"type": "object", "properties": {"status": {"type": "string", "example": "operational"}, "message": {"type": "string", "example": ""}, "updated_at": {"type": "string", "format": "date-time", "example": "2026-03-31T12:00:00Z"}}}}}}}}}}}}}, "/quota/": {"get": {"tags": ["Quota"], "summary": "Get quota and billing info", "description": "Returns current usage quota, tier information, overage rates, and billing cycle details.", "operationId": "getQuota", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Quota information", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/QuotaResponse"}}}}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}}}