{"openapi":"3.0.3","info":{"title":"Print Hive API Documentation","description":"REST API for the Print Hive print farm management platform: printers, print jobs, models, materials, inventory, smart queue, and integrations.","version":"1.0.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"},"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Error":{"type":"object","description":"Consistent Print Hive API error body: a machine-readable error code and a human-readable message.","properties":{"error":{"type":"string","description":"Machine-readable error code."},"message":{"type":"string","description":"Human-readable explanation of the failure."}},"required":["error","message"]}}},"paths":{"/.well-known/openai-apps-challenge":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/integrations.json":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/mcp/server-card.json":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/mcp/":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agent/identity":{"post":{"tags":["Agent Auth","Public"],"description":"Register an agent using the auth.md service_auth flow","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type"],"additionalProperties":false,"properties":{"type":{"type":"string"},"login_hint":{"type":"string","minLength":3,"maxLength":320}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agent/identity/claim":{"post":{"tags":["Agent Auth","Public"],"description":"Refresh an expired auth.md claim attempt","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["claim_token","email"],"additionalProperties":false,"properties":{"claim_token":{"type":"string","minLength":20,"maxLength":200},"email":{"type":"string","minLength":3,"maxLength":320}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent/identity/claim/inspect":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent/identity/claim/confirm":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/session-handoff":{"post":{"tags":["OAuth"],"description":"Create a one-time OAuth consent handoff from an authenticated user session","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["clientId","redirectUri","scopes","resource"],"properties":{"clientId":{"type":"string","minLength":1,"maxLength":200},"redirectUri":{"type":"string","minLength":1,"maxLength":2048},"scopes":{"type":"array","minItems":1,"maxItems":19,"uniqueItems":true,"items":{"type":"string","enum":["printers:read","printers:write","jobs:read","jobs:write","telemetry:read","models:read","models:write","files:read","files:write","print-jobs:read","print-jobs:write","inventory:read","inventory:write","makes:read","makes:write","fleet:read","fleet:write","host:pair","print:launch"]}},"codeChallenge":{"type":"string","minLength":43,"maxLength":128},"resource":{"type":"string","maxLength":2048}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"handoff":{"type":"string"},"expires_in":{"type":"number"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"tags":["OAuth","Public"],"description":"OAuth 2.0 Protected Resource Metadata","x-public":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"resource":{"type":"string"},"resource_name":{"type":"string"},"resource_logo_uri":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"resource_signing_alg_values_supported":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"resource_documentation":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["OAuth","Public"],"description":"OAuth 2.0 Authorization Server Metadata (RFC 8414)","x-public":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"resource":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"issuer":{"type":"string"},"authorization_endpoint":{"type":"string"},"token_endpoint":{"type":"string"},"revocation_endpoint":{"type":"string"},"response_types_supported":{"type":"array","items":{"type":"string"}},"grant_types_supported":{"type":"array","items":{"type":"string"}},"code_challenge_methods_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"registration_endpoint":{"type":"string"},"service_documentation":{"type":"string"},"agent_auth":{"type":"object","additionalProperties":true}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/authorize":{"get":{"tags":["OAuth"],"description":"OAuth 2.0 Authorization Endpoint with PKCE","parameters":[{"schema":{"type":"string","enum":["code"]},"in":"query","name":"response_type","required":true},{"schema":{"type":"string"},"in":"query","name":"client_id","required":true},{"schema":{"type":"string"},"in":"query","name":"redirect_uri","required":true},{"schema":{"type":"string"},"in":"query","name":"scope","required":false},{"schema":{"type":"string"},"in":"query","name":"state","required":false},{"schema":{"type":"string"},"in":"query","name":"code_challenge","required":false},{"schema":{"type":"string","enum":["S256"]},"in":"query","name":"code_challenge_method","required":false},{"schema":{"type":"string"},"in":"query","name":"resource","required":false},{"schema":{"type":"string"},"in":"query","name":"handoff","required":false},{"schema":{"type":"string"},"in":"query","name":"organization_id","required":false},{"schema":{"type":"string","enum":["deny"]},"in":"query","name":"decision","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/token":{"post":{"tags":["OAuth"],"description":"OAuth 2.0 Token Endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["grant_type"],"properties":{"grant_type":{"type":"string","enum":["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:jwt-bearer","urn:workos:agent-auth:grant-type:claim"]},"code":{"type":"string"},"redirect_uri":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"code_verifier":{"type":"string"},"resource":{"type":"string"},"refresh_token":{"type":"string"},"claim_token":{"type":"string"},"assertion":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"refresh_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"number"},"scope":{"type":"string"},"identity_assertion":{"type":"string"},"assertion_expires":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/register":{"post":{"tags":["OAuth","Public"],"description":"OAuth 2.0 Dynamic Client Registration (RFC 7591)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["redirect_uris"],"additionalProperties":false,"properties":{"client_name":{"type":"string","minLength":1,"maxLength":200},"redirect_uris":{"type":"array","minItems":1,"maxItems":10,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":2048}},"grant_types":{"type":"array","maxItems":2,"uniqueItems":true,"items":{"type":"string","enum":["authorization_code","refresh_token"]}},"response_types":{"type":"array","maxItems":1,"uniqueItems":true,"items":{"type":"string","enum":["code"]}},"token_endpoint_auth_method":{"type":"string","enum":["none","client_secret_post"]},"scope":{"type":"string","maxLength":1000},"client_uri":{"type":"string","maxLength":2048},"logo_uri":{"type":"string","maxLength":2048}}}}}},"x-public":true,"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string"},"scope":{"type":"string"},"client_id_issued_at":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/revoke":{"post":{"tags":["OAuth"],"description":"OAuth 2.0 Token Revocation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]},"client_id":{"type":"string"},"client_secret":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth-clients":{"post":{"tags":["OAuth Clients"],"description":"Create a new OAuth 2.0 client for your organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organization_id","name","redirect_uris","scopes"],"properties":{"organization_id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":1000},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1},"scopes":{"type":"array","items":{"type":"string","enum":["printers:read","printers:write","jobs:read","jobs:write","telemetry:read","models:read","models:write","files:read","files:write","print-jobs:read","print-jobs:write","inventory:read","inventory:write","makes:read","makes:write","fleet:read","fleet:write"]},"minItems":1},"is_public":{"type":"boolean","default":true}}}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"is_public":{"type":"boolean"},"created_at":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["OAuth Clients"],"description":"List OAuth 2.0 clients for your organization","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organization_id","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"is_public":{"type":"boolean"},"is_enabled":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth-clients/{clientId}":{"get":{"tags":["OAuth Clients"],"description":"Get details of a specific OAuth 2.0 client","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["OAuth Clients"],"description":"Update an OAuth 2.0 client","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":1000},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"}},"scopes":{"type":"array","items":{"type":"string","enum":["printers:read","printers:write","jobs:read","jobs:write","telemetry:read","models:read","models:write","files:read","files:write","print-jobs:read","print-jobs:write","inventory:read","inventory:write","makes:read","makes:write","fleet:read","fleet:write"]}},"is_enabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["OAuth Clients"],"description":"Delete an OAuth 2.0 client","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth-codes":{"post":{"summary":"Generate auth code","tags":["API Keys"],"description":"Generate a temporary authentication code for linking a hive-link bridge","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"expires_at":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/auth-codes/verify/{code}":{"get":{"summary":"Exchange auth code for API key","tags":["API Keys"],"description":"Exchange a temporary authentication code for an API key","parameters":[{"schema":{"type":"string"},"in":"path","name":"code","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"created_at":{"type":"string"},"expires_at":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"scopes":{"type":"array","items":{"type":"string"}},"verified":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/auth-codes/verify":{"post":{"summary":"Check auth code status","tags":["API Keys"],"description":"Check the status of a temporary authentication code","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"organizationId":{"type":"string","description":"Organization to attach the device to. Defaults to the caller's JWT org. Lets a multi-org user pair from the org they're viewing."}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string","enum":["pending","verified","used","expired"]},"verified_at":{"type":"string","nullable":true},"verified_by":{"type":"string","nullable":true},"used_at":{"type":"string","nullable":true},"used_by":{"type":"string","nullable":true},"expires_at":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys":{"post":{"summary":"Create API key","tags":["API Keys"],"description":"Create a new API key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scopes"],"properties":{"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List API keys","tags":["API Keys"],"description":"List all API keys for an organization","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["apiKeys"],"properties":{"apiKeys":{"type":"array","items":{"type":"object","required":["id","name","organizationId","createdAt","enabled","scopes"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"organizationId":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string","nullable":true},"lastUsedAt":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"scopes":{"type":"array","items":{"type":"string"}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/api-keys/{id}":{"patch":{"summary":"Update API key","tags":["API Keys"],"description":"Update an existing API key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"enabled":{"type":"boolean"},"expires_at":{"type":"string","format":"date-time"},"scopes":{"type":"array","items":{"type":"string"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete API key","tags":["API Keys"],"description":"Delete an API key","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/api-keys/{id}/logs":{"get":{"summary":"Get API key logs","tags":["API Keys"],"description":"Get usage logs for an API key","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files/{fileId}/metadata":{"get":{"summary":"Get file metadata","tags":["Files"],"description":"Retrieves metadata information for a specific file including size, type, and custom metadata","parameters":[{"schema":{"type":"string"},"in":"query","name":"print_job_id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_task_id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"claim_generation","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_task_access_token","required":false},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true,"description":"The unique identifier of the file"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"File metadata object","content":{"application/json":{"schema":{"description":"File metadata object","type":"object","required":["id","file_path","file_size","file_type","filename","metadata","model_id"],"properties":{"id":{"type":"string","description":"Unique identifier for the file"},"created_at":{"type":"string","format":"date-time","nullable":true,"description":"When the file was created"},"created_by":{"type":"string","nullable":true,"description":"User ID who created the file"},"filename":{"type":"string","description":"Original name of the file"},"file_path":{"type":"string","description":"Storage path of the file"},"file_type":{"type":"string","description":"MIME type of the file"},"file_size":{"type":"number","description":"Size of the file in bytes"},"model_id":{"type":"string","description":"Associated 3D model ID"},"metadata":{"type":"object","additionalProperties":true,"description":"Additional metadata associated with the file"},"activePlateNumber":{"type":"number","description":"Active plate number"},"project_filaments":{"type":"array","description":"Filaments used in the project","items":{"type":"object","properties":{"id":{"type":"string","description":"Filament ID"},"type":{"type":"string","description":"Filament type"},"color_hex":{"type":"string","description":"Filament color"},"color_rgba":{"type":"string","description":"Filament color RRGGBBAA in Hex format"},"used_m":{"type":"number","description":"Filament used meters"},"used_g":{"type":"number","description":"Filament used grams"}}}}}}}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"description":"File not found","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"File not found"},"message":{"type":"string","example":"The requested file does not exist"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Internal Server Error"},"message":{"type":"string","example":"An error occurred while retrieving the file metadata"}}}}}}}}},"/v1/files/{fileId}":{"get":{"summary":"Download file","tags":["Files"],"description":"Downloads the actual file content. The response will be the file stream with appropriate content-type headers.","parameters":[{"schema":{"type":"string"},"in":"query","name":"print_job_id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_task_id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"claim_generation","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_task_access_token","required":false},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true,"description":"The unique identifier of the file to download"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"404":{"description":"File not found","content":{"application/json":{"schema":{"description":"File not found","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"File not found"},"message":{"type":"string","example":"The requested file does not exist"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Internal Server Error"},"message":{"type":"string","example":"An error occurred while retrieving the file"}}}}}}}},"delete":{"summary":"Delete file","tags":["Files"],"description":"Soft-deletes a file row for sync consumers while retaining storage data for replay/grace-period recovery.","parameters":[{"schema":{"type":"string"},"in":"path","name":"fileId","required":true,"description":"The unique identifier of the file to delete"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"File deleted successfully","content":{"application/json":{"schema":{"description":"File deleted successfully","type":"object","properties":{"success":{"type":"boolean"}}}}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"description":"File not found","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"File not found"},"message":{"type":"string","example":"The requested file does not exist"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Internal Server Error"},"message":{"type":"string","example":"An error occurred while deleting the file"}}}}}}}}},"/v1/files/{fileId}/download-url":{"get":{"summary":"Get single-file download URL","tags":["Files"],"description":"Generates a signed download URL for one file while preserving legacy direct-vs-nested storage path compatibility.","parameters":[{"schema":{"type":"string"},"in":"query","name":"print_job_id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_task_id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"claim_generation","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_task_access_token","required":false},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true,"description":"The unique identifier of the file to sign"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Signed download URL","content":{"application/json":{"schema":{"description":"Signed download URL","type":"object","required":["download_url"],"properties":{"download_url":{"type":"string"}}}}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"description":"File not found","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"File not found"},"message":{"type":"string","example":"The requested file does not exist"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Internal Server Error"},"message":{"type":"string","example":"An error occurred while generating the download URL"}}}}}}}}},"/v1/files/{fileId}/restore":{"post":{"summary":"Restore Model File","tags":["Files"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"fileId","required":true}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"204":{"description":"Model File restored","content":{"application/json":{"schema":{"description":"Model File restored"}}}},"404":{"description":"Model File not found","content":{"application/json":{"schema":{"description":"Model File not found"}}}},"409":{"description":"Parent Model is unavailable","content":{"application/json":{"schema":{"description":"Parent Model is unavailable"}}}}}}},"/v1/models/{modelId}/files/audit":{"get":{"summary":"Audit model files","tags":["Files"],"description":"Lists all files for a model from both database and storage, identifying orphaned files that exist in storage but not in the database","parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"The unique identifier of the model"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"File audit results","content":{"application/json":{"schema":{"description":"File audit results","type":"object","required":["database_files","storage_files","orphaned_files","summary"],"properties":{"database_files":{"type":"array","description":"Files recorded in the database","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"file_path":{"type":"string"},"file_size":{"type":"number"},"file_type":{"type":"string"},"created_at":{"type":"string","nullable":true},"metadata":{"type":"object"}}}},"storage_files":{"type":"array","description":"Files found in storage bucket","items":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"last_accessed_at":{"type":"string","nullable":true},"metadata":{"type":"object"}}}},"orphaned_files":{"type":"array","description":"Files in storage but not in database","items":{"type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"},"size":{"type":"number"},"last_modified":{"type":"string","nullable":true}}}},"summary":{"type":"object","properties":{"total_database_files":{"type":"number"},"total_storage_files":{"type":"number"},"total_orphaned_files":{"type":"number"}}}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Model not found"},"message":{"type":"string","example":"The requested model does not exist"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Internal Server Error"},"message":{"type":"string","example":"An error occurred while auditing model files"}}}}}}}}},"/v1/models/{modelId}/files/cleanup":{"delete":{"summary":"Clean up orphaned files","tags":["Files"],"description":"Deletes orphaned files from storage that are not recorded in the database","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orphaned_file_paths"],"properties":{"orphaned_file_paths":{"type":"array","items":{"type":"string"},"description":"Array of file paths to delete"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"The unique identifier of the model"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Cleanup results","content":{"application/json":{"schema":{"description":"Cleanup results","type":"object","required":["success","deleted_files","failed_deletions"],"properties":{"success":{"type":"boolean"},"deleted_files":{"type":"array","items":{"type":"string"},"description":"Successfully deleted file paths"},"failed_deletions":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"error":{"type":"string"}}},"description":"Failed deletion attempts"}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Model not found"},"message":{"type":"string","example":"The requested model does not exist"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"Internal Server Error"},"message":{"type":"string","example":"An error occurred while cleaning up orphaned files"}}}}}}}}},"/v1/model-files/live-operations":{"get":{"summary":"Hydrate active and unresolved failed Model File operations","tags":["Model Files"],"description":"Returns a read-only organization snapshot from the existing Model File and processing-generation authorities.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files":{"get":{"summary":"List active or deleted model files for one model","tags":["Model Files"],"description":"Active listing excludes soft-deleted rows. Deleted listing returns tombstones intentionally and never piggybacks on the active response. Filter options are computed on the first page and omitted when offset is greater than zero.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"modelId","required":true},{"schema":{"type":"string","enum":["active","deleted"]},"in":"query","name":"view","required":true},{"schema":{"type":"string","maxLength":120},"in":"query","name":"search","required":false},{"schema":{"type":"string","maxLength":80,"pattern":"^(printing|queued|has_makes|missing_label)(,(printing|queued|has_makes|missing_label))*$"},"in":"query","name":"filters","required":false},{"schema":{"type":"string","maxLength":4096},"in":"query","name":"tags","required":false},{"schema":{"type":"string","maxLength":4096},"in":"query","name":"printer_profiles","required":false},{"schema":{"type":"string","maxLength":4096},"in":"query","name":"file_types","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"default":0},"in":"query","name":"offset","required":false}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/counts":{"get":{"summary":"Count active and deleted model files for one model","tags":["Model Files"],"description":"Returns exact partition counts without loading either model-file row collection.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"modelId","required":true}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{fileId}":{"get":{"summary":"Get one model file (active or deleted) for the workspace detail pane","tags":["Model Files"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"fileId","required":true}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{fileId}/filament-labels":{"patch":{"summary":"Update the sliced filament part labels for one active model file","tags":["Model Files"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["labels"],"additionalProperties":false,"properties":{"labels":{"type":"object","maxProperties":64,"additionalProperties":{"type":"string","maxLength":120}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"fileId","required":true}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{fileId}/reprocess":{"post":{"summary":"Queue an active model file for authenticated reprocessing","tags":["Model Files"],"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"fileId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{fileId}/reprocess/{commandId}":{"get":{"summary":"Read a durable model-file reprocess receipt","tags":["Model Files"],"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"fileId","required":true},{"schema":{"type":"string","minLength":1},"in":"path","name":"commandId","required":true}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{fileId}/overview":{"get":{"summary":"Get the file-scoped operator overview for the workspace detail pane","tags":["Model Files"],"description":"One typed read model combining core file metadata, Printing/Queued/Batches/Makes counts, the source-filament summary, SKU summary, and normalized action capabilities.","parameters":[{"schema":{"type":"string"},"in":"path","name":"fileId","required":true}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{fileId}/full-workshop/makes":{"post":{"summary":"Atomically create or update a Full Workshop Make","tags":["Makes"],"description":"Saves a Make's name, SKU association, quantity, default state, and full material mapping set as one transaction. Never reads or mutates inventory.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","materials"],"properties":{"make_id":{"type":"string","format":"uuid"},"expected_revision":{"type":"integer"},"name":{"type":"string","minLength":1},"sku_id":{"type":["string","null"],"format":"uuid"},"quantity_to_print":{"type":"integer","minimum":1,"default":1},"is_default":{"type":"boolean","default":false},"materials":{"type":"array","items":{"type":"object","required":["filament_index","material_id"],"properties":{"filament_index":{"type":"integer","minimum":0},"material_id":{"type":"string","format":"uuid"}}}},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"fileId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-events":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId","eventType","data","seqn","hostId","assignmentEpoch","deliveryAttempt","timestamp"],"properties":{"eventId":{"type":"string","minLength":1,"maxLength":200},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200},"eventType":{"type":"string","enum":["status","message","rawMessage","client:connect","client:disconnect","client:error","printer:dataUpdate","printer:deltaUpdate","printer:statusUpdate","printer:amsUpdate","printer:filamentStateChanged","printer:error","job:update","job:start","job:pause","job:offlineRecovery","job:unpause","job:finish","heartbeat","file:uploadStart","file:uploadComplete","file:uploadError","detection:failure","detection:warning","detection:bedEmpty","detection:complete"]},"data":{"type":"object","additionalProperties":true},"seqn":{"type":"number"},"hostId":{"type":"string"},"assignmentEpoch":{"type":"number"},"deliveryAttempt":{"type":"integer","minimum":1},"timestamp":{"type":"number"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"jobId":{"type":["null","number"]},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printer-events/batch":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["printerId","events","timestamp","hostId","assignmentEpoch"],"additionalProperties":false,"properties":{"batchId":{"type":"string","minLength":1,"maxLength":200},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200},"printerId":{"type":"string"},"events":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["eventId","type","timestamp","seqn","hostId","assignmentEpoch","deliveryAttempt","data"],"additionalProperties":false,"properties":{"eventId":{"type":"string","minLength":1,"maxLength":200},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200},"type":{"type":"string","enum":["status","message","rawMessage","client:connect","client:disconnect","client:error","printer:dataUpdate","printer:deltaUpdate","printer:statusUpdate","printer:amsUpdate","printer:filamentStateChanged","printer:error","job:update","job:start","job:pause","job:offlineRecovery","job:unpause","job:finish","heartbeat","file:uploadStart","file:uploadComplete","file:uploadError","detection:failure","detection:warning","detection:bedEmpty","detection:complete"]},"timestamp":{"type":"number"},"seqn":{"type":"number"},"hostId":{"type":"string"},"assignmentEpoch":{"type":"number"},"deliveryAttempt":{"type":"integer","minimum":1},"data":{"type":"object","additionalProperties":true},"persistedId":{"type":"string"}}}},"delta":{"type":"object","additionalProperties":true},"timestamp":{"type":"number"},"maxSeqn":{"type":"number"},"hostId":{"type":"string"},"assignmentEpoch":{"type":"number"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success","processed"],"properties":{"success":{"type":"boolean"},"processed":{"type":"number"},"failed":{"type":"number"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"code":{"type":"string"},"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printer-config":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"host_id","required":false},{"schema":{"type":"string"},"in":"query","name":"name","required":false},{"schema":{"type":"string"},"in":"query","name":"serial_number","required":false},{"schema":{"type":"string"},"in":"query","name":"ip_address","required":false},{"schema":{"type":"boolean"},"in":"query","name":"include_incomplete","required":false},{"schema":{"type":"boolean"},"in":"query","name":"enabled_only","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["printers"],"properties":{"printers":{"type":"array","items":{"type":"object","required":["id","name","serial_number","ip_address","access_token","organization_id"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"serial_number":{"type":"string"},"ip_address":{"type":"string"},"access_token":{"type":"string"},"organization_id":{"type":"string"},"printer_type":{"type":"string","enum":["bambu","prusa_connect","octoprint","klipper","snapmaker","flashforge"]},"api_key":{"type":"string"},"port":{"type":"number"},"communication_protocol":{"type":"string","enum":["mqtt","http","websocket","serial"]},"capabilities":{"type":"object"},"secure":{"type":"boolean"},"timeout":{"type":"number"},"reconnect_interval":{"type":"number"},"model":{"type":"string"}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","ip_address"],"properties":{"name":{"type":"string"},"ip_address":{"type":"string"},"serial_number":{"type":"string"},"model":{"type":"string"},"access_token":{"type":"string"},"enabled":{"type":"boolean","default":false},"host_id":{"type":"string"},"discovery_method":{"type":"string"},"discovered_at":{"type":"string","format":"date-time"},"printer_type":{"type":"string","enum":["bambu","prusa_connect","octoprint","klipper","snapmaker","flashforge"],"default":"bambu"},"api_key":{"type":"string"},"port":{"type":"number"},"communication_protocol":{"type":"string","enum":["mqtt","http","websocket","serial"]},"capabilities":{"type":"object"},"secure":{"type":"boolean","default":true},"timeout":{"type":"number","default":30000},"reconnect_interval":{"type":"number","default":5000}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","success"],"properties":{"id":{"type":"string"},"success":{"type":"boolean"},"updated":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printer-config/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["printer"],"properties":{"printer":{"type":"object","required":["id","name","ip_address","organization_id"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"serial_number":{"type":"string"},"ip_address":{"type":"string"},"access_token":{"type":"string"},"organization_id":{"type":"string"},"printer_type":{"type":"string"},"api_key":{"type":"string"},"port":{"type":"number"},"secure":{"type":"boolean"},"timeout":{"type":"number"},"model":{"type":"string"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"ip_address":{"type":"string"},"serial_number":{"type":"string"},"model":{"type":"string"},"access_token":{"type":"string"},"enabled":{"type":"boolean"},"printer_type":{"type":"string","enum":["bambu","prusa_connect","octoprint","klipper","snapmaker","flashforge"]},"api_key":{"type":"string"},"port":{"type":"number"},"communication_protocol":{"type":"string","enum":["mqtt","http","websocket","serial"]},"capabilities":{"type":"object"},"secure":{"type":"boolean"},"timeout":{"type":"number"},"reconnect_interval":{"type":"number"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printer-config/{id}/connection-status":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["is_connected","last_heartbeat"],"properties":{"is_connected":{"type":"boolean"},"last_heartbeat":{"type":"string","format":"date-time"},"status":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printer-config/{id}/test-connection":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/filaments/assign":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slots"],"properties":{"jobId":{"type":"number","nullable":true},"slots":{"type":"array","minItems":1,"items":{"type":"object","required":["position"],"properties":{"position":{"type":"number"},"materialId":{"type":"string","nullable":true},"materialType":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"vendor":{"type":"string","nullable":true}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/maintenance":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["maintenance"],"properties":{"maintenance":{"type":"boolean"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","nullable":true},"reason":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/operator-device-start":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/ready":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ready"],"properties":{"ready":{"type":"boolean"},"ready_source":{"type":"string","nullable":true,"enum":["operator_override",null],"description":"Explicit source for a ready=true operator override"},"ready_updated_source":{"type":"string","enum":["operator_override"],"description":"Explicit transition owner for an operator-initiated ready=false command"},"metadata":{"type":"object","nullable":true},"job_id":{"type":"number","nullable":true},"event_type":{"type":"string","nullable":true,"enum":["operator:manual_verification:success","operator:manual_verification:failed","operator:manual_verification:cancelled","operator:manual_verification:skipped",null]},"failure_reason":{"type":"string","nullable":true,"enum":["blob_of_death","extrusion_issue","nozzle_clog","under_extrusion","over_extrusion","spaghetti","layer_shift","bed_adhesion","stringing","warping","z_banding","filament_runout","power_failure","mechanical_failure","other"],"description":"Reason for failure when event_type is failed (for training data)"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"},"requeue_failed":{"type":"boolean","nullable":true,"description":"When true and the job belongs to a batch, requeue the failed job for the batch"},"part_verifications":{"type":"array","nullable":true,"items":{"type":"object","required":["part_name","good_count","defective_count","action"],"properties":{"part_name":{"type":"string"},"good_count":{"type":"integer","minimum":0},"defective_count":{"type":"integer","minimum":0},"action":{"type":"string","enum":["reprint","skip","accept"]}}},"description":"Per-part verification results"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success","pending","message"],"properties":{"success":{"type":"boolean"},"pending":{"type":"boolean"},"message":{"type":"string"}}}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success","pending","message"],"properties":{"success":{"type":"boolean"},"pending":{"type":"boolean","enum":[true]},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"owner_type":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"briefing":{"type":"object","additionalProperties":false,"required":["decision","summary","actions","evidence"],"properties":{"summary":{"type":"string"},"decision":{"type":"string","enum":["releasable_unlocked","releasable_named_blocker","already_converged","changed_blocker","verification_in_progress","nonterminal_job","adjudication_required","completed_job_blocker_required","printer_not_found","organization_mismatch"]},"actions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","enabled","label","why","whyCode"],"properties":{"id":{"type":"string","enum":["attest_unlocked","release_current_lock","adjudicate_and_release","wait_for_bov","trigger_bov"]},"enabled":{"type":"boolean"},"label":{"type":"string"},"why":{"type":"string"},"whyCode":{"type":"string"},"recommended":{"type":"boolean","enum":[true]}}}},"evidence":{"type":"object","additionalProperties":false,"required":["currentLock","intendedJobId","livePrint","bedOccupancyVerification","taskId","environment"],"properties":{"currentLock":{"type":["null","object"],"additionalProperties":false,"required":["jobId","name","status"],"properties":{"jobId":{"type":"integer"},"name":{"type":["null","string"]},"status":{"type":"string"}}},"intendedJobId":{"type":["null","integer"]},"livePrint":{"type":["null","object"],"additionalProperties":false,"required":["jobId","status"],"properties":{"jobId":{"type":"integer"},"status":{"type":"string"}}},"bedOccupancyVerification":{"type":["null","object"],"additionalProperties":false,"required":["status","ownerId","deliveryState","leaseExpiresAt","hold"],"properties":{"status":{"type":["null","string"]},"ownerId":{"type":["null","string"]},"deliveryState":{"type":["null","string"],"enum":["leased","acknowledged",null]},"leaseExpiresAt":{"type":["null","string"]},"hold":{"type":["null","string"]}}},"taskId":{"type":"object","additionalProperties":false,"required":["value","matchesPrintHiveJobId"],"properties":{"value":{"type":["null","string"]},"matchesPrintHiveJobId":{"type":"boolean"}}},"environment":{"type":"object","additionalProperties":false,"required":["connected","maintenance","setupRequired","gcode","claimabilityPhase"],"properties":{"connected":{"type":["null","boolean"]},"maintenance":{"type":["null","boolean"]},"setupRequired":{"type":["null","boolean"]},"gcode":{"type":["null","string"]},"claimabilityPhase":{"type":"string"}}}}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/commands":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["command"],"additionalProperties":true,"properties":{"command":{"type":"string","enum":["amsFilamentDrying","cleanPrintError","goHome","loadFilament","pause","refreshPrinterState","resume","stop","stopBuzzer","unloadFilament","updateFan","updateLight","updateSpeed","updateTemp"]},"params":{"type":"object","nullable":true,"additionalProperties":true,"properties":{"light":{"type":"string","enum":["chamber_light","work_light"]},"isOn":{"type":"boolean"},"mode":{"anyOf":[{"type":"string","enum":["on","off"]},{"type":"number","enum":[0,1]}]},"fan":{"type":"string","enum":["part_cooling","part","auxiliary","aux","chamber"]},"speed":{"type":"number","minimum":0,"maximum":100},"part":{"type":"string","enum":["bed","nozzle","chamber"]},"temperature":{"type":"number","minimum":0,"maximum":300},"cleanPrintError":{"type":"boolean"},"subtaskId":{"type":"string"},"printError":{"type":"number","minimum":0},"extruder":{"type":"number","minimum":0,"maximum":3},"amsId":{"type":"number","minimum":0,"maximum":3},"filament":{"type":"string"},"temp":{"type":"number","minimum":0,"maximum":100},"duration":{"type":"number","minimum":0,"maximum":1440},"rotateTray":{"type":"boolean"},"coolingTemp":{"type":"number","minimum":0,"maximum":100},"confirm":{"type":"boolean"}}},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"command":{"type":"string"},"message":{"type":"string"},"response":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/filaments/{position}":{"put":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["materialId"],"additionalProperties":false,"properties":{"customColor":{"type":["string","null"]},"customMaterialType":{"type":["string","null"]},"materialId":{"type":"string"},"syncPrinter":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"position","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"assignment":{"type":"object","additionalProperties":true},"printerSync":{"type":"object","properties":{"attempted":{"type":"boolean"},"ok":{"type":["null","boolean"]},"reason":{"type":"string"},"response":{"type":"object","additionalProperties":true}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"position","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/ftp-health/failure":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["error_code"],"properties":{"error_code":{"type":"string","minLength":1},"probe_token":{"type":"string","format":"uuid"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/ftp-health/success":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"probe_token":{"type":"string","format":"uuid"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/next-job":{"post":{"parameters":[{"schema":{"type":"string","enum":["true","false"],"default":"false"},"in":"query","name":"dry_run","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"header","name":"x-hive-retry-handoff-version","required":false},{"schema":{"type":"string"},"in":"header","name":"x-hive-claim-generation-version","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"organization_id":{"type":"string"},"printer_id":{"type":"string"},"material":{"type":"string"},"progress":{"type":"number"},"status":{"type":"string"},"claim_generation":{"type":"string","format":"uuid"},"ftp_probe_token":{"type":"string","nullable":true},"retry_handoff_expires_at":{"type":"string","format":"date-time","nullable":true},"printer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"serial_number":{"type":"string"}}},"print_options":{"type":"object","nullable":true,"properties":{"enable_ams":{"type":"boolean"},"ams_mapping":{"type":"array","items":{"type":"number"}},"enable_bed_leveling":{"type":"boolean"},"force_download":{"type":"boolean"},"timelapse":{"type":"boolean"},"task_layer_inspect":{"type":"boolean"}},"additionalProperties":true},"model_file":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"filename":{"type":"string"},"file_path":{"type":"string"},"file_type":{"type":"string"},"file_size":{"type":"number"},"created_at":{"type":"string"},"metadata":{"type":"object"}}}}},"match":{"type":"object","nullable":true,"properties":{"score":{"type":"number"},"reasons":{"type":"array","items":{"type":"string"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"null"},"reason":{"type":"string"},"message":{"type":"string"},"retry_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"next_eligible_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/lock":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["job_id"],"properties":{"job_id":{"type":"number"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/status":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","nullable":true},"offline":{"type":"boolean"},"maintenance_mode":{"type":"boolean"},"ready":{"type":"boolean"},"ready_source":{"type":"string","nullable":true,"enum":["bed_occupancy_verified","operator_override","lock_recovery",null]},"ready_updated_source":{"type":"string","enum":["bed_occupancy_verification","operator_override","lock_recovery","fresh_job_claim","retry_job_claim","job_lock","auto_bed_clear","maintenance","printer_disabled","post_completion","admin_bed_occupancy_test","printer_created","legacy_compatibility","legacy_backfill"]},"locked_by_job_id":{"type":"number","nullable":true}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/frame":{"get":{"parameters":[{"schema":{"type":"number","default":5000},"in":"query","name":"max_age","required":false},{"schema":{"type":"number"},"in":"query","name":"job_id","required":false},{"schema":{"type":"string"},"in":"query","name":"subtask_id","required":false},{"schema":{"type":"boolean","default":false},"in":"query","name":"force_fresh","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cached":{"type":"boolean"},"frame":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"storage_path":{"type":"string"},"captured_at":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/delete":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean","default":false},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/upload-speed":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"model","required":false,"description":"Printer model to get speed for (optional, returns all if omitted)"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"model":{"type":"string"},"avgBytesPerSecond":{"type":"number"},"sampleCount":{"type":"number"}}},{"type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"avgBytesPerSecond":{"type":"number"},"sampleCount":{"type":"number"}}}}}}]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/orphaned-jobs":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"printer_ids","required":true,"description":"Comma-separated list of printer IDs to check"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"orphanedJobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"printer_id":{"type":"string"},"claim_generation":{"type":"string","format":"uuid"},"retry_handoff_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"status":{"type":"string"},"name":{"type":"string"},"retry_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"max_retries":{"anyOf":[{"type":"number"},{"type":"null"}]},"next_eligible_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"terminal_reason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/printers/{id}/bed-occupancy-verification-config":{"get":{"tags":["Printers"],"description":"Get Bed Occupancy Verification production rollout config for a printer","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Printers"],"description":"Update Bed Occupancy Verification production rollout config for a printer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"bed_occupancy_verification_enabled":{"type":"boolean"},"inspection_z_buffer":{"type":"number","minimum":1,"maximum":20},"bed_occupancy_empty_bed_threshold":{"type":"number","minimum":0.5,"maximum":0.99},"bed_occupancy_max_attempts":{"type":"integer","minimum":1,"maximum":10}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/stage-1-rollout-evidence":{"put":{"tags":["Printers"],"description":"Record supervised Stage 1 hardware validation evidence for the current printer model and hardware profile","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["evidence_reference"],"properties":{"evidence_reference":{"type":"string","minLength":1,"maxLength":500}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Printers"],"description":"Clear Stage 1 hardware validation evidence for a printer","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/auto-bed-clear-enabled":{"put":{"tags":["Printers"],"description":"Enable or disable Auto Bed Clear for a printer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["enabled"],"properties":{"enabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/stage-1-hardware-profile":{"get":{"tags":["Printers"],"description":"Get the configured Stage 1 Hardware Profile and derived usable Z for a printer","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Printers"],"description":"Set the Stage 1 Hardware Profile for a printer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hardware_profile"],"properties":{"hardware_profile":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/ejection-config":{"get":{"tags":["Printers"],"description":"Get ejection config for a printer","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Printers"],"description":"Set ejection config for a printer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ejection_config":{"type":"object"}},"required":["ejection_config"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Printers"],"description":"Reset ejection config for a printer","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/test-ejection":{"post":{"tags":["Printers"],"description":"Human-armed, admin-only supervised Stage 1 validation through the canonical lock/planner/executor/BOV chain","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["job_id","motion_confirmed","expected_plan_hash"],"properties":{"job_id":{"type":"integer","minimum":1},"motion_confirmed":{"type":"boolean","enum":[true]},"expected_plan_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/xcam-settings":{"get":{"tags":["Printers"],"description":"Get XCam AI failure-detection settings for a printer","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Printers"],"description":"Update XCam AI failure-detection settings for a printer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"spaghetti_detector":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"sensitivity":{"type":"string","enum":["low","medium","high","never_halt"]}}},"pileup_detector":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"sensitivity":{"type":"string","enum":["low","medium","high","never_halt"]}}},"clump_detector":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"sensitivity":{"type":"string","enum":["low","medium","high","never_halt"]}}},"airprint_detector":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"sensitivity":{"type":"string","enum":["low","medium","high","never_halt"]}}},"first_layer_inspector":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"sensitivity":{"type":"string","enum":["low","medium","high","never_halt"]}}},"filament_tangle_detector":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"sensitivity":{"type":"string","enum":["low","medium","high","never_halt"]}}},"nozzle_blob_detector":{"type":"object","additionalProperties":false,"properties":{"enabled":{"type":"boolean"},"sensitivity":{"type":"string","enum":["low","medium","high","never_halt"]}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/release/preview":{"post":{"summary":"Explain what Operator Ready Override would do to this printer","tags":["Printer Control"],"description":"Dry-run of the Operator Release tree. It writes no ready, lock, watch, or Bed Occupancy Verification state. Omit expectedCompletedJobId, or send null, for unlocked intent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"expectedCompletedJobId":{"type":["integer","null"],"minimum":1,"description":"The Completed Job Blocker Lock the operator names. Null is unlocked intent."}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["briefing"],"properties":{"briefing":{"type":"object","additionalProperties":false,"required":["decision","summary","actions","evidence"],"properties":{"summary":{"type":"string"},"decision":{"type":"string","enum":["releasable_unlocked","releasable_named_blocker","already_converged","changed_blocker","verification_in_progress","nonterminal_job","adjudication_required","completed_job_blocker_required","printer_not_found","organization_mismatch"]},"actions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","enabled","label","why","whyCode"],"properties":{"id":{"type":"string","enum":["attest_unlocked","release_current_lock","adjudicate_and_release","wait_for_bov","trigger_bov"]},"enabled":{"type":"boolean"},"label":{"type":"string"},"why":{"type":"string"},"whyCode":{"type":"string"},"recommended":{"type":"boolean","enum":[true]}}}},"evidence":{"type":"object","additionalProperties":false,"required":["currentLock","intendedJobId","livePrint","bedOccupancyVerification","taskId","environment"],"properties":{"currentLock":{"type":["null","object"],"additionalProperties":false,"required":["jobId","name","status"],"properties":{"jobId":{"type":"integer"},"name":{"type":["null","string"]},"status":{"type":"string"}}},"intendedJobId":{"type":["null","integer"]},"livePrint":{"type":["null","object"],"additionalProperties":false,"required":["jobId","status"],"properties":{"jobId":{"type":"integer"},"status":{"type":"string"}}},"bedOccupancyVerification":{"type":["null","object"],"additionalProperties":false,"required":["status","ownerId","deliveryState","leaseExpiresAt","hold"],"properties":{"status":{"type":["null","string"]},"ownerId":{"type":["null","string"]},"deliveryState":{"type":["null","string"],"enum":["leased","acknowledged",null]},"leaseExpiresAt":{"type":["null","string"]},"hold":{"type":["null","string"]}}},"taskId":{"type":"object","additionalProperties":false,"required":["value","matchesPrintHiveJobId"],"properties":{"value":{"type":["null","string"]},"matchesPrintHiveJobId":{"type":"boolean"}}},"environment":{"type":"object","additionalProperties":false,"required":["connected","maintenance","setupRequired","gcode","claimabilityPhase"],"properties":{"connected":{"type":["null","boolean"]},"maintenance":{"type":["null","boolean"]},"setupRequired":{"type":["null","boolean"]},"gcode":{"type":["null","string"]},"claimabilityPhase":{"type":"string"}}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"briefing":{"type":"object","additionalProperties":false,"required":["decision","summary","actions","evidence"],"properties":{"summary":{"type":"string"},"decision":{"type":"string","enum":["releasable_unlocked","releasable_named_blocker","already_converged","changed_blocker","verification_in_progress","nonterminal_job","adjudication_required","completed_job_blocker_required","printer_not_found","organization_mismatch"]},"actions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","enabled","label","why","whyCode"],"properties":{"id":{"type":"string","enum":["attest_unlocked","release_current_lock","adjudicate_and_release","wait_for_bov","trigger_bov"]},"enabled":{"type":"boolean"},"label":{"type":"string"},"why":{"type":"string"},"whyCode":{"type":"string"},"recommended":{"type":"boolean","enum":[true]}}}},"evidence":{"type":"object","additionalProperties":false,"required":["currentLock","intendedJobId","livePrint","bedOccupancyVerification","taskId","environment"],"properties":{"currentLock":{"type":["null","object"],"additionalProperties":false,"required":["jobId","name","status"],"properties":{"jobId":{"type":"integer"},"name":{"type":["null","string"]},"status":{"type":"string"}}},"intendedJobId":{"type":["null","integer"]},"livePrint":{"type":["null","object"],"additionalProperties":false,"required":["jobId","status"],"properties":{"jobId":{"type":"integer"},"status":{"type":"string"}}},"bedOccupancyVerification":{"type":["null","object"],"additionalProperties":false,"required":["status","ownerId","deliveryState","leaseExpiresAt","hold"],"properties":{"status":{"type":["null","string"]},"ownerId":{"type":["null","string"]},"deliveryState":{"type":["null","string"],"enum":["leased","acknowledged",null]},"leaseExpiresAt":{"type":["null","string"]},"hold":{"type":["null","string"]}}},"taskId":{"type":"object","additionalProperties":false,"required":["value","matchesPrintHiveJobId"],"properties":{"value":{"type":["null","string"]},"matchesPrintHiveJobId":{"type":"boolean"}}},"environment":{"type":"object","additionalProperties":false,"required":["connected","maintenance","setupRequired","gcode","claimabilityPhase"],"properties":{"connected":{"type":["null","boolean"]},"maintenance":{"type":["null","boolean"]},"setupRequired":{"type":["null","boolean"]},"gcode":{"type":["null","string"]},"claimabilityPhase":{"type":"string"}}}}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/printer-control/operator-release-batches":{"post":{"summary":"Release an immutable batch of completed-job blockers","tags":["Printer Control"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirmation","targets"],"properties":{"confirmation":{"type":"boolean","enum":[true]},"targets":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","additionalProperties":false,"required":["printerId","expectedCompletedJobId","targetSnapshot"],"properties":{"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string","minLength":1,"maxLength":500},"completedJobName":{"type":"string","minLength":1,"maxLength":500},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"header","name":"idempotency-key","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batch"],"properties":{"batch":{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","retryableCount","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["operator_release"]},"actorUserId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["rest","eve","hex"]},"consent":{"anyOf":[{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["operator_release_batch_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["legacy_hex_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"}}}]},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","completed","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":1000},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"retryableCount":{"type":"integer","minimum":0},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","retryable","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string","minLength":1,"maxLength":500},"completedJobName":{"type":"string","minLength":1,"maxLength":500},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","executing","released","already_converged","skipped","conflict","indeterminate"]},"reasonCode":{"anyOf":[{"type":"string","enum":["operator_ready_override","already_operator_released","completed_job_blocker_changed","newer_claim","verification_in_progress","completed_job_blocker_required","nonterminal_job","adjudication_required","target_unavailable","organization_mismatch","release_state_ambiguous","execution_error"]},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"},"statusCode":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}},"get":{"summary":"List recent Operator Release Batch receipts","tags":["Printer Control"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batches"],"properties":{"batches":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","retryableCount","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["operator_release"]},"actorUserId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["rest","eve","hex"]},"consent":{"anyOf":[{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["operator_release_batch_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["legacy_hex_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"}}}]},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","completed","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":1000},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"retryableCount":{"type":"integer","minimum":0},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","retryable","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string","minLength":1,"maxLength":500},"completedJobName":{"type":"string","minLength":1,"maxLength":500},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","executing","released","already_converged","skipped","conflict","indeterminate"]},"reasonCode":{"anyOf":[{"type":"string","enum":["operator_ready_override","already_operator_released","completed_job_blocker_changed","newer_claim","verification_in_progress","completed_job_blocker_required","nonterminal_job","adjudication_required","target_unavailable","organization_mismatch","release_state_ambiguous","execution_error"]},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"},"statusCode":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/printer-control/operator-release-batches/{batchId}":{"get":{"summary":"Restore one durable Operator Release Batch receipt","tags":["Printer Control"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"batchId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batch"],"properties":{"batch":{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","retryableCount","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["operator_release"]},"actorUserId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["rest","eve","hex"]},"consent":{"anyOf":[{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["operator_release_batch_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["legacy_hex_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"}}}]},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","completed","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":1000},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"retryableCount":{"type":"integer","minimum":0},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","retryable","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string","minLength":1,"maxLength":500},"completedJobName":{"type":"string","minLength":1,"maxLength":500},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","executing","released","already_converged","skipped","conflict","indeterminate"]},"reasonCode":{"anyOf":[{"type":"string","enum":["operator_ready_override","already_operator_released","completed_job_blocker_changed","newer_claim","verification_in_progress","completed_job_blocker_required","nonterminal_job","adjudication_required","target_unavailable","organization_mismatch","release_state_ambiguous","execution_error"]},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"},"statusCode":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/printer-control/operator-release-batches/{batchId}/retry":{"post":{"summary":"Retry unresolved items in an Operator Release Batch","tags":["Printer Control"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"batchId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batch"],"properties":{"batch":{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","retryableCount","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["operator_release"]},"actorUserId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["rest","eve","hex"]},"consent":{"anyOf":[{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["operator_release_batch_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","confirmedAt"],"properties":{"kind":{"type":"string","enum":["legacy_hex_confirmation"]},"confirmedAt":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"}}}]},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","completed","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":1000},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"retryableCount":{"type":"integer","minimum":0},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","retryable","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string","minLength":1,"maxLength":500},"completedJobName":{"type":"string","minLength":1,"maxLength":500},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","executing","released","already_converged","skipped","conflict","indeterminate"]},"reasonCode":{"anyOf":[{"type":"string","enum":["operator_ready_override","already_operator_released","completed_job_blocker_changed","newer_claim","verification_in_progress","completed_job_blocker_required","nonterminal_job","adjudication_required","target_unavailable","organization_mismatch","release_state_ambiguous","execution_error"]},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"retryable":{"type":"boolean"},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"},"statusCode":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/printer-control/triggered-bov-batches":{"post":{"summary":"Trigger Bed Occupancy Verification for completed jobs","tags":["Printer Control"],"description":"Moves the printer Z axis, captures the bed, and releases only after a definitive verified-empty result.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["confirmation","zMotionAcknowledged","targets"],"properties":{"confirmation":{"type":"boolean","enum":[true]},"zMotionAcknowledged":{"type":"boolean","enum":[true]},"targets":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["printerId","expectedCompletedJobId","targetSnapshot"],"properties":{"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string","minLength":1,"maxLength":500},"completedJobName":{"type":"string","minLength":1,"maxLength":500},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"header","name":"idempotency-key","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batch","requestId"],"properties":{"batch":{"oneOf":[{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["web"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["triggered_bov_batch_confirmation"]},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}},{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["hex"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}}]},"requestId":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}},"get":{"summary":"List recent Triggered BOV receipts","tags":["Printer Control"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batches","requestId"],"properties":{"batches":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["web"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["triggered_bov_batch_confirmation"]},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}},{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["hex"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}}]}},"requestId":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/printer-control/triggered-bov-batches/{batchId}/cancel":{"post":{"summary":"Safely cancel a Triggered BOV batch","tags":["Printer Control"],"description":"Stops untouched inspections immediately while already-started inspections settle and restore safely.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"batchId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batch","requestId"],"properties":{"batch":{"oneOf":[{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["web"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["triggered_bov_batch_confirmation"]},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}},{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["hex"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}}]},"requestId":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/printer-control/triggered-bov-batches/{batchId}":{"get":{"summary":"Restore one Triggered BOV receipt","tags":["Printer Control"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"batchId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["batch","requestId"],"properties":{"batch":{"oneOf":[{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["web"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["triggered_bov_batch_confirmation"]},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}},{"type":"object","additionalProperties":false,"required":["id","organizationId","action","actorUserId","channel","consent","idempotencyKey","targetFingerprint","status","stage","attempt","revision","targetCount","successCount","conflictCount","cancelledCount","cancellationRequestedAt","cancellationRequestedByUserId","startedAt","completedAt","updatedAt","items"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["triggered_bov"]},"actorUserId":{"type":"string","format":"uuid"},"idempotencyKey":{"type":"string"},"targetFingerprint":{"type":"string"},"status":{"type":"string","enum":["active","cancelling","cancelled","completed","completed_with_cancelled_items","completed_with_conflicts","failed"]},"stage":{"type":"string"},"attempt":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"targetCount":{"type":"integer","minimum":1,"maximum":25},"successCount":{"type":"integer","minimum":0},"conflictCount":{"type":"integer","minimum":0},"cancelledCount":{"type":"integer","minimum":0},"cancellationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancellationRequestedByUserId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","additionalProperties":false,"required":["id","ordinal","printerId","expectedCompletedJobId","targetSnapshot","status","reasonCode","evidenceRef","executionRef","watchRef","attempt","startedAt","completedAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"ordinal":{"type":"integer","minimum":0,"maximum":24},"printerId":{"type":"string","format":"uuid"},"expectedCompletedJobId":{"type":"integer","minimum":1},"targetSnapshot":{"type":"object","additionalProperties":false,"required":["printerName","completedJobName","completedJobStatus"],"properties":{"printerName":{"type":"string"},"completedJobName":{"type":"string"},"completedJobStatus":{"type":"string","enum":["COMPLETED"]}}},"status":{"type":"string","enum":["pending","queued","throttled","reused","accepted","executing","released","already_converged","occupied","inconclusive","unsupported","stale","infrastructure_failure","cancelled"]},"reasonCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidenceRef":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"executionRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"watchRef":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"attempt":{"type":"integer","minimum":0},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}}}},"channel":{"type":"string","enum":["hex"]},"consent":{"type":"object","additionalProperties":false,"required":["kind","proposalId","proposalVersion","decisionReceiptId","executionReceiptId","targetFingerprint","confirmedAt","zMotionAcknowledged"],"properties":{"kind":{"type":"string","enum":["eve_operation_proposal"]},"proposalId":{"type":"string"},"proposalVersion":{"type":"integer"},"decisionReceiptId":{"type":"string"},"executionReceiptId":{"type":"string"},"targetFingerprint":{"type":"string"},"confirmedAt":{"type":"string"},"zMotionAcknowledged":{"type":"boolean","enum":[true]}}}}}]},"requestId":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message","requestId"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/support/bov-timeline":{"get":{"summary":"Read the durable BOV and Bed-Clear Watch chronology","tags":["Support"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printerId","required":false},{"schema":{"type":"integer","minimum":1},"in":"query","name":"completedJobId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"watchId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"batchId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"batchItemId","required":false},{"schema":{"type":"integer","minimum":1,"maximum":1000},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/bed-occupancy-statuses":{"get":{"summary":"List Bed Occupancy occupancy views","tags":["Printers"],"description":"Return stripped occupancy facts for open Bed-Clear Watches and in-flight production Bed Occupancy Verification runs in the verified organization.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printerId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["printerId","watchPresence","watchJobId","inFlight"],"properties":{"printerId":{"type":"string"},"watchPresence":{"type":"string","enum":["active","suspended","dormant"]},"watchJobId":{"type":"integer"},"inFlight":{"type":"boolean"}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/smart-queue/aging":{"get":{"summary":"Smart Queue aging summary","tags":["Smart Queue"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"maximum":86400,"default":0},"in":"query","name":"minAgeMinutes","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/smart-queue-trace":{"get":{"summary":"Read-only Smart Queue decision trace for a printer","tags":["Printers"],"description":"Explains what the next-job claim path would do for this printer without claiming a job, mutating print options, reserving a circuit, or locking the printer.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/intervention-bundle-plan":{"get":{"summary":"Plan Smart Queue intervention bundles","tags":["Smart Queue"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"candidate_limit","required":false},{"schema":{"type":"string"},"in":"query","name":"max_scanned_jobs","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/intervention-bundle-plan/promote":{"post":{"summary":"Promote selected intervention bundle actions into receipts","tags":["Smart Queue"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["bundle_id","action_keys"],"additionalProperties":false,"properties":{"bundle_id":{"type":"string","minLength":1},"action_keys":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"string","minLength":1}},"allow_partial":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/print-jobs/create":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","model_file_id"],"properties":{"name":{"type":"string"},"model_file_id":{"type":"string"},"organization_id":{"type":"string"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"},"printer_id":{"type":"string","nullable":true},"task_id":{"type":"string"},"make_id":{"type":"string","description":"Optional make ID to derive required materials"},"print_options":{"type":"object","properties":{"enable_ams":{"type":"boolean"},"enable_bed_leveling":{"type":"boolean"},"start_immediately":{"type":"boolean"},"set_printer_ready":{"type":"boolean","description":"Deprecated compatibility alias for start_immediately"},"auto_assign":{"type":"boolean"},"constraints":{"type":"object"}},"additionalProperties":true}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","additionalProperties":true},"eligiblePrinters":{"type":"array","description":"Detailed match results for fully eligible printers","items":{"type":"object","properties":{"printerId":{"type":"string"},"match":{"type":"object","properties":{"score":{"type":"number"},"reasons":{"type":"array","items":{"type":"string"}},"matched_at":{"type":"string"},"printer_id":{"type":"string"}}}}}},"partiallyEligiblePrinters":{"type":"array","description":"Detailed match results for partially eligible printers including missing materials","items":{"type":"object","properties":{"printerId":{"type":"string"},"match":{"type":"object","properties":{"score":{"type":"number"},"reasons":{"type":"array","items":{"type":"string"}},"matched_at":{"type":"string"},"printer_id":{"type":"string"},"missing":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"type":{"type":"string"},"color":{"type":"string"},"explicitMaterialId":{"type":"string"}}}}}}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"retry_count":{"type":"number"},"max_retries":{"type":"number"},"next_eligible_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/duplicate":{"post":{"summary":"Duplicate a completed print job","tags":["Print Jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force_download":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/print-jobs/reorder":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["scope","ordered_job_ids"],"properties":{"scope":{"type":"string","enum":["printer","global"]},"printer_id":{"type":"string"},"ordered_job_ids":{"type":"array","items":{"type":"number"},"minItems":1},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/assign":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["printer_id"],"properties":{"printer_id":{"type":["string","null"]},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"printer_id":{"type":["null","string"]},"queue_rank":{"type":["null","number"]},"global_queue_rank":{"type":["null","number"]},"status":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"model_file_id":{"type":"string"},"model_id":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"model_file_id":{"type":"string"},"model_id":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"model_file_id":{"type":"string"},"model_id":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"},"model_file_id":{"type":"string"},"model_id":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/start":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"printer_id":{"type":["null","string"]},"queue_rank":{"type":["null","number"]},"global_queue_rank":{"type":["null","number"]},"status":{"type":"string"},"dispatch":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"/v1/print-jobs":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"printer_ids":{"type":"array","items":{"type":"string"},"description":"Array of printer IDs to filter by"},"status":{"type":"string","enum":["QUEUED","IN_PROGRESS","COMPLETED","FAILED","ERROR","RETRYING","PAUSED","CANCELLED"],"description":"Filter jobs by status"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"printJobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"organizationId":{"type":"string","nullable":true},"printerId":{"type":"string","nullable":true},"material":{"type":"string","nullable":true},"progress":{"type":"number","nullable":true},"status":{"type":"string"},"print_options":{"type":"object","nullable":true,"properties":{"enable_ams":{"type":"boolean"},"enable_bed_leveling":{"type":"boolean"},"ams_mapping":{"type":["array","string"],"items":{"type":"number"}},"force_download":{"type":"boolean","default":false},"timelapse":{"type":"boolean","default":false},"task_layer_inspect":{"type":"boolean","default":false}}},"printer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"serial_number":{"type":"string"}}},"model_file":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"filename":{"type":"string"}}},"startTime":{"type":"string","format":"date-time","nullable":true},"estimatedEndTime":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time","nullable":true},"updatedAt":{"type":"string","format":"date-time","nullable":true}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/status":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["QUEUED","IN_PROGRESS","COMPLETED","FAILED","ERROR","RETRYING","PAUSED","CANCELLED"]},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"},"reason":{"type":"string","description":"Reason for the status change (required when setting to CANCELLED or FAILED)"},"force_download":{"type":"boolean","description":"When re-queuing, set force_download on print_options"},"force":{"type":"boolean","description":"Force-cancel: skip printer stop command and write DB directly (escape hatch for Pulse outages)"},"error_code":{"type":"string","description":"Machine-readable error code to persist on the job (used when transitioning to error/failed/cancelled)"},"error_message":{"type":"string","description":"Human-readable error description to persist on the job for end-user visibility"},"retry_handoff_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exact retry handoff lease, or explicit null for an unleased claim"},"release_printer_ready":{"type":"boolean","description":"Atomically mark the claimed printer ready while re-queuing, fenced by this job's lock ownership"},"claim_generation":{"type":"string","format":"uuid","description":"Immutable generation returned by the claim being released"},"expected_printer_id":{"type":"string","format":"uuid","description":"Printer owned by the claim being released"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"forced":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"504":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"},"errorCode":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}":{"patch":{"summary":"Update print job","tags":["Print Jobs"],"description":"Update a queued print job's printer assignment and/or print options. Only QUEUED jobs can be updated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"printer_id":{"type":["string","null"],"description":"Printer ID to assign. Set to null to un-assign and enable auto-assign."},"print_options":{"type":"object","description":"Print options including AMS mapping","properties":{"enable_ams":{"type":"boolean"},"enable_bed_leveling":{"type":"boolean"},"start_immediately":{"type":"boolean"},"set_printer_ready":{"type":"boolean","description":"Deprecated compatibility alias for start_immediately"},"enable_filament_backup":{"type":"boolean"},"auto_assign":{"type":"boolean"},"ams_mapping":{"type":"array","items":{"type":"integer"}},"ams_mapping2":{"type":"array","items":{"anyOf":[{"type":"integer"},{"type":"object","required":["ams_id","slot_id"],"properties":{"ams_id":{"type":"integer"},"slot_id":{"type":"integer"}},"additionalProperties":false}]}},"ams_mapping_info":{"type":"array","items":{"type":"object","properties":{"sourceColor":{"type":"string"},"targetColor":{"type":"string"},"filamentType":{"type":"string"}}}}},"additionalProperties":true},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Organization ID (optional, defaults to user's primary organization)"},{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Print job ID"}],"responses":{"200":{"description":"Job updated successfully","content":{"application/json":{"schema":{"type":"object","description":"Job updated successfully","properties":{"success":{"type":"boolean"},"job":{"type":"object","description":"Updated print job"}}}}}},"400":{"description":"Bad request - job not in QUEUED status","content":{"application/json":{"schema":{"type":"object","description":"Bad request - job not in QUEUED status","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Forbidden - not authorized to update this job","content":{"application/json":{"schema":{"type":"object","description":"Forbidden - not authorized to update this job","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"type":"object","description":"Job not found","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Cannot delete job - invalid status","content":{"application/json":{"schema":{"type":"object","description":"Cannot delete job - invalid status","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"parameters":[{"schema":{"type":"number"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"organization_id":{"type":"string"},"printer_id":{"type":"string","nullable":true},"model_file_id":{"type":"string"},"task_id":{"type":"string","nullable":true},"status":{"type":"string"},"progress":{"type":"number"},"printer":{"type":"object"},"model_file":{"type":"object"},"print_options":{"type":"object","additionalProperties":true}}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/print-jobs/{id}/history":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_type"],"properties":{"event_type":{"type":"string"},"event_status":{"type":"string","enum":["SUCCESS","FAILED","IN_PROGRESS"],"default":"SUCCESS"},"message":{"type":"string"},"error_code":{"type":"string"},"error_details":{"type":"object"},"metadata":{"type":"object"},"duration_ms":{"type":"number"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"parameters":[{"schema":{"type":"number","default":50,"minimum":1,"maximum":200},"in":"query","name":"limit","required":false},{"schema":{"type":"number","default":0,"minimum":0},"in":"query","name":"offset","required":false},{"schema":{"type":"string"},"in":"query","name":"event_type","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"event_status":{"type":"string"},"message":{"type":"string","nullable":true},"error_code":{"type":"string","nullable":true},"error_details":{"type":"object","nullable":true},"metadata":{"type":"object","nullable":true},"duration_ms":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}},"total":{"type":"number"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/retry":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expected_retry_count":{"type":"number","minimum":0},"next_eligible_at":{"type":"string","format":"date-time"},"terminal_reason":{"type":"string"},"increment_retry":{"type":"boolean"},"retry_count":{"type":"number","minimum":0},"max_retries":{"type":"number","minimum":0},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"retry_count":{"type":"number"},"max_retries":{"type":"number"},"next_eligible_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/file-verification":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["verification_status"],"properties":{"verification_status":{"type":"string","enum":["PENDING","VERIFIED","FAILED"]},"verification_hash":{"type":"string"},"file_size_bytes":{"type":"number","minimum":0},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/inventory-transactions":{"get":{"summary":"List inventory sync transactions for a print job","tags":["Print Jobs"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order_item_id":{"type":"string"},"sku":{"type":"string"},"quantity":{"type":"number"},"platform":{"type":"string"},"location_id":{"type":["null","string"]},"status":{"type":"string","enum":["pending","synced","failed"]},"attempts":{"type":"number"},"error_message":{"type":["null","string"]},"synced_at":{"type":["null","string"]},"created_at":{"type":"string"}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/print-jobs/{id}/inventory-sync":{"post":{"summary":"Create inventory sync transactions for a completed print job","tags":["Print Jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["confirmations"],"properties":{"organizationId":{"type":"string"},"confirmations":{"type":"array","items":{"type":"object","required":["order_item_id","sku","quantity","location_id"],"properties":{"order_item_id":{"type":"string"},"sku":{"type":"string"},"quantity":{"type":"number"},"location_id":{"type":"string"}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"transactions":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","organization_id"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number","minimum":1,"maximum":1000},"model_file_id":{"type":"string"},"organization_id":{"type":"string"},"organizationId":{"type":"string"},"printer_ids":{"type":"array","items":{"type":"string"},"minItems":1},"task_id":{"type":"string"},"make_id":{"type":"string","description":"Optional make ID to derive required materials"},"max_concurrent_printers":{"type":"integer","minimum":1,"maximum":1000,"nullable":true,"description":"Maximum printers running jobs from this batch simultaneously"},"deadline":{"type":"string","format":"date-time","description":"ISO 8601 deadline for production batch completion"},"dedicated_printer_ids":{"type":"array","items":{"type":"string"},"description":"Optional dedicated printer pool for this batch"},"items":{"type":"array","items":{"type":"object","required":["model_file_id","target_count"],"properties":{"model_file_id":{"type":"string"},"part_name":{"type":"string"},"target_count":{"type":"number","minimum":1,"maximum":100000}}},"minItems":1,"description":"Production batch items (triggers production scheduling mode)"},"print_options":{"type":"object","properties":{"enable_ams":{"type":"boolean"},"enable_bed_leveling":{"type":"boolean"},"start_immediately":{"type":"boolean"},"set_printer_ready":{"type":"boolean","description":"Deprecated compatibility alias for start_immediately"},"force_download":{"type":"boolean","default":false},"timelapse":{"type":"boolean","default":false},"task_layer_inspect":{"type":"boolean","default":false},"auto_assign":{"type":"boolean"},"constraints":{"type":"object"}},"additionalProperties":true},"printer_configs":{"type":"object","additionalProperties":{"type":"object","properties":{"print_options":{"type":"object","properties":{"enable_ams":{"type":"boolean"},"enable_bed_leveling":{"type":"boolean"},"start_immediately":{"type":"boolean"},"set_printer_ready":{"type":"boolean","description":"Deprecated compatibility alias for start_immediately"}},"additionalProperties":true}}}}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"batch_job":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"completed_quantity":{"type":"number"},"failed_quantity":{"type":"number"},"cancelled_quantity":{"type":"number"},"status":{"type":"string"},"organization_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deadline":{"type":"string","nullable":true},"priority_mode":{"type":"string"},"estimated_completion":{"type":"string","nullable":true}}},"print_jobs":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"batch_id":{"type":"string"},"printer_id":{"type":"string","nullable":true},"status":{"type":"string"}}}},"batch_items":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"model_file_id":{"type":"string"},"part_name":{"type":"string","nullable":true},"target_count":{"type":"number"},"prints_required":{"type":"number"}}}},"feasibility":{"type":"object","properties":{"feasible":{"type":"boolean"},"estimated_completion":{"type":"string"},"overproduction_warnings":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{"requested_printer_ids":{"type":"array","items":{"type":"string"}},"eligible_printer_ids":{"type":"array","items":{"type":"string"}},"filtered":{"type":"object","properties":{"not_found":{"type":"array","items":{"type":"string"}},"disabled":{"type":"array","items":{"type":"string"}},"not_ready":{"type":"array","items":{"type":"string"}},"maintenance":{"type":"array","items":{"type":"string"}}}}}}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"reason":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"number","minimum":1,"maximum":100,"default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":["boolean","string"]},"in":"query","name":"archived","required":false},{"schema":{"type":"string","enum":["7d","30d","90d","all"]},"in":"query","name":"range","required":false},{"schema":{"type":"string","enum":["all","active","on_track","at_risk","behind","completed"]},"in":"query","name":"chip","required":false},{"schema":{"type":"integer","minimum":1},"in":"query","name":"page","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId"],"properties":{"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"deadline":{"type":"string","nullable":true},"dedicated_printer_ids":{"type":"array","items":{"type":"string"},"nullable":true},"max_concurrent_printers":{"type":"integer","minimum":1,"maximum":1000,"nullable":true},"update_items":{"type":"array","items":{"type":"object","required":["batch_item_id","target_count"],"properties":{"batch_item_id":{"type":"string"},"target_count":{"type":"number","minimum":1}}}},"add_items":{"type":"array","items":{"type":"object","required":["model_file_id","target_count"],"properties":{"model_file_id":{"type":"string"},"part_name":{"type":"string"},"target_count":{"type":"number","minimum":1,"maximum":100000}}}},"remove_item_ids":{"type":"array","items":{"type":"string"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/{id}/dashboard":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/{id}/cancel":{"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"reason":{"type":"string","description":"Reason for cancelling the batch job"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId","mode"],"properties":{"organizationId":{"type":"string"},"mode":{"type":"string","enum":["pending_only","stop_all"]}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/empty":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","organization_id"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"organization_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/{id}/jobs":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["job_ids","organizationId"],"properties":{"job_ids":{"type":"array","items":{"type":"number"},"minItems":1},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/{id}/remove-jobs":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["job_ids","organizationId"],"properties":{"job_ids":{"type":"array","items":{"type":"number"},"minItems":1},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/{id}/archive":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId"],"properties":{"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batch-jobs/{id}/unarchive":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId"],"properties":{"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/files/prepare-upload":{"post":{"summary":"Prepare a direct model file upload","tags":["Models","Public"],"description":"Reserves the collision-safe storage path for a direct-to-Supabase model file upload.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId","filename"],"properties":{"organizationId":{"type":"string"},"filename":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"number"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"ID of the model"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook/supabase/storage/model-files":{"post":{"summary":"Process uploaded model file storage objects","tags":["Models","Webhooks"],"description":"Receives storage.objects INSERT webhooks and creates a durable Model File Processing Job.","x-public":true,"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{id}":{"get":{"summary":"Get model by ID","tags":["Models","Public"],"description":"Retrieve a single model by its ID for the current organization","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Model ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Model retrieved successfully","content":{"application/json":{"schema":{"description":"Model retrieved successfully","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"designer":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"sourceUrl":{"type":"string"},"sourceId":{"type":"string"},"source":{"type":"string","enum":["thangs","patreon","makerworld","manual","mmf","stlflix","api"]},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"rev":{"type":"number"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update model","tags":["Models"],"description":"Update model metadata for the current organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object","additionalProperties":true}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Model ID"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Model updated successfully","content":{"application/json":{"schema":{"description":"Model updated successfully","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"designer":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"sourceUrl":{"type":"string"},"sourceId":{"type":"string"},"source":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"rev":{"type":"number"},"deletedAt":{"type":"string","format":"date-time","nullable":true}}}}}},"400":{"description":"Invalid update","content":{"application/json":{"schema":{"description":"Invalid update","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Rev mismatch (stale client)","content":{"application/json":{"schema":{"description":"Rev mismatch (stale client)","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"rev":{"type":"number"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Delete model","tags":["Models"],"description":"Soft-delete a model: the row is marked deleted and model_files are cascade-soft-deleted. Storage blobs are retained for a grace period and reaped asynchronously.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Model ID"},{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"204":{"description":"Model deleted successfully"},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Rev mismatch (stale client)","content":{"application/json":{"schema":{"description":"Rev mismatch (stale client)","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"rev":{"type":"number"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/models/{id}/restore":{"post":{"summary":"Restore model","tags":["Models"],"description":"Restore a soft-deleted model and model files deleted by the same cascade.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Model ID"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"204":{"description":"Model restored successfully","content":{"application/json":{"schema":{"description":"Model restored successfully"}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/models/exists":{"get":{"summary":"Check if model exists","tags":["Models"],"description":"Check if a model already exists for the current organization","parameters":[{"schema":{"type":"string","enum":["thangs","patreon","makerworld","manual","mmf","stlflix"]},"in":"query","name":"source","required":true,"description":"Source platform of the model"},{"schema":{"type":"string","minLength":1},"in":"query","name":"sourceId","required":true,"description":"Unique identifier from the source platform"},{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false,"description":"Organization in which to check for the model"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Model existence check result","content":{"application/json":{"schema":{"description":"Model existence check result","type":"object","properties":{"exists":{"type":"boolean"},"modelId":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/storage-stats":{"get":{"summary":"Get model file storage stats","tags":["Models"],"description":"Returns aggregate storage statistics for all model files in the organization.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Storage statistics","content":{"application/json":{"schema":{"description":"Storage statistics","type":"object","properties":{"total_bytes":{"type":"number"},"file_count":{"type":"number"},"by_file_type":{"type":"object","additionalProperties":{"type":"object","properties":{"count":{"type":"number"},"bytes":{"type":"number"}}}}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/models/delta":{"get":{"summary":"Get Hive Drive model/file deltas","tags":["Models"],"description":"Returns ordered org-scoped model and model_file changes after a server sequence cursor.","parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"query","name":"after_seq","required":false,"description":"Last durably applied delta seq"},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Page size, max 200"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/changes":{"get":{"summary":"Get model changes since timestamp","tags":["Models"],"description":"Returns models created or updated since the given timestamp for polling-based sync.","parameters":[{"schema":{"type":"string","format":"date-time"},"in":"query","name":"since","required":true,"description":"ISO 8601 timestamp to fetch changes after"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Changes since the given timestamp","content":{"application/json":{"schema":{"description":"Changes since the given timestamp","type":"object","properties":{"created":{"type":"array","items":{"type":"object","additionalProperties":true}},"updated":{"type":"array","items":{"type":"object","additionalProperties":true}},"deleted":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deleted_at":{"type":"string","format":"date-time"},"deleted_rev":{"type":"number","nullable":true}}}},"server_time":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"description":"Invalid request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/models":{"post":{"summary":"Create new model from external source","tags":["Models"],"description":"Creates a new model entry from Thangs.com or Patreon.com","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","sourceId"],"properties":{"source":{"type":"string","enum":["thangs","patreon","makerworld","manual","mmf","stlflix","api"],"default":"api","description":"Source platform of the model"},"name":{"type":"string","description":"Name of the model"},"designer":{"type":"string","description":"Designer/creator name"},"images":{"type":"array","items":{"type":"string"},"description":"Array of image URLs"},"sourceUrl":{"type":"string","description":"Original URL of the model"},"sourceId":{"type":"string","minLength":1,"description":"Unique identifier from the source platform"},"description":{"type":"string","description":"Description of the model for AI tag generation"},"generate_tags":{"type":"boolean","description":"Use AI to automatically generate relevant tags"},"create_task":{"type":"boolean","description":"Automatically create a task for this model"},"task_title":{"type":"string","description":"Custom task title (defaults to model name)"},"task_description":{"type":"string","description":"Custom task description"},"metadata":{"type":"object","additionalProperties":true,"properties":{"modelUrl":{"type":"string"},"postId":{"type":"string"}},"description":"Additional metadata for the model"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Model created successfully","content":{"application/json":{"schema":{"description":"Model created successfully","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"designer":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"sourceUrl":{"type":"string"},"sourceId":{"type":"string"},"source":{"type":"string","enum":["thangs","patreon","makerworld","manual","mmf","stlflix","api"],"default":"api"},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"rev":{"type":"number"},"deletedAt":{"type":"string","format":"date-time","nullable":true},"task":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"swimlane_id":{"type":"string"}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"description":"Invalid request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"summary":"List models","tags":["Models","Public"],"description":"List organization models with pagination, search, tags, and file presence filters.","parameters":[{"schema":{"type":"number","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"number","minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"tags","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"has_files","required":false},{"schema":{"type":"string","enum":["public","private"]},"in":"query","name":"visibility","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"models":{"type":"array","items":{"type":"object","additionalProperties":true}},"total":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{modelId}/tags/generate":{"post":{"summary":"Generate AI tags for existing model","tags":["Models"],"description":"Generate AI tags for an existing model using its title, designer, description, and images","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"override":{"type":"boolean","description":"If true, replace existing tags. If false (default), merge with existing tags","default":false},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"Model ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Tags generated successfully","content":{"application/json":{"schema":{"description":"Tags generated successfully","type":"object","properties":{"modelId":{"type":"string"},"oldTags":{"type":"array","items":{"type":"string"}},"generatedTags":{"type":"array","items":{"type":"string"}},"finalTags":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Bad request (e.g., no images available)","content":{"application/json":{"schema":{"description":"Bad request (e.g., no images available)","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/models/{modelId}/images":{"post":{"summary":"Upload model images","tags":["Models"],"description":"Upload images for a model","parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"ID of the model"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Images uploaded successfully","content":{"application/json":{"schema":{"description":"Images uploaded successfully","type":"object","properties":{"urls":{"type":"array","items":{"type":"string"}}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/models/{modelId}/files":{"get":{"summary":"List model files","tags":["Models","Public"],"description":"List all files for a model with signed download URLs.","parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"Model ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Model files with download URLs","content":{"application/json":{"schema":{"description":"Model files with download URLs","type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"file_path":{"type":"string"},"file_type":{"type":"string"},"file_size":{"type":"number"},"created_at":{"type":"string"},"rev":{"type":"number","nullable":true},"deleted_at":{"type":"string","nullable":true},"deleted_rev":{"type":"number","nullable":true},"content_hash":{"type":"string","nullable":true},"lifecycle_status":{"type":"string"},"processing_stage":{"type":"string","nullable":true},"active_processing_generation":{"type":"string","nullable":true},"processing_error_code":{"type":"string","nullable":true},"processing_error_message":{"type":"string","nullable":true},"processing_warnings":{"type":"array","items":{}},"tags":{"type":"array","items":{"type":"string"},"nullable":true},"download_url":{"type":"string","nullable":true}}}}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Upload model files","tags":["Models","Public"],"description":"Upload one or more printable files for a model.","parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"ID of the model"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Files uploaded successfully","content":{"application/json":{"schema":{"description":"Files uploaded successfully","type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"file_path":{"type":"string"},"file_type":{"type":"string"},"file_size":{"type":"number"},"model_id":{"type":"string"},"created_at":{"type":"string"}}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"description":"Invalid request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"description":"Model not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/models/{modelId}/files/{fileId}":{"patch":{"summary":"Rename model file","tags":["Models","Public"],"description":"Rename a model file for the current organization and move its backing storage object.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename"],"properties":{"organizationId":{"type":"string"},"filename":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"Model ID"},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true,"description":"Model file ID"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Model file renamed successfully","content":{"application/json":{"schema":{"description":"Model file renamed successfully","type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"file_path":{"type":"string"},"file_type":{"type":"string"},"file_size":{"type":"number"},"model_id":{"type":"string"},"organization_id":{"type":"string"},"created_at":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"description":"Invalid request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Model file not found","content":{"application/json":{"schema":{"description":"Model file not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Filename conflict or rev mismatch","content":{"application/json":{"schema":{"description":"Filename conflict or rev mismatch","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"rev":{"type":"number"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/models/{modelId}/files/{fileId}/content":{"put":{"summary":"Replace model file content","tags":["Models","Public"],"description":"Overwrite the backing storage object for an existing model file and update its size/type metadata.","parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true,"description":"Model ID"},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true,"description":"Model file ID"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Model file content replaced successfully","content":{"application/json":{"schema":{"description":"Model file content replaced successfully","type":"object","properties":{"file":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"description":"Invalid request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Model file not found","content":{"application/json":{"schema":{"description":"Model file not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/models/{modelId}/files/{fileId}/retry-processing":{"post":{"summary":"Retry Model File processing","tags":["Models","Public"],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"modelId","required":true},{"schema":{"type":"string"},"in":"path","name":"fileId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/source-deletions/impact":{"get":{"summary":"Preview source deletion production impact","tags":["Models"],"parameters":[{"schema":{"type":"string","enum":["model","model_file"]},"in":"query","name":"source_kind","required":true},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"source_id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/source-deletions/latest":{"get":{"summary":"Read the latest Source Deletion Audit context","tags":["Models"],"parameters":[{"schema":{"type":"string","enum":["model","model_file"]},"in":"query","name":"source_kind","required":true},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"source_id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/source-deletions/confirm":{"post":{"summary":"Confirm source deletion and disclosed production impact","tags":["Models"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["source_kind","source_id","impact_token"],"properties":{"source_kind":{"type":"string","enum":["model","model_file"]},"source_id":{"type":"string","format":"uuid"},"impact_token":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/source-deletions/reap":{"post":{"summary":"Reap retained Model File bytes after protected work ends","tags":["Models"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model_file_id"],"properties":{"model_file_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/source-deletions/reconcile":{"post":{"summary":"Reconcile legacy unavailable-source work","tags":["Models"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/listings":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","description","price","images","inventory","platformSettings","status"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"price":{"type":"number","exclusiveMinimum":0},"images":{"type":"array","items":{"type":"string","format":"uri"}},"sku":{"type":"string"},"inventory":{"type":"integer","minimum":0},"platformSettings":{"type":"object","additionalProperties":true},"status":{"type":"string","enum":["draft","active","archived"]}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"images":{"type":"array","items":{"type":"string"}},"sku":{"type":"string","nullable":true},"inventory":{"type":"number"},"platformSettings":{"type":"object"},"status":{"type":"string","enum":["draft","active","archived"]},"organization_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/listings/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"images":{"type":"array","items":{"type":"string"}},"sku":{"type":"string"},"inventory":{"type":"number"},"platformSettings":{"type":"object"},"status":{"type":"string","enum":["draft","active","archived"]}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/listings/{id}/sync":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["platform"],"properties":{"platform":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/onboarding/status":{"get":{"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["onboardingCompleted","userRole","userContext"],"properties":{"onboardingCompleted":{"type":"boolean"},"userRole":{"anyOf":[{"type":"string","enum":["admin"]},{"type":"string","enum":["member"]},{"type":"string","enum":["null"]}]},"userContext":{"anyOf":[{"type":"string","enum":["new_organization"]},{"type":"string","enum":["existing_organization"]},{"type":"string","enum":["null"]}]}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/onboarding/complete":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["answers","userRole","userContext"],"properties":{"answers":{"type":"object","required":["userType","printerCount","usageType","teamSize","primaryGoals","needsInventoryTracking"],"properties":{"userType":{"anyOf":[{"type":"string","enum":["individual"]},{"type":"string","enum":["organization"]},{"type":"null"}]},"printerCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"usageType":{"anyOf":[{"type":"string","enum":["hobby"]},{"type":"string","enum":["business"]},{"type":"null"}]},"teamSize":{"anyOf":[{"type":"number"},{"type":"null"}]},"primaryGoals":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"needsInventoryTracking":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"organizationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"industry":{"anyOf":[{"type":"string"},{"type":"null"}]},"referralSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"skipped_at_step":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"userRole":{"anyOf":[{"type":"string","enum":["admin"]},{"type":"string","enum":["member"]}]},"userContext":{"anyOf":[{"type":"string","enum":["new_organization"]},{"type":"string","enum":["existing_organization"]}]},"onboardingSkipped":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/onboarding-events":{"post":{"summary":"Record an onboarding event","tags":["Onboarding"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_type"],"properties":{"event_type":{"type":"string"},"step":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"created_at":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"get":{"summary":"List onboarding events for the organization","tags":["Onboarding"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"event_type","required":false,"description":"Filter by event type"},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Max events to return (default 100)"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"step":{"type":["null","string"]},"metadata":{"type":"object"},"user_id":{"type":"string"},"created_at":{"type":"string"}}}},"total":{"type":"number"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/platform-credentials":{"get":{"summary":"Get platform credentials","tags":["Platform Credentials"],"description":"Retrieves platform credentials for the specified organization and platform.","parameters":[{"schema":{"type":"string"},"in":"query","name":"platform","required":false,"description":"Platform filter"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successfully retrieved platform credentials","content":{"application/json":{"schema":{"description":"Successfully retrieved platform credentials","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"platform":{"type":"string"},"credentials":{"type":"object","additionalProperties":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"}}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"post":{"summary":"Create new platform credentials","tags":["Platform Credentials"],"description":"Creates new platform credentials for the specified organization.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId","platform","credentials"],"properties":{"organizationId":{"type":"string","description":"The organization ID these credentials belong to"},"platform":{"type":"string","description":"The platform these credentials are for (e.g., 'pulse')"},"credentials":{"type":"object","description":"The platform-specific credentials"},"isActive":{"type":"boolean","default":true,"description":"Whether these credentials are active"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Successfully created platform credentials","content":{"application/json":{"schema":{"description":"Successfully created platform credentials","type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"platform":{"type":"string"},"credentials":{"type":"object"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/platform-credentials/{id}":{"patch":{"summary":"Update platform credentials","tags":["Platform Credentials"],"description":"Updates existing platform credentials.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"credentials":{"type":"object","description":"The updated platform-specific credentials"},"isActive":{"type":"boolean","description":"Whether these credentials are active"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"The ID of the platform credentials to update"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successfully updated platform credentials","content":{"application/json":{"schema":{"description":"Successfully updated platform credentials","type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"platform":{"type":"string"},"credentials":{"type":"object"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"is_active":{"type":"boolean"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"delete":{"summary":"Delete platform credentials","tags":["Platform Credentials"],"description":"Deletes existing platform credentials.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"The ID of the platform credentials to delete"}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successfully deleted platform credentials"},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/loop-jobs":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model_file_id","loop_count","cool_down_seconds"],"properties":{"model_file_id":{"type":"string"},"loop_count":{"type":"number","minimum":2,"maximum":999},"cool_down_seconds":{"type":"number","minimum":0,"maximum":3600},"sweep_mode":{"type":"string","enum":["base","top_tap","slow_tap_ramp","dynamic","targeted","bounded"]},"sweep_z":{"type":"number","minimum":0,"maximum":5},"tap_offset":{"type":"number","minimum":0,"maximum":2},"ramp_start_f":{"type":"number","minimum":100,"maximum":10000},"ramp_end_f":{"type":"number","minimum":100,"maximum":20000},"ramp_segments":{"type":"number","minimum":2,"maximum":20},"only_calibrate_first_loop":{"type":"boolean"},"auto_level_each_loop":{"type":"boolean","default":false,"description":"Run auto-leveling before each loop (default: false - only level on first loop)"},"enable_bed_flex":{"type":"boolean","default":false,"description":"Enable bed flex motion before sweep (CoreXY printers - P1P, P1S, X1C)"},"flex_z_height":{"type":"number","minimum":0.2,"maximum":2,"default":0.5,"description":"Z height for flex motion in mm (default: 0.5)"},"flex_cycles":{"type":"integer","minimum":1,"maximum":10,"default":3,"description":"Number of flex up/down cycles (default: 3)"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"504":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/loop-jobs/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"result":{"type":"object"},"failedReason":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"504":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/discord/interactions":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/discord/webhook":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/discord/oauth-callback":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/discord/register-commands":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/discord/command-status":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/discord/debug-commands":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-targets":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-targets/device":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-preferences":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-preferences/org":{"put":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-preferences/user":{"put":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-preferences/user/{eventType}":{"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"eventType","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-preferences/printers/{printerId}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"printerId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"printerId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-preferences/printers/{printerId}/{eventType}":{"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"printerId","required":true},{"schema":{"type":"string"},"in":"path","name":"eventType","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/recurring-error-config":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-errors":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-errors/stats":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/farm-briefings/config":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/farm-briefings/preview":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/farm-briefings/daily":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/at-risk-alerts/config":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/at-risk-alerts/preview":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/at-risk-alerts/run":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-control-center":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-control-center/briefing":{"put":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notification-control-center/at-risk-alerts":{"put":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/unread-count":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/read-all":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/dismiss-all":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/{id}/read":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/{id}/dismiss":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/lifecycle-emails/trial-activation/sweep":{"post":{"summary":"Run the trial activation lifecycle email sweep","tags":["Lifecycle Emails"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"dryRun":{"type":"boolean"},"limit":{"type":"number","minimum":1,"maximum":200},"now":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/lifecycle-emails/unsubscribe":{"get":{"summary":"Unsubscribe from lifecycle emails from an email link","tags":["Lifecycle Emails"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"token","required":true},{"schema":{"type":"string"},"in":"query","name":"reason","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Unsubscribe from lifecycle emails","tags":["Lifecycle Emails"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/lifecycle-emails/status":{"get":{"summary":"Get lifecycle email status for an organization","tags":["Lifecycle Emails"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/rebalance":{"post":{"summary":"Rebalance printers across hosts","tags":["Hosts"],"description":"Compute load imbalances across hive-link nodes and move printers to balance load. Accepts API key auth (org derived from key) or Bearer JWT auth (organizationId required in body, membership verified).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"plan":{"type":"object","properties":{"moves":{"type":"array","items":{"type":"object"}},"reason":{"type":"string"}}},"result":{"type":"object","properties":{"executed":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"},"moves":{"type":"array","items":{"type":"object"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/hosts/register":{"post":{"summary":"Register a host","tags":["Hosts"],"description":"Register a new host or update an existing one","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hostname"],"properties":{"hostname":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"},"organization_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"last_seen_at":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"api_key":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/{id}/last-seen":{"patch":{"summary":"Update host last seen","tags":["Hosts"],"description":"Update the last seen timestamp for a host","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connected_printer_ids":{"type":"array","items":{"type":"string"}},"connected_printers":{"type":"array","items":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string"},"status":{"type":"string"}}}},"connected_printer_assignments":{"type":"array","items":{"type":"object","required":["printer_id","assignment_epoch"],"additionalProperties":false,"properties":{"printer_id":{"type":"string"},"assignment_epoch":{"type":"integer","minimum":1,"maximum":9007199254740991}}}},"discovered_printers":{"type":"array","items":{"type":"object","required":["ip","name"],"properties":{"serial":{"type":"string"},"ip":{"type":"string"},"name":{"type":"string"},"model":{"type":"string"},"discoveryMethod":{"type":"string"}}}},"network_subnets":{"type":"array","items":{"type":"string"},"maxItems":32}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/{id}/printer-assignments":{"get":{"summary":"Get printer assignments","tags":["Hosts"],"description":"Get all printer assignments for a host","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["assignment_epoch"],"properties":{"id":{"type":"string"},"printer_id":{"type":"string"},"host_id":{"type":"string"},"organization_id":{"type":"string","nullable":true},"lease_host_id":{"type":"string","nullable":true},"assignment_epoch":{"type":"integer","minimum":1,"maximum":9007199254740991},"lease_expires_at":{"type":"string","nullable":true},"connection_state":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/assign-printer":{"post":{"summary":"Assign printer to host","tags":["Hosts"],"description":"Assign a printer to a host","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["printer_id","host_id"],"properties":{"printer_id":{"type":"string"},"host_id":{"type":"string"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["assignment_epoch"],"properties":{"id":{"type":"string"},"printer_id":{"type":"string"},"host_id":{"type":"string"},"organization_id":{"type":"string","nullable":true},"lease_host_id":{"type":"string","nullable":true},"assignment_epoch":{"type":"integer","minimum":1,"maximum":9007199254740991},"lease_expires_at":{"type":"string","nullable":true},"connection_state":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/printer-assignment/{printer_id}/{host_id}":{"delete":{"summary":"Remove printer from host","tags":["Hosts"],"description":"Remove a printer assignment from a host","parameters":[{"schema":{"type":"string"},"in":"path","name":"printer_id","required":true},{"schema":{"type":"string"},"in":"path","name":"host_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/{host_id}/credentials":{"get":{"summary":"Get node credentials","tags":["Hosts"],"description":"Retrieve the username and decrypted password for a host node. Requires admin-scoped API key.","parameters":[{"schema":{"type":"string"},"in":"path","name":"host_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/hosts/{hostId}/update-attempts":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetVersion","sourceVersion","platform"],"properties":{"targetVersion":{"pattern":"^v?\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$","type":"string"},"sourceVersion":{"pattern":"^v?\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$","type":"string"},"platform":{"anyOf":[{"type":"string","enum":["linux"]},{"type":"string","enum":["windows"]},{"type":"string","enum":["macos"]}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"organizationId","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"hostId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/hosts/{hostId}/update-attempts/latest":{"get":{"parameters":[{"schema":{"pattern":"^v?\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$","type":"string"},"in":"query","name":"targetVersion","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"organizationId","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"hostId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/{hostId}/update-attempts/claim":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["currentVersion"],"properties":{"currentVersion":{"pattern":"^v?\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$","type":"string"}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"hostId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/{hostId}/update-attempts/{attemptId}/observations":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["claimGeneration","revision","stage","message"],"properties":{"claimGeneration":{"format":"uuid","type":"string"},"revision":{"minimum":1,"type":"integer"},"stage":{"anyOf":[{"type":"string","enum":["requested"]},{"type":"string","enum":["claimed"]},{"type":"string","enum":["downloading"]},{"type":"string","enum":["verifying"]},{"type":"string","enum":["waiting_for_work"]},{"type":"string","enum":["activating"]},{"type":"string","enum":["restart_expected"]},{"type":"string","enum":["probation"]},{"type":"string","enum":["rolling_back"]}]},"message":{"minLength":1,"maxLength":500,"type":"string"},"blockers":{"anyOf":[{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["none"]}}},{"type":"object","required":["kind","printJobs","printerTasks"],"properties":{"kind":{"type":"string","enum":["processor_work"]},"printJobs":{"minimum":0,"type":"integer"},"printerTasks":{"minimum":0,"type":"integer"}}},{"type":"object","required":["kind","subtasks"],"properties":{"kind":{"type":"string","enum":["subtasks"]},"subtasks":{"minimum":0,"type":"integer"}}},{"type":"object","required":["kind","filePreparations"],"properties":{"kind":{"type":"string","enum":["file_preparations"]},"filePreparations":{"minimum":0,"type":"integer"}}},{"type":"object","required":["kind","uploads"],"properties":{"kind":{"type":"string","enum":["uploads"]},"uploads":{"minimum":0,"type":"integer"}}}]},"progressCompleted":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"progressTotal":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}]},"progressUnit":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}]},"outcome":{"anyOf":[{"type":"string","enum":["completed"]},{"type":"string","enum":["failed"]},{"type":"null"}]},"errorCode":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"errorDetail":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"parameters":[{"schema":{"format":"uuid","type":"string"},"in":"path","name":"hostId","required":true},{"schema":{"format":"uuid","type":"string"},"in":"path","name":"attemptId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hive-link/host-credentials":{"post":{"summary":"Issue a short-lived paired-Host transfer credential and optionally bootstrap Pulse","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hostId"],"properties":{"hostId":{"type":"string","minLength":1,"maxLength":256},"issuePulseApiKey":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["host","credential","claims"],"properties":{"host":{"type":"object","additionalProperties":false,"required":["id","created"],"properties":{"id":{"type":"string"},"created":{"type":"boolean"}}},"credential":{"type":"string"},"claims":{"type":"object","additionalProperties":false,"required":["version","kind","credentialId","organizationId","hostId","subjectUserId","scopes","issuedAt","expiresAt","nonce"],"properties":{"version":{"type":"integer"},"kind":{"type":"string","enum":["paired_host_credential"]},"credentialId":{"type":"string"},"organizationId":{"type":"string"},"hostId":{"type":"string"},"subjectUserId":{"type":"string"},"scopes":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"string","enum":["direct_transfer:preflight","direct_transfer:redeem"]}},"issuedAt":{"type":"integer"},"expiresAt":{"type":"integer"},"nonce":{"type":"string"}}},"pulseApiKey":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/host-credentials/revoke":{"post":{"summary":"Revoke the paired desktop's Pulse Host credential","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hostId"],"properties":{"hostId":{"type":"string","minLength":1,"maxLength":256}}}}}},"responses":{"204":{"description":"Pulse Host credential revoked"},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/printers":{"get":{"summary":"List safe organization printer metadata with authoritative Host ownership","tags":["Hive Link"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"query","name":"hostId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["currentHost","printers"],"properties":{"currentHost":{"type":"object","additionalProperties":false,"required":["id"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"},"lastSeenAt":{"type":"string"},"lastHeartbeatAt":{"type":"string"}}},"printers":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","protocol","ownership"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"serial":{"type":"string"},"ip":{"type":"string"},"model":{"type":"string"},"protocol":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/printers/resolve":{"post":{"summary":"Resolve a local printer to its canonical cloud identity","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hostId","ip","protocol"],"properties":{"hostId":{"type":"string","minLength":1,"maxLength":256},"ip":{"type":"string","minLength":1,"maxLength":253},"name":{"type":"string","minLength":1,"maxLength":256},"serial":{"type":"string","minLength":1,"maxLength":256},"model":{"type":"string","minLength":1,"maxLength":256},"protocol":{"type":"string","enum":["bambu","klipper","octoprint","prusa_connect","snapmaker","flashforge"]},"createIfMissing":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/printers/{printerId}/claim":{"post":{"summary":"Atomically claim an unassigned cloud printer for a paired Host","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hostId"],"properties":{"hostId":{"type":"string","minLength":1,"maxLength":256}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"path","name":"printerId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/printers/{printerId}/reassign":{"post":{"summary":"Assign or lease-safely move a cloud printer to a paired Hive Link Host","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hostId"],"properties":{"hostId":{"type":"string","minLength":1,"maxLength":256},"printerConfig":{"type":"object","additionalProperties":false,"required":["ipAddress","name","protocol","credential"],"properties":{"ipAddress":{"type":"string","minLength":1,"maxLength":253},"name":{"type":"string","minLength":1,"maxLength":256},"serial":{"type":"string","minLength":1,"maxLength":256},"model":{"type":"string","minLength":1,"maxLength":256},"protocol":{"type":"string","enum":["bambu","klipper","octoprint","prusa_connect","snapmaker","flashforge"]},"credential":{"type":"string","minLength":1,"maxLength":4096},"port":{"type":"integer","minimum":1,"maximum":65535},"secure":{"type":"boolean"},"timeout":{"type":"integer","minimum":100,"maximum":120000}}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"path","name":"printerId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["cloudPrinterId","ownership","assignment"],"properties":{"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"cloudPrinterId":{"type":"string"},"ownership":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["available","unknown","owned-by-this-host","owned-by-another-host"]},"cloudPrinterId":{"type":"string"},"authoritativeHostId":{"type":"string"},"authoritativeHostName":{"type":"string"},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}},"assignment":{"type":"object","additionalProperties":true,"properties":{"id":{"type":"string"},"hostId":{"type":"string"},"hostName":{"type":"string"},"hostHostname":{"type":"string"},"leaseHostId":{"type":"string"},"leaseHostName":{"type":"string"},"assignmentEpoch":{"type":"integer"},"leaseExpiresAt":{"type":"string"},"connectionState":{"type":"string"},"lastKnownPrinterStatus":{"type":"string"},"recoveryRequired":{"type":"boolean"},"recoveryReason":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"retryCount":{"type":"integer"},"lastAttemptAt":{"type":"string"},"uploadInProgress":{"type":"boolean"},"outcome":{"type":"string"},"fromHostId":{"type":"string"},"toHostId":{"type":"string"},"state":{"type":"string"},"error":{"type":"string"}}}}}}}}}}},"/v1/hive-link/launch-intents":{"post":{"summary":"Issue a scoped Hive Link launch intent","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["hostId","printerId","file","idempotencyKey"],"properties":{"hostId":{"type":"string","minLength":1,"maxLength":256},"printerId":{"type":"string","minLength":1,"maxLength":256},"file":{"type":"object","additionalProperties":false,"required":["id","sha256","sizeBytes"],"properties":{"id":{"type":"string","minLength":1,"maxLength":256},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"sizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200}}}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token","claims"],"properties":{"token":{"type":"string"},"claims":{"type":"object","additionalProperties":false,"required":["version","kind","authorityId","organizationId","hostId","userId","userSessionId","printerId","file","approvedOrigin","issuedAt","expiresAt","nonce","idempotencyKey"],"properties":{"version":{"type":"integer"},"authorityId":{"type":"string"},"organizationId":{"type":"string"},"hostId":{"type":"string"},"userId":{"type":"string"},"userSessionId":{"type":"string"},"printerId":{"type":"string"},"file":{"type":"object","additionalProperties":false,"required":["id","sha256","sizeBytes"],"properties":{"id":{"type":"string"},"sha256":{"type":"string"},"sizeBytes":{"type":"integer"}}},"approvedOrigin":{"type":"string"},"issuedAt":{"type":"integer"},"expiresAt":{"type":"integer"},"nonce":{"type":"string"},"idempotencyKey":{"type":"string"},"kind":{"type":"string","enum":["launch_intent"]}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/launch-intents/{launchIntentId}/direct-transfer-tickets":{"post":{"summary":"Issue a file-only direct-transfer ticket","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["launchIntentToken"],"properties":{"launchIntentToken":{"type":"string","minLength":16,"maxLength":16384},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200}}}}}},"parameters":[{"schema":{"type":"string","minLength":8,"maxLength":200},"in":"path","name":"launchIntentId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["token","claims"],"properties":{"token":{"type":"string"},"claims":{"type":"object","additionalProperties":false,"required":["version","kind","capability","launchIntentId","authorityId","organizationId","hostId","userId","userSessionId","printerId","file","approvedOrigin","issuedAt","expiresAt","nonce","idempotencyKey"],"properties":{"version":{"type":"integer"},"authorityId":{"type":"string"},"organizationId":{"type":"string"},"hostId":{"type":"string"},"userId":{"type":"string"},"userSessionId":{"type":"string"},"printerId":{"type":"string"},"file":{"type":"object","additionalProperties":false,"required":["id","sha256","sizeBytes"],"properties":{"id":{"type":"string"},"sha256":{"type":"string"},"sizeBytes":{"type":"integer"}}},"approvedOrigin":{"type":"string"},"issuedAt":{"type":"integer"},"expiresAt":{"type":"integer"},"nonce":{"type":"string"},"idempotencyKey":{"type":"string"},"kind":{"type":"string","enum":["direct_transfer_ticket"]},"capability":{"type":"string","enum":["file_transfer_only"]},"launchIntentId":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/launch-intents/resolve":{"post":{"summary":"Resolve a signed desktop launch capability","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["intentToken"],"properties":{"intentToken":{"type":"string","minLength":16,"maxLength":16384}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["claims"],"properties":{"claims":{"type":"object","additionalProperties":false,"required":["version","kind","authorityId","organizationId","hostId","userId","userSessionId","printerId","file","approvedOrigin","issuedAt","expiresAt","nonce","idempotencyKey"],"properties":{"version":{"type":"integer"},"authorityId":{"type":"string"},"organizationId":{"type":"string"},"hostId":{"type":"string"},"userId":{"type":"string"},"userSessionId":{"type":"string"},"printerId":{"type":"string"},"file":{"type":"object","additionalProperties":false,"required":["id","sha256","sizeBytes"],"properties":{"id":{"type":"string"},"sha256":{"type":"string"},"sizeBytes":{"type":"integer"}}},"approvedOrigin":{"type":"string"},"issuedAt":{"type":"integer"},"expiresAt":{"type":"integer"},"nonce":{"type":"string"},"idempotencyKey":{"type":"string"},"kind":{"type":"string","enum":["launch_intent"]}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/direct-transfers/preflight":{"post":{"summary":"Reserve a signed direct-transfer capability","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["ticket"],"properties":{"ticket":{"type":"string","minLength":16,"maxLength":16384}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["decision","claims"],"properties":{"decision":{"type":"object","additionalProperties":false,"required":["route","eligibility","authorityId","reservationId","expiresAt","idempotentReplay"],"properties":{"route":{"type":"string","enum":["direct"]},"eligibility":{"type":"string","enum":["eligible"]},"authorityId":{"type":"string"},"reservationId":{"type":"string"},"expiresAt":{"type":"integer"},"idempotentReplay":{"type":"boolean"}}},"claims":{"type":"object","additionalProperties":false,"required":["version","kind","capability","launchIntentId","authorityId","organizationId","hostId","userId","userSessionId","printerId","file","approvedOrigin","issuedAt","expiresAt","nonce","idempotencyKey"],"properties":{"version":{"type":"integer"},"authorityId":{"type":"string"},"organizationId":{"type":"string"},"hostId":{"type":"string"},"userId":{"type":"string"},"userSessionId":{"type":"string"},"printerId":{"type":"string"},"file":{"type":"object","additionalProperties":false,"required":["id","sha256","sizeBytes"],"properties":{"id":{"type":"string"},"sha256":{"type":"string"},"sizeBytes":{"type":"integer"}}},"approvedOrigin":{"type":"string"},"issuedAt":{"type":"integer"},"expiresAt":{"type":"integer"},"nonce":{"type":"string"},"idempotencyKey":{"type":"string"},"kind":{"type":"string","enum":["direct_transfer_ticket"]},"capability":{"type":"string","enum":["file_transfer_only"]},"launchIntentId":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["decision"],"properties":{"decision":{"type":"object","additionalProperties":false,"required":["route","reason","safeBeforePhysicalAction"],"properties":{"route":{"type":"string","enum":["cloud_fallback"]},"reason":{"type":"string","enum":["direct_transfer_disabled","host_unavailable","network_unreachable","invalid_ticket","expired_ticket","origin_mismatch","scope_mismatch","file_mismatch","ticket_replayed","replay_conflict","replay_store_unavailable","policy_denied"]},"safeBeforePhysicalAction":{"type":"boolean","enum":[true]}}}}}]}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/hive-link/direct-transfers/redeem":{"post":{"summary":"Redeem a received direct-transfer capability","tags":["Hive Link"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["ticket","reservationId","file"],"properties":{"ticket":{"type":"string","minLength":16,"maxLength":16384},"reservationId":{"type":"string","minLength":1,"maxLength":256},"file":{"type":"object","additionalProperties":false,"required":["id","sha256","sizeBytes"],"properties":{"id":{"type":"string","minLength":1,"maxLength":256},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"sizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991}}}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["redeemed","claims"],"properties":{"redeemed":{"type":"boolean","enum":[true]},"claims":{"type":"object","additionalProperties":false,"required":["version","kind","capability","launchIntentId","authorityId","organizationId","hostId","userId","userSessionId","printerId","file","approvedOrigin","issuedAt","expiresAt","nonce","idempotencyKey"],"properties":{"version":{"type":"integer"},"authorityId":{"type":"string"},"organizationId":{"type":"string"},"hostId":{"type":"string"},"userId":{"type":"string"},"userSessionId":{"type":"string"},"printerId":{"type":"string"},"file":{"type":"object","additionalProperties":false,"required":["id","sha256","sizeBytes"],"properties":{"id":{"type":"string"},"sha256":{"type":"string"},"sizeBytes":{"type":"integer"}}},"approvedOrigin":{"type":"string"},"issuedAt":{"type":"integer"},"expiresAt":{"type":"integer"},"nonce":{"type":"string"},"idempotencyKey":{"type":"string"},"kind":{"type":"string","enum":["direct_transfer_ticket"]},"capability":{"type":"string","enum":["file_transfer_only"]},"launchIntentId":{"type":"string"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["redeemed","decision"],"properties":{"redeemed":{"type":"boolean","enum":[false]},"decision":{"type":"object","additionalProperties":false,"required":["route","reason","safeBeforePhysicalAction"],"properties":{"route":{"type":"string","enum":["cloud_fallback"]},"reason":{"type":"string","enum":["direct_transfer_disabled","host_unavailable","network_unreachable","invalid_ticket","expired_ticket","origin_mismatch","scope_mismatch","file_mismatch","ticket_replayed","replay_conflict","replay_store_unavailable","policy_denied"]},"safeBeforePhysicalAction":{"type":"boolean","enum":[true]}}}}}]}}}},"410":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"}}}}}}}}},"/v1/telemetry":{"post":{"summary":"Store telemetry metrics","tags":["Telemetry"],"description":"Receive and store telemetry metrics from hive-link hosts","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"required":["organization_id","hive_link_id","hostname","metric_timestamp","cpu_usage_percent","cpu_count","load_average","total_memory_mb","free_memory_mb","used_memory_mb","memory_usage_percent","process_memory_mb","process_memory_percent","process_cpu_percent","process_uptime","connected_printers","active_video_streams","mqtt_messages_per_second","http_requests_per_second"],"properties":{"organization_id":{"type":"string"},"hive_link_id":{"type":"string"},"hostname":{"type":"string"},"metric_timestamp":{"type":"string","format":"date-time"},"cpu_usage_percent":{"type":"number"},"cpu_count":{"type":"integer"},"load_average":{"type":"array","items":{"type":"number"}},"total_memory_mb":{"type":"integer"},"free_memory_mb":{"type":"integer"},"used_memory_mb":{"type":"integer"},"memory_usage_percent":{"type":"integer"},"process_memory_mb":{"type":"integer"},"process_memory_percent":{"type":"integer"},"process_rss_memory_mb":{"type":"integer","nullable":true},"process_external_memory_mb":{"type":"integer","nullable":true},"process_array_buffers_memory_mb":{"type":"integer","nullable":true},"process_cpu_percent":{"type":"number"},"process_uptime":{"type":"integer"},"connected_printers":{"type":"integer"},"active_video_streams":{"type":"integer"},"mqtt_messages_per_second":{"type":"number"},"http_requests_per_second":{"type":"number"},"pulse_connection_state":{"type":"string","nullable":true},"pulse_connected":{"type":"boolean","nullable":true},"pulse_reconnect_count":{"type":"integer","nullable":true},"pulse_last_connected_at":{"type":"string","format":"date-time","nullable":true},"pulse_uptime_seconds":{"type":"integer","nullable":true},"pulse_message_queue_size":{"type":"integer","nullable":true},"pulse_messages_dropped":{"type":"integer","nullable":true},"pulse_last_ping_latency":{"type":"integer","nullable":true},"pulse_routeable":{"type":"boolean","nullable":true},"pulse_routeability_state":{"type":"string","nullable":true},"pulse_host_subscription_pending":{"type":"boolean","nullable":true},"pulse_current_session_id":{"type":"integer","nullable":true},"pulse_host_subscription_session_id":{"type":"integer","nullable":true},"pulse_last_host_subscribe_at":{"type":"string","format":"date-time","nullable":true},"pulse_last_session_restore_at":{"type":"string","format":"date-time","nullable":true},"pulse_disconnected_duration_ms":{"anyOf":[{"type":"string","pattern":"^-?\\d+$"},{"type":"integer"},{"type":"null"}]},"job_processor_active":{"type":"boolean","nullable":true},"job_processor_last_poll_at":{"type":"string","format":"date-time","nullable":true},"job_processor_circuit_breaker_state":{"type":"string","nullable":true},"jobs_processed_total":{"type":"integer","nullable":true},"jobs_processing_current":{"type":"integer","nullable":true},"jobs_per_minute":{"type":"number","nullable":true},"jobs_success_total":{"type":"integer","nullable":true},"jobs_failed_total":{"type":"integer","nullable":true},"jobs_success_rate":{"type":"number","nullable":true},"job_retry_count":{"type":"integer","nullable":true},"avg_job_duration_ms":{"type":"integer","nullable":true},"p50_job_duration_ms":{"type":"integer","nullable":true},"p95_job_duration_ms":{"type":"integer","nullable":true},"slowest_job_duration_ms":{"type":"integer","nullable":true}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/telemetry/{host_id}":{"get":{"summary":"Get telemetry metrics for a host","tags":["Telemetry"],"description":"Retrieve telemetry metrics for a specific hive-link host","parameters":[{"schema":{"type":"integer","default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","default":24},"in":"query","name":"hours","required":false,"description":"Number of hours of data to retrieve"},{"schema":{"type":"string"},"in":"path","name":"host_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"organization_id":{"type":"string"},"hive_link_id":{"type":"string"},"hostname":{"type":"string"},"metric_timestamp":{"type":"string"},"cpu_usage_percent":{"type":"number"},"cpu_count":{"type":"integer"},"load_average":{"type":"array","items":{"type":"number"}},"total_memory_mb":{"type":"integer"},"free_memory_mb":{"type":"integer"},"used_memory_mb":{"type":"integer"},"memory_usage_percent":{"type":"integer"},"process_memory_mb":{"type":"integer"},"process_memory_percent":{"type":"integer"},"process_rss_memory_mb":{"type":"integer","nullable":true},"process_external_memory_mb":{"type":"integer","nullable":true},"process_array_buffers_memory_mb":{"type":"integer","nullable":true},"process_cpu_percent":{"type":"number"},"process_uptime":{"type":"integer"},"connected_printers":{"type":"integer"},"active_video_streams":{"type":"integer"},"mqtt_messages_per_second":{"type":"number"},"http_requests_per_second":{"type":"number"},"pulse_routeable":{"type":"boolean","nullable":true},"pulse_routeability_state":{"type":"string","nullable":true},"pulse_host_subscription_pending":{"type":"boolean","nullable":true},"pulse_current_session_id":{"type":"integer","nullable":true},"pulse_host_subscription_session_id":{"type":"integer","nullable":true},"pulse_last_host_subscribe_at":{"type":"string","format":"date-time","nullable":true},"pulse_last_session_restore_at":{"type":"string","format":"date-time","nullable":true},"pulse_disconnected_duration_ms":{"anyOf":[{"type":"string","pattern":"^-?\\d+$"},{"type":"integer"},{"type":"null"}]}}}},"count":{"type":"integer"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/telemetry/{host_id}/latest":{"get":{"summary":"Get latest telemetry metrics","tags":["Telemetry"],"description":"Get the most recent telemetry metrics for a specific hive-link host","parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"path","name":"host_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"organization_id":{"type":"string"},"hive_link_id":{"type":"string"},"hostname":{"type":"string"},"metric_timestamp":{"type":"string"},"cpu_usage_percent":{"type":"number"},"cpu_count":{"type":"integer"},"load_average":{"type":"array","items":{"type":"number"}},"total_memory_mb":{"type":"integer"},"free_memory_mb":{"type":"integer"},"used_memory_mb":{"type":"integer"},"memory_usage_percent":{"type":"integer"},"process_memory_mb":{"type":"integer"},"process_memory_percent":{"type":"integer"},"process_rss_memory_mb":{"type":"integer","nullable":true},"process_external_memory_mb":{"type":"integer","nullable":true},"process_array_buffers_memory_mb":{"type":"integer","nullable":true},"process_cpu_percent":{"type":"number"},"process_uptime":{"type":"integer"},"connected_printers":{"type":"integer"},"active_video_streams":{"type":"integer"},"mqtt_messages_per_second":{"type":"number"},"http_requests_per_second":{"type":"number"},"pulse_routeable":{"type":"boolean","nullable":true},"pulse_routeability_state":{"type":"string","nullable":true},"pulse_host_subscription_pending":{"type":"boolean","nullable":true},"pulse_current_session_id":{"type":"integer","nullable":true},"pulse_host_subscription_session_id":{"type":"integer","nullable":true},"pulse_last_host_subscribe_at":{"type":"string","format":"date-time","nullable":true},"pulse_last_session_restore_at":{"type":"string","format":"date-time","nullable":true},"pulse_disconnected_duration_ms":{"anyOf":[{"type":"string","pattern":"^-?\\d+$"},{"type":"integer"},{"type":"null"}]}}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/claim":{"post":{"summary":"Claim a host with a pre-provisioned token","tags":["RPI Image"],"description":"Exchange a single-use claim token (baked into a pre-provisioned image) for a permanent host API key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["claim_token"],"properties":{"claim_token":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"organization_id":{"type":"string"},"host_id":{"type":"string"},"hostname":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/hosts/rpi-image":{"post":{"summary":"Request Raspberry Pi image","tags":["RPI Image"],"description":"Request a new Raspberry Pi image with Hive Link pre-installed","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rpi_model"],"properties":{"hostname":{"type":"string"},"rpi_model":{"type":"string","enum":["rpi4","rpi5"]},"config":{"type":"object","properties":{"wifi_ssid":{"type":"string"},"wifi_password":{"type":"string"},"enable_ssh":{"type":"boolean"}}},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"host_id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string"},"estimated_time":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/rpi-image/{request_id}":{"get":{"summary":"Get RPI image request status","tags":["RPI Image"],"description":"Get the status of a Raspberry Pi image request","parameters":[{"schema":{"type":"string"},"in":"path","name":"request_id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"status":{"type":"string"},"download_url":{"type":"string","nullable":true},"seed_url":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosts/rpi-image/update-status":{"post":{"summary":"Update RPI image request status","tags":["RPI Image"],"description":"Update the status of a Raspberry Pi image request (internal use)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["request_id","status"],"properties":{"request_id":{"type":"string"},"status":{"type":"string"},"download_url":{"type":"string"},"seed_url":{"type":"string"},"expires_at":{"type":"string"},"error_message":{"type":"string"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/settings":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","organization_id","category","key","value"],"properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"category":{"type":"string"},"key":{"type":"string"},"value":{},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"put":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["settings"],"properties":{"settings":{"type":"array","items":{"type":"object","required":["category","key","value"],"properties":{"category":{"type":"string"},"key":{"type":"string"},"value":{}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/subscription/status":{"get":{"tags":["Subscriptions"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"subscription_tier":{"type":"string"},"printer_limit":{"type":"number"},"payment_status":{"type":"string"},"access_restricted":{"type":"boolean"},"subscription_status":{"type":"string","nullable":true},"subscription_current_period_start":{"type":"string","nullable":true},"subscription_current_period_end":{"type":"string","nullable":true},"subscription_canceled_at":{"type":"string","nullable":true},"payment_failed_at":{"type":"string","nullable":true},"stripe_customer_id":{"type":"string","nullable":true},"stripe_subscription_id":{"type":"string","nullable":true}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/org/{id}/subscription":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/{id}/subscription/upgrade":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/{id}/subscription/seats":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/{id}/subscription/seats/preview":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/{id}/billing":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/org/{id}/printers":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook/stripe":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tags/templates":{"get":{"summary":"Get all tag templates","tags":["Printer Tags"],"description":"Retrieve all tag templates for the current organization","responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a new tag template","tags":["Printer Tags"],"description":"Create a new tag template for the organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prefix","allowed_values"],"properties":{"prefix":{"type":"string","maxLength":255},"description":{"type":"string","maxLength":1000},"allowed_values":{"type":"array","items":{"type":"string","maxLength":100}},"default_values":{"type":"array","items":{"type":"string","maxLength":100}},"required":{"type":"boolean"},"is_default":{"type":"boolean"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tags/templates/{id}":{"put":{"summary":"Update a tag template","tags":["Printer Tags"],"description":"Update an existing tag template","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prefix":{"type":"string","maxLength":255},"description":{"type":"string","maxLength":1000},"allowed_values":{"type":"array","items":{"type":"string","maxLength":100}},"default_values":{"type":"array","items":{"type":"string","maxLength":100}},"required":{"type":"boolean"},"is_default":{"type":"boolean"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a tag template","tags":["Printer Tags"],"description":"Delete an existing tag template","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tags/available-keys":{"get":{"summary":"Get available tag keys","tags":["Printer Tags"],"description":"Get all available tag keys across printers in the organization","responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tags/available-values":{"get":{"summary":"Get available tag values","tags":["Printer Tags"],"description":"Get all available values for a specific tag key","parameters":[{"schema":{"type":"string","maxLength":50},"in":"query","name":"key","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tags/statistics":{"get":{"summary":"Get tag statistics","tags":["Printer Tags"],"description":"Get statistics about tag usage in the organization","responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tags/bulk-update":{"post":{"summary":"Bulk update printer tags","tags":["Printer Tags"],"description":"Update tags for multiple printers at once","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["updates"],"properties":{"updates":{"type":"array","items":{"type":"object","required":["printerId","tags"],"properties":{"printerId":{"type":"string","format":"uuid"},"tags":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","value"],"properties":{"type":{"enum":["simple"]},"value":{"type":"string","maxLength":100},"color":{"type":"string","maxLength":50}},"additionalProperties":false},{"type":"object","required":["type","key","value"],"properties":{"type":{"enum":["prefixed"]},"key":{"type":"string","maxLength":50,"pattern":"^[A-Za-z0-9 _-]+$"},"value":{"type":"string","maxLength":100},"color":{"type":"string","maxLength":50}},"additionalProperties":false}]}}}}},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/tags":{"get":{"summary":"Get printer tags","tags":["Printer Tags"],"description":"Get all tags for a specific printer","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update printer tags","tags":["Printer Tags"],"description":"Update all tags for a specific printer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tags"],"properties":{"tags":{"type":"array","items":{"oneOf":[{"type":"object","required":["type","value"],"properties":{"type":{"enum":["simple"]},"value":{"type":"string","maxLength":100},"color":{"type":"string","maxLength":50}},"additionalProperties":true},{"type":"object","required":["type","key","value"],"properties":{"type":{"enum":["prefixed"]},"key":{"type":"string","maxLength":50},"value":{"type":"string","maxLength":100},"color":{"type":"string","maxLength":50}},"additionalProperties":true}]}},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/tags/apply-template":{"post":{"summary":"Apply tag template to printer","tags":["Printer Tags"],"description":"Apply a tag template to a specific printer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["template_id"],"properties":{"template_id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/by-tags":{"get":{"summary":"Get printers filtered by tags","tags":["Printer Tags"],"description":"Retrieve printers based on tag filters","parameters":[{"schema":{"type":"string"},"in":"query","name":"filters","required":false,"description":"JSON string of tag filters"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organization_id","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["printers"],"properties":{"printers":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/materials/import":{"post":{"summary":"Import and normalize retail filament","tags":["Materials","Public"],"description":"Imports one retail filament into the authenticated organization. Organization scope is resolved by authentication and is not accepted in the body.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["rawTitle"],"properties":{"rawTitle":{"type":"string","minLength":1,"maxLength":2000},"brandHint":{"type":["string","null"],"maxLength":200},"materialTypeHint":{"type":["string","null"],"maxLength":100},"variantLabel":{"type":["string","null"],"maxLength":500},"colorNames":{"type":["array","null"],"maxItems":20,"items":{"type":"string","maxLength":100}},"colors":{"type":["array","null"],"maxItems":20,"items":{"type":"string","maxLength":32}},"specifications":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":2000}},"features":{"type":["array","null"],"maxItems":100,"items":{"type":"string","maxLength":2000}},"source":{"type":["string","null"],"maxLength":100},"sourceUrl":{"type":["string","null"],"maxLength":4000},"sourceProductId":{"type":["string","null"],"maxLength":500},"asin":{"type":["string","null"],"maxLength":100},"sku":{"type":["string","null"],"maxLength":500},"imageUrl":{"type":["string","null"],"maxLength":4000},"price":{"type":["string","null"],"maxLength":100},"diameter":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}]},"inventory":{"type":"object","additionalProperties":false,"properties":{"quantity":{"type":"integer","minimum":0},"minimumStock":{"type":"integer","minimum":0},"unit":{"type":"string","minLength":1,"maxLength":100},"weightPerUnit":{"type":["number","null"],"minimum":0},"location":{"type":["string","null"],"maxLength":500}}}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/materials":{"get":{"summary":"List filaments","tags":["Materials","Public"],"description":"Lists global filaments and, when authenticated with an organization, org-specific filaments.","parameters":[{"schema":{"type":"string","maxLength":100},"in":"query","name":"brand","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"material_type","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"color","required":false},{"schema":{"type":"number"},"in":"query","name":"diameter","required":false},{"schema":{"type":"number","minimum":1,"maximum":200,"default":100},"in":"query","name":"limit","required":false},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"number","minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"materials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"brand":{"type":"string"},"material_type":{"type":"string"},"color":{"type":"string"},"diameter":{"type":"number"},"category":{"type":"string"},"metadata":{"type":"object","properties":{"source":{"type":"string"},"hex_code":{"type":"string"},"price_usd":{"type":"number"},"specifications":{"type":"object","additionalProperties":true},"features":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"asin":{"type":"string"},"sku":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"organization_id":{"type":"string","default":"global"},"filament_profile_id":{"type":"number"}},"additionalProperties":true}},"total":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create filament","tags":["Materials","Public"],"description":"Creates an organization-owned filament (category fixed to 'filament').","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/materials/{id}":{"get":{"summary":"Get filament","tags":["Materials","Public"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update Organization Filament","tags":["Materials","Public"],"description":"Partially update an Organization Filament. Color accepts #RGB, #RRGGBB, or #RRGGBBAA and is stored as #RRGGBB. Finish is standard, matte, or silk. SKU must be unique. Global Filament rows return 403. Inventory row ids do not change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"brand":{"type":"string","minLength":1,"maxLength":100},"material_type":{"type":"string","minLength":1,"maxLength":50},"color":{"type":"string","description":"Filament color as hex RGB. Accepts #RGB, #RRGGBB, or #RRGGBBAA. Stored as #RRGGBB.","pattern":"^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"},"finish":{"type":"string","enum":["standard","matte","silk"]},"diameter":{"type":"number","exclusiveMinimum":0,"maximum":10},"sku":{"type":"string","minLength":1,"maxLength":64},"asin":{"type":"string","minLength":1,"maxLength":20}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}},"delete":{"summary":"Delete filament","tags":["Materials","Public"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/materials/{id}/merge":{"post":{"summary":"Admit a Filament Merge into a global filament","tags":["Materials","Public"],"description":"Admits a Live Operation that rewrites an organization filament onto a matching global filament. Returns 202 with the merge id and correlation id. Does not run the rewrite on this request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["targetMaterialId","correlationId"],"properties":{"targetMaterialId":{"type":"string","format":"uuid"},"correlationId":{"type":"string","minLength":1,"maxLength":512}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","sourceMaterialId","targetMaterialId","status","attempt","maxAttempt","revision"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"sourceMaterialId":{"type":"string","format":"uuid"},"targetMaterialId":{"type":"string","format":"uuid"},"correlationId":{"type":["null","string"]},"status":{"type":"string","enum":["queued","merging","retrying","completed","failed"]},"attempt":{"type":"integer"},"maxAttempt":{"type":"integer"},"revision":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/materials/{materialId}/images":{"post":{"summary":"Upload material image","tags":["Materials"],"description":"Upload an image for a material","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"materialId","required":true,"description":"ID of the material"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Image uploaded successfully","content":{"application/json":{"schema":{"description":"Image uploaded successfully","type":"object","properties":{"url":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"description":"Bad request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"description":"Forbidden","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Material not found","content":{"application/json":{"schema":{"description":"Material not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"description":"Payload too large","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"description":"Unsupported media type","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}},"delete":{"summary":"Delete material image","tags":["Materials"],"description":"Removes an image URL from a material and deletes the underlying storage object","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","organizationId"],"additionalProperties":false,"properties":{"url":{"type":"string","description":"Public URL of the image to delete"},"organizationId":{"type":"string","description":"Organization ID"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"materialId","required":true,"description":"ID of the material"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Image deleted successfully","content":{"application/json":{"schema":{"description":"Image deleted successfully","type":"object","properties":{"ok":{"type":"boolean"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"description":"Forbidden","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Material or image not found","content":{"application/json":{"schema":{"description":"Material or image not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/materials/{materialId}/condition":{"patch":{"summary":"Record spool condition","tags":["Materials"],"description":"Records a last-dried time, drying profile hint, and/or operator-confirmed condition for a material, used by material-condition-aware Smart Queue assignment when live AMS humidity is unavailable.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"organizationId":{"type":"string","description":"Organization ID"},"last_dried_at":{"type":["string","null"],"description":"ISO timestamp the spool was last dried"},"drying_profile_hint":{"type":["string","null"],"description":"Free-text drying profile hint, e.g. temp/time"},"operator_confirmed":{"type":"boolean","description":"Operator has manually confirmed this spool's condition"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"materialId","required":true,"description":"ID of the material"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Spool condition recorded","content":{"application/json":{"schema":{"description":"Spool condition recorded","type":"object","properties":{"material_id":{"type":"string"},"condition":{"type":"object","properties":{"last_dried_at":{"type":["null","string"]},"drying_profile_hint":{"type":["null","string"]},"operator_confirmed":{"type":"boolean"}}}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"description":"Bad request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"description":"Forbidden","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Material not found","content":{"application/json":{"schema":{"description":"Material not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/material-merge-jobs":{"get":{"summary":"List unresolved Filament Merges","tags":["Materials","Public"],"description":"Returns active and unresolved-failed Filament Merges for the current organization.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["data","total"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","organizationId","sourceMaterialId","targetMaterialId","status","attempt","maxAttempt","revision","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"sourceMaterialId":{"type":"string","format":"uuid"},"targetMaterialId":{"type":"string","format":"uuid"},"correlationId":{"type":["null","string"]},"status":{"type":"string","enum":["queued","merging","retrying","completed","failed"]},"attempt":{"type":"integer"},"maxAttempt":{"type":"integer"},"revision":{"type":"integer"},"errorCode":{"type":["null","string"]},"errorMessage":{"type":["null","string"]},"rewriteCounts":{"type":"object","additionalProperties":{"type":["integer","string"]}},"startedAt":{"type":["null","string"],"format":"date-time"},"completedAt":{"type":["null","string"],"format":"date-time"},"failedAt":{"type":["null","string"],"format":"date-time"},"dismissedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"total":{"type":"integer"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/material-merge-jobs/{mergeId}":{"get":{"summary":"Get a Filament Merge","tags":["Materials","Public"],"description":"Reads one Filament Merge Operation Authority row for the current organization.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"mergeId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","sourceMaterialId","targetMaterialId","status","attempt","maxAttempt","revision","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"sourceMaterialId":{"type":"string","format":"uuid"},"targetMaterialId":{"type":"string","format":"uuid"},"correlationId":{"type":["null","string"]},"status":{"type":"string","enum":["queued","merging","retrying","completed","failed"]},"attempt":{"type":"integer"},"maxAttempt":{"type":"integer"},"revision":{"type":"integer"},"errorCode":{"type":["null","string"]},"errorMessage":{"type":["null","string"]},"rewriteCounts":{"type":"object","additionalProperties":{"type":["integer","string"]}},"startedAt":{"type":["null","string"],"format":"date-time"},"completedAt":{"type":["null","string"],"format":"date-time"},"failedAt":{"type":["null","string"],"format":"date-time"},"dismissedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/material-merge-jobs/{mergeId}/dismiss":{"post":{"summary":"Dismiss a failed Filament Merge","tags":["Materials","Public"],"description":"Removes a failed Filament Merge from Live Operations hydrate. The Operation Authority row stays failed.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"mergeId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","sourceMaterialId","targetMaterialId","status","attempt","maxAttempt","revision","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"sourceMaterialId":{"type":"string","format":"uuid"},"targetMaterialId":{"type":"string","format":"uuid"},"correlationId":{"type":["null","string"]},"status":{"type":"string","enum":["queued","merging","retrying","completed","failed"]},"attempt":{"type":"integer"},"maxAttempt":{"type":"integer"},"revision":{"type":"integer"},"errorCode":{"type":["null","string"]},"errorMessage":{"type":["null","string"]},"rewriteCounts":{"type":"object","additionalProperties":{"type":["integer","string"]}},"startedAt":{"type":["null","string"],"format":"date-time"},"completedAt":{"type":["null","string"],"format":"date-time"},"failedAt":{"type":["null","string"],"format":"date-time"},"dismissedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/material-merge-jobs/{mergeId}/retry":{"post":{"summary":"Retry a failed Filament Merge","tags":["Materials","Public"],"description":"Queues the same Filament Merge Operation Authority row again. Returns 202 with the merge id.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"mergeId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","organizationId","sourceMaterialId","targetMaterialId","status","attempt","maxAttempt","revision","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"sourceMaterialId":{"type":"string","format":"uuid"},"targetMaterialId":{"type":"string","format":"uuid"},"correlationId":{"type":["null","string"]},"status":{"type":"string","enum":["queued","merging","retrying","completed","failed"]},"attempt":{"type":"integer"},"maxAttempt":{"type":"integer"},"revision":{"type":"integer"},"errorCode":{"type":["null","string"]},"errorMessage":{"type":["null","string"]},"rewriteCounts":{"type":"object","additionalProperties":{"type":["integer","string"]}},"startedAt":{"type":["null","string"],"format":"date-time"},"completedAt":{"type":["null","string"],"format":"date-time"},"failedAt":{"type":["null","string"],"format":"date-time"},"dismissedAt":{"type":["null","string"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/materials/command-search":{"get":{"summary":"Paginated Material Command Search","tags":["Materials"],"description":"Organization + global scoped material search across color, family/type, finish, brand, and SKU. Returns one bounded, server-ranked result page.","parameters":[{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"number","minimum":1,"maximum":50,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"number","minimum":0,"maximum":10000,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"modelFileId","required":false},{"schema":{"type":"integer","minimum":0,"maximum":63},"in":"query","name":"filamentIndex","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"makeId","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/filament-consumption":{"get":{"summary":"List filament consumption records","tags":["Filament Consumption"],"description":"Lists filament consumption records for the organization with optional filters for material, printer, job, status, and date range. For users in multiple organizations, specify organizationId to select which organization's data to retrieve.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Organization ID to retrieve data for. User must be a member of the organization. Defaults to user's first organization if not specified."},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"material_id","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_id","required":false},{"schema":{"type":"number"},"in":"query","name":"print_job_id","required":false},{"schema":{"type":"string","enum":["COMPLETED","FAILED","CANCELLED"]},"in":"query","name":"job_status","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"start_date","required":false,"description":"ISO 8601 date-time for filtering records from this date onwards"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"end_date","required":false,"description":"ISO 8601 date-time for filtering records up to this date"},{"schema":{"type":"number","minimum":1,"default":50},"in":"query","name":"limit","required":false,"description":"Number of records to return. Defaults to 50. Set to a high number (e.g., 10000) to retrieve all records for a time period."},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"number","minimum":1},"in":"query","name":"page","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"material_id":{"type":["null","string"]},"print_job_id":{"type":["null","number"]},"printer_id":{"type":["null","string"]},"organization_id":{"type":"string"},"usage_grams":{"type":["null","number"]},"usage_meters":{"type":["null","number"]},"expected_grams":{"type":["null","number"]},"expected_meters":{"type":["null","number"]},"job_status":{"type":"string"},"progress_at_end":{"type":["null","number"]},"filament_index":{"type":"number"},"recorded_at":{"type":"string"},"created_at":{"type":"string"}}}},"total":{"type":"number"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/filament-consumption/summary":{"get":{"summary":"Get consumption summary by material","tags":["Filament Consumption"],"description":"Returns aggregated filament consumption data grouped by material, with totals for grams/meters used and record counts by job status. For users in multiple organizations, specify organizationId to select which organization's data to retrieve.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Organization ID to retrieve data for. User must be a member of the organization. Defaults to user's first organization if not specified."},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"start_date","required":false,"description":"ISO 8601 date-time for filtering records from this date onwards"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"end_date","required":false,"description":"ISO 8601 date-time for filtering records up to this date"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printer_id","required":false,"description":"Filter by printer ID"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"material_id","required":false,"description":"Filter by specific material ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"material_id":{"type":["null","string"]},"material_name":{"type":["null","string"]},"material_brand":{"type":["null","string"]},"material_color":{"type":["null","string"]},"material_metadata":{"type":["null","object"],"properties":{"colors":{"type":"array","items":{"type":"string"}},"gradient":{"type":"boolean"},"extrusion_type":{"type":"string"},"finish":{"type":"string"},"modifiers":{"type":"array","items":{"type":"string"}},"volumetric_flow":{"type":"number"}}},"total_usage_grams":{"type":"number"},"total_usage_meters":{"type":"number"},"total_expected_grams":{"type":"number"},"total_expected_meters":{"type":"number"},"record_count":{"type":"number"},"distinct_print_job_count":{"type":"number"},"completed_count":{"type":"number"},"failed_count":{"type":"number"},"cancelled_count":{"type":"number"}}}},"totals":{"type":"object","properties":{"distinct_print_job_count":{"type":"number"},"completed_count":{"type":"number"},"failed_count":{"type":"number"},"cancelled_count":{"type":"number"}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/materials/{id}/consumption":{"get":{"summary":"Get consumption history for a material","tags":["Filament Consumption","Materials"],"description":"Returns filament consumption records and summary for a specific material within the organization. For users in multiple organizations, specify organizationId to select which organization's data to retrieve.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Organization ID to retrieve data for. User must be a member of the organization. Defaults to user's first organization if not specified."},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"start_date","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"end_date","required":false},{"schema":{"type":"number","minimum":1,"default":50},"in":"query","name":"limit","required":false,"description":"Number of records to return. Defaults to 50. Set to a high number (e.g., 10000) to retrieve all records for a time period."},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"number","minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"material_id":{"type":["null","string"]},"print_job_id":{"type":["null","number"]},"printer_id":{"type":["null","string"]},"organization_id":{"type":"string"},"usage_grams":{"type":["null","number"]},"usage_meters":{"type":["null","number"]},"expected_grams":{"type":["null","number"]},"expected_meters":{"type":["null","number"]},"job_status":{"type":"string"},"progress_at_end":{"type":["null","number"]},"filament_index":{"type":"number"},"recorded_at":{"type":"string"},"created_at":{"type":"string"}}}},"total":{"type":"number"},"material":{"type":["null","object"],"properties":{"id":{"type":"string"},"name":{"type":["null","string"]},"brand":{"type":["null","string"]},"color":{"type":["null","string"]}}},"summary":{"type":"object","properties":{"total_usage_grams":{"type":"number"},"total_usage_meters":{"type":"number"},"total_expected_grams":{"type":"number"},"total_expected_meters":{"type":"number"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/filament-consumption/trigger":{"post":{"summary":"Trigger filament consumption recording","tags":["Filament Consumption","Debug"],"description":"Triggers filament consumption recording for an existing print job or all eligible jobs. Use `trigger_all: true` to queue all jobs without consumption records. Jobs can be re-triggered to update existing consumption data (e.g., after correcting material mappings). Worker uses upsert logic to prevent duplicates. Useful for testing and backfilling consumption data. For users in multiple organizations, specify organizationId to select which organization's jobs to trigger.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"Organization ID to trigger jobs for. User must be a member of the organization. Defaults to user's first organization if not specified."},"print_job_id":{"type":"number","description":"The print job ID to record consumption for (required if trigger_all is false)"},"status_override":{"type":"string","enum":["COMPLETED","FAILED","CANCELLED"],"description":"Override the job status (uses actual job status if not provided)"},"trigger_all":{"type":"boolean","default":false,"description":"If true, queue all eligible jobs without consumption records"},"backfill_unknown":{"type":"boolean","default":false,"description":"If true, re-queue jobs that have consumption records with null material_id (Unknown Material). Uses upsert to update existing records."},"limit":{"type":"number","minimum":1,"maximum":10000,"default":100,"description":"Maximum number of jobs to queue when trigger_all is true"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queue_job_id":{"type":"string"},"print_job_id":{"type":"number"},"queued":{"type":"number"},"failed":{"type":"number"},"jobs":{"type":"array","items":{"type":"object","properties":{"print_job_id":{"type":"number"},"queue_job_id":{"type":["null","string"]},"error":{"type":"string"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/filament-consumption/jobs/{id}":{"get":{"summary":"Get consumption job status","tags":["Filament Consumption","Debug"],"description":"Returns the status of a filament consumption recording job in the queue.","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Queue job ID returned from /trigger endpoint"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"state":{"type":"string"},"result":{"type":"object","properties":{"success":{"type":"boolean"},"recordsInserted":{"type":"number"},"totalGramsConsumed":{"type":"number"},"error":{"type":"string"},"skipped":{"type":"boolean"},"skipReason":{"type":"string"}}},"failedReason":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/filament-consumption/candidates":{"get":{"summary":"List candidate jobs for consumption recording","tags":["Filament Consumption","Debug"],"description":"Lists completed, failed, or cancelled print jobs that don't have filament consumption records yet. Useful for finding jobs to backfill. For users in multiple organizations, specify organizationId to select which organization's data to retrieve.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Organization ID to retrieve data for. User must be a member of the organization. Defaults to user's first organization if not specified."},{"schema":{"type":"number","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string","enum":["COMPLETED","FAILED","CANCELLED"]},"in":"query","name":"status","required":false,"description":"Filter by job status"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":["null","string"]},"status":{"type":["null","string"]},"progress":{"type":["null","number"]},"model_file_id":{"type":["null","string"]},"printer_id":{"type":["null","string"]},"updated_at":{"type":["null","string"]}}}},"total":{"type":"number"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/consumption":{"get":{"summary":"Get filament consumption for a print job","tags":["Filament Consumption","Print Jobs"],"description":"Returns filament consumption records for a specific print job with material details and summary totals.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Organization ID. Defaults to user's first organization if not specified."},{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Print job ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"material_id":{"type":["null","string"]},"material_name":{"type":["null","string"]},"material_brand":{"type":["null","string"]},"material_color":{"type":["null","string"]},"usage_grams":{"type":["null","number"]},"usage_meters":{"type":["null","number"]},"expected_grams":{"type":["null","number"]},"expected_meters":{"type":["null","number"]},"job_status":{"type":"string"},"progress_at_end":{"type":["null","number"]},"filament_index":{"type":"number"},"recorded_at":{"type":"string"}}}},"summary":{"type":"object","properties":{"total_usage_grams":{"type":"number"},"total_usage_meters":{"type":"number"},"total_expected_grams":{"type":"number"},"total_expected_meters":{"type":"number"},"filament_count":{"type":"number"}}}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/print-jobs/{id}/filaments":{"patch":{"summary":"Manually assign filaments to a print job","tags":["Filament Consumption","Print Jobs"],"description":"Assigns filaments to a print job for consumption tracking. Use this for past jobs that don't have captured filament data. Only terminal jobs (COMPLETED, FAILED, CANCELLED) can have filaments manually assigned.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slots"],"properties":{"slots":{"type":"array","items":{"type":"object","required":["position","material_id"],"properties":{"position":{"type":"number","description":"Slot position (0-15 for AMS, 254/255 for external spool)"},"material_id":{"type":"string","format":"uuid","description":"Material ID to assign to this slot"}}},"minItems":1,"description":"Array of slot-to-material assignments"},"organizationId":{"type":"string","format":"uuid","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Print job ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Filaments assigned successfully","content":{"application/json":{"schema":{"type":"object","description":"Filaments assigned successfully","properties":{"success":{"type":"boolean"},"job":{"type":"object","properties":{"id":{"type":"number"},"captured_filaments":{"type":"object","properties":{"printer_id":{"type":["null","string"]},"captured_at":{"type":"string"},"slots":{"type":"array","items":{"type":"object","properties":{"position":{"type":"number"},"material_id":{"type":["null","string"]},"material_type":{"type":["null","string"]},"color":{"type":["null","string"]}}}},"manual_assignment":{"type":"boolean"}}}}}}}}}},"400":{"description":"Bad request - invalid input or job not in terminal state","content":{"application/json":{"schema":{"type":"object","description":"Bad request - invalid input or job not in terminal state","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Print job not found","content":{"application/json":{"schema":{"type":"object","description":"Print job not found","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Unprocessable - material not found","content":{"application/json":{"schema":{"type":"object","description":"Unprocessable - material not found","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"type":"object"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory/{itemId}/add":{"post":{"summary":"Add stock to inventory item","tags":["Inventory","Public"],"description":"Increments the quantity of an inventory item and creates an audit transaction record.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["quantity"],"properties":{"quantity":{"type":"number","minimum":1},"unit":{"type":"string"},"weight_per_unit":{"type":"number","minimum":0},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"itemId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"material_id":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"weight_per_unit":{"type":"number"},"minimum_stock":{"type":"number"},"location":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory/{itemId}/remove":{"post":{"summary":"Remove stock from inventory item","tags":["Inventory","Public"],"description":"Decrements the quantity of an inventory item and creates an audit transaction record with optional notes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["quantity"],"properties":{"quantity":{"type":"number","minimum":1},"unit":{"type":"string"},"notes":{"type":"string","maxLength":500},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"itemId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"material_id":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"weight_per_unit":{"type":"number"},"minimum_stock":{"type":"number"},"location":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory/reconcile":{"post":{"summary":"Reconcile inventory against filament_consumption","tags":["Inventory","Public"],"description":"Finds print jobs in the last N days with consumption records that were never deducted from inventory, and enqueues deduction jobs for each.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"lookbackDays":{"type":"integer","minimum":1,"maximum":365}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inventory-purchase-requests":{"post":{"summary":"Create a purchase request","tags":["Purchase Requests"],"description":"Any organization member can submit a multi-item purchase request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","required":["materialId"],"properties":{"materialId":{"type":"string","format":"uuid"},"requestedQuantity":{"type":"number","minimum":1},"inventoryItemId":{"type":"string","format":"uuid"}}}},"reason":{"type":"string","maxLength":1000},"priority":{"type":"string","enum":["low","normal","high","urgent"]}}}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"summary":"List purchase requests","tags":["Purchase Requests"],"description":"List purchase requests with nested items. materialId filter returns requests containing that material.","parameters":[{"schema":{"type":"string","enum":["pending","approved","ordered","received","rejected","cancelled"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"materialId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"requestedBy","required":false},{"schema":{"type":"number","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","minimum":1,"maximum":100,"default":50},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-purchase-requests/summary":{"get":{"summary":"Get purchase request counts by status","tags":["Purchase Requests"],"description":"Returns count of purchase requests grouped by status for the organization.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"pending":{"type":"number"},"approved":{"type":"number"},"ordered":{"type":"number"},"received":{"type":"number"},"rejected":{"type":"number"},"cancelled":{"type":"number"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-purchase-requests/{id}":{"get":{"summary":"Get a purchase request by ID","tags":["Purchase Requests"],"description":"Returns a single purchase request with nested items and material details.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Edit a purchase request","tags":["Purchase Requests"],"description":"Edit request-level fields. Requester can edit while pending (reason, priority). Admins can edit any time (all fields including notes).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":1000},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"notes":{"type":"string","maxLength":2000}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a purchase request","tags":["Purchase Requests"],"description":"Hard delete a pending purchase request and all its items. Only requester or admin.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-purchase-requests/{id}/items":{"post":{"summary":"Add items to a pending purchase request","tags":["Purchase Requests"],"description":"Add one or more materials to an existing pending request. Requester or admin only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","required":["materialId"],"properties":{"materialId":{"type":"string","format":"uuid"},"requestedQuantity":{"type":"number","minimum":1},"inventoryItemId":{"type":"string","format":"uuid"}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-purchase-requests/{id}/items/{itemId}":{"delete":{"summary":"Remove an item from a purchase request","tags":["Purchase Requests"],"description":"Remove a single item. If it's the last item, the entire request is deleted.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"itemId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-purchase-requests/{id}/approve":{"post":{"summary":"Approve a purchase request","tags":["Purchase Requests"],"description":"Admin only. Approves the entire request (all items). Only works on pending requests.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string","maxLength":2000}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-purchase-requests/{id}/reject":{"post":{"summary":"Reject a purchase request","tags":["Purchase Requests"],"description":"Admin only. Rejects the entire request. Only works on pending or approved requests.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","maxLength":2000}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-purchase-requests/{id}/cancel":{"post":{"summary":"Cancel a purchase request","tags":["Purchase Requests"],"description":"Requester or admin can cancel a pending request.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/inventory-orders":{"post":{"summary":"Create an inventory order","tags":["Inventory Orders"],"description":"Admin only. Creates an inventory order with line items and optionally links purchase requests.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderSource","items"],"properties":{"orderSource":{"type":"string"},"orderId":{"type":"string"},"estimatedArrival":{"type":"string","format":"date-time"},"notes":{"type":"string"},"items":{"type":"array","minItems":1,"items":{"type":"object","required":["materialId","quantityOrdered"],"properties":{"materialId":{"type":"string","format":"uuid"},"quantityOrdered":{"type":"integer","minimum":1},"unit":{"type":"string"},"weightPerUnit":{"type":"number","minimum":0},"purchaseRequestItemIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"IDs from inventory_purchase_request_items table"}}}}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List inventory orders","tags":["Inventory Orders"],"description":"List inventory orders with optional status and source filters. Supports pagination.","parameters":[{"schema":{"type":"string","enum":["pending","partial","complete","cancelled"]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"source","required":false},{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inventory-orders/{id}":{"get":{"summary":"Get inventory order detail","tags":["Inventory Orders"],"description":"Retrieve a single inventory order with its items, materials, and linked purchase requests.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update an inventory order","tags":["Inventory Orders"],"description":"Admin only. Update order status, estimated arrival, or notes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","partial","complete","cancelled"]},"estimatedArrival":{"type":"string","format":"date-time"},"notes":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Cancel an inventory order","tags":["Inventory Orders"],"description":"Admin only. Sets the order status to cancelled. The DB trigger handles reverting linked purchase requests.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inventory-orders/{id}/items":{"post":{"summary":"Add items to an existing order","tags":["Inventory Orders"],"description":"Admin only. Add new line items to an existing inventory order.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","required":["materialId","quantityOrdered"],"properties":{"materialId":{"type":"string","format":"uuid"},"quantityOrdered":{"type":"integer","minimum":1},"unit":{"type":"string"},"weightPerUnit":{"type":"number","minimum":0},"purchaseRequestItemIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"IDs from inventory_purchase_request_items table"}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inventory-orders/{id}/receive":{"post":{"summary":"Receive items from an order","tags":["Inventory Orders"],"description":"Admin only. Record received quantities, update inventory, and create transaction records.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","required":["orderItemId","quantityReceived"],"properties":{"orderItemId":{"type":"string","format":"uuid"},"quantityReceived":{"type":"integer","minimum":1}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks":{"post":{"summary":"Create new task","tags":["Tasks"],"description":"Creates a new task for the organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","description":"Task title"},"description":{"type":"string","description":"Task description"},"model_id":{"type":"string","description":"Associated model ID"},"model_file_id":{"type":"string","description":"Associated model file ID"},"make_id":{"type":"string","description":"Associated make ID"},"swimlane_id":{"type":"string","description":"Swimlane ID (defaults to first swimlane)"},"priority":{"type":"string","enum":["low","medium","high"],"description":"Task priority"},"tags":{"type":"array","items":{"type":"string"},"description":"Task tags"},"assigned_to":{"type":"string","description":"User ID to assign task to"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Task created successfully","content":{"application/json":{"schema":{"description":"Task created successfully","type":"object","properties":{"task":{"type":"object","additionalProperties":true}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"description":"Invalid request","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"summary":"List tasks","tags":["Tasks"],"description":"List organization tasks with pagination and filters","parameters":[{"schema":{"type":"number","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false},{"schema":{"type":"number","minimum":0,"default":0},"in":"query","name":"offset","required":false},{"schema":{"type":"number","minimum":1},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"swimlane_id","required":false},{"schema":{"type":"string"},"in":"query","name":"model_id","required":false},{"schema":{"type":"string"},"in":"query","name":"assigned_to","required":false},{"schema":{"type":"string","enum":["low","medium","high"]},"in":"query","name":"priority","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"tags","required":false},{"schema":{"type":"boolean","default":false},"in":"query","name":"archived","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"object"}},"total":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}":{"get":{"summary":"Get task by ID","tags":["Tasks"],"description":"Retrieve a single task by its ID","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Task ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Task retrieved successfully","content":{"application/json":{"schema":{"description":"Task retrieved successfully","type":"object","properties":{"task":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"description":"Task not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update task","tags":["Tasks"],"description":"Update an existing task","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"swimlane_id":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]},"tags":{"type":"array","items":{"type":"string"}},"assigned_to":{"type":"string","nullable":true},"archived_at":{"type":"string","format":"date-time","nullable":true},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Task ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Task updated successfully","content":{"application/json":{"schema":{"description":"Task updated successfully","type":"object","properties":{"task":{"type":"object","additionalProperties":true}}}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"description":"Task not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"delete":{"summary":"Delete task","tags":["Tasks"],"description":"Delete a task","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Task ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Task deleted successfully","content":{"application/json":{"schema":{"description":"Task deleted successfully","type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"description":"Task not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/swimlanes":{"get":{"summary":"List swimlanes","tags":["Tasks"],"description":"List all swimlanes for the organization","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"swimlanes":{"type":"array","items":{"type":"object"}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create swimlane","tags":["Tasks"],"description":"Create a new swimlane for the organization","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Swimlane name"},"background_color":{"type":"string","description":"Background color"},"position":{"type":"number","description":"Position in list"},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Swimlane created successfully","content":{"application/json":{"schema":{"description":"Swimlane created successfully","type":"object","properties":{"swimlane":{"type":"object","additionalProperties":true}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/makes":{"post":{"summary":"Create new make","tags":["Makes"],"description":"Create a new make (production batch) with optional SKU link and model files","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1},"notes":{"type":"string"},"sku_id":{"type":"string","format":"uuid"},"model_files":{"type":"array","items":{"type":"object","required":["model_file_id"],"properties":{"model_file_id":{"type":"string","format":"uuid"},"quantity_to_print":{"type":"integer","minimum":1,"default":1}}}},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"responses":{"201":{"description":"Make created successfully","content":{"application/json":{"schema":{"type":"object","description":"Make created successfully"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","description":"Invalid request","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"SKU or model file not found","content":{"application/json":{"schema":{"type":"object","description":"SKU or model file not found","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"summary":"List makes","tags":["Makes"],"description":"Get paginated list of makes with optional filters","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"sku_id","required":false},{"schema":{"type":"boolean"},"in":"query","name":"has_sku","required":false}],"responses":{"200":{"description":"List of makes","content":{"application/json":{"schema":{"type":"object","description":"List of makes"}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/makes/{id}":{"get":{"summary":"Get make by ID","tags":["Makes"],"description":"Retrieve a single make with all its relations","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Make retrieved successfully","content":{"application/json":{"schema":{"type":"object","description":"Make retrieved successfully"}}}},"404":{"description":"Make not found","content":{"application/json":{"schema":{"type":"object","description":"Make not found","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update make","tags":["Makes"],"description":"Partially update a make","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"notes":{"type":"string"},"sku_id":{"type":["string","null"]},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Make updated successfully","content":{"application/json":{"schema":{"type":"object","description":"Make updated successfully"}}}},"404":{"description":"Make or SKU not found","content":{"application/json":{"schema":{"type":"object","description":"Make or SKU not found"}}}}}},"delete":{"summary":"Delete make","tags":["Makes"],"description":"Delete a make permanently (cascades to make_model_files and make_materials)","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Make deleted successfully"},"404":{"description":"Make not found","content":{"application/json":{"schema":{"type":"object","description":"Make not found","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Make is still referenced by other production records","content":{"application/json":{"schema":{"type":"object","description":"Make is still referenced by other production records","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/makes/{id}/model-files":{"post":{"summary":"Add model file to make","tags":["Makes"],"description":"Link a model file to a make with quantity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model_file_id"],"properties":{"model_file_id":{"type":"string","format":"uuid"},"quantity_to_print":{"type":"integer","minimum":1,"default":1},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Model file linked successfully","content":{"application/json":{"schema":{"type":"object","description":"Model file linked successfully"}}}},"404":{"description":"Make or model file not found","content":{"application/json":{"schema":{"type":"object","description":"Make or model file not found"}}}},"409":{"description":"Model file already linked to this make","content":{"application/json":{"schema":{"type":"object","description":"Model file already linked to this make"}}}}}},"get":{"summary":"List model files for make","tags":["Makes"],"description":"Get all model files linked to a make with their materials","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"List of model file links","content":{"application/json":{"schema":{"type":"object","description":"List of model file links"}}}},"404":{"description":"Make not found","content":{"application/json":{"schema":{"type":"object","description":"Make not found"}}}}}}},"/v1/makes/{id}/model-files/{linkId}":{"delete":{"summary":"Remove model file from make","tags":["Makes"],"description":"Remove the link between a make and a model file","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"linkId","required":true}],"responses":{"204":{"description":"Link deleted successfully"},"404":{"description":"Make or link not found","content":{"application/json":{"schema":{"type":"object","description":"Make or link not found"}}}}}}},"/v1/makes/{id}/sku":{"patch":{"summary":"Link/unlink SKU","tags":["Makes"],"description":"Link a SKU to a make or unlink by setting sku_id to null","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sku_id"],"properties":{"sku_id":{"type":["string","null"]},"organizationId":{"type":"string","description":"Organization ID (optional, defaults to user's primary organization)"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"SKU link updated successfully","content":{"application/json":{"schema":{"type":"object","description":"SKU link updated successfully"}}}},"404":{"description":"Make or SKU not found","content":{"application/json":{"schema":{"type":"object","description":"Make or SKU not found"}}}}}}},"/v1/makes/{id}/model-files/{linkId}/materials":{"put":{"summary":"Set materials for a make model file","tags":["Makes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["materials"],"properties":{"materials":{"type":"array","items":{"type":"object","required":["filament_index","material_id"],"properties":{"filament_index":{"type":"integer","minimum":0},"material_id":{"type":"string","format":"uuid"}}}},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"linkId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get materials for a make model file","tags":["Makes"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"linkId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{modelFileId}/makes":{"get":{"summary":"List makes for a model file","tags":["Makes"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"modelFileId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create make for model file","tags":["Makes"],"description":"Create a new make linked to a model file with materials, optionally set as default","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","materials"],"properties":{"name":{"type":"string","minLength":1},"notes":{"type":"string"},"materials":{"type":"array","items":{"type":"object","required":["filament_index","material_id"],"properties":{"filament_index":{"type":"integer","minimum":0},"material_id":{"type":"string","format":"uuid"}}}},"materialPolicy":{"type":"object","additionalProperties":{"type":"object","required":["options"],"properties":{"requiredMaterialId":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"material_id":{"type":"string"},"type":{"type":"string"},"color":{"type":"string"},"colors":{"type":"array","items":{"type":"string"}},"color_threshold":{"type":"number"},"preference":{"type":"number"}},"additionalProperties":false}}},"additionalProperties":false}},"is_default":{"type":"boolean","default":false},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"modelFileId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{modelFileId}/default-make":{"patch":{"summary":"Set default make for model file","tags":["Makes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["make_id"],"properties":{"make_id":{"type":"string","format":"uuid"},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"modelFileId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Validate that a model file has no default Make to clear","tags":["Makes"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"modelFileId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/updates/latest":{"get":{"parameters":[{"schema":{"type":"string","enum":["macos","windows","linux","ubuntu"]},"in":"query","name":"platform","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"platform":{"type":"string"},"file_name":{"type":"string"},"file_size":{"type":"number"},"file_hash":{"type":"string"},"download_url":{"type":"string"},"release_notes":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/updates/check":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"currentVersion","required":true},{"schema":{"type":"string"},"in":"query","name":"clientId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"currentVersion":{"type":"string"},"latestVersion":{"type":"string"},"updateAvailable":{"type":"boolean"},"lastChecked":{"type":"string","format":"date-time"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/updates/download/{version}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"version","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/updates/stats":{"get":{"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"totalClients":{"type":"number"},"versionDistribution":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"count":{"type":"number"}}}},"updateSuccess":{"type":"number"},"updateFailed":{"type":"number"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/install/{script}":{"get":{"parameters":[{"schema":{"type":"string","enum":["install-linux.sh","install-macos.sh","uninstall-linux.sh","uninstall-macos.sh"]},"in":"path","name":"script","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/install":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ml-models/latest":{"get":{"tags":["ML Models"],"parameters":[{"schema":{"type":"string","default":"yolo-print-failure"},"in":"query","name":"name","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"name":{"type":"string"},"classes":{"type":"array","items":{"type":"string"}},"accuracy":{"type":"number","nullable":true},"fileSizeBytes":{"type":"number","nullable":true},"publishedAt":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/ml-models/download/{version}":{"get":{"tags":["ML Models"],"parameters":[{"schema":{"type":"string","default":"yolo-print-failure"},"in":"query","name":"name","required":false},{"schema":{"type":"string"},"in":"path","name":"version","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/product-skus":{"post":{"summary":"Create new product SKU","tags":["Product SKUs"],"description":"Create a new product SKU for order fulfillment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sku","name","fulfillment_mode"],"properties":{"sku":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":"string"},"fulfillment_mode":{"type":"string","enum":["auto","customer_farm","printhive"]},"metadata":{"type":"object"},"is_active":{"type":"boolean","default":true}}}}}},"responses":{"201":{"description":"SKU created successfully","content":{"application/json":{"schema":{"type":"object","description":"SKU created successfully","additionalProperties":true}}}},"409":{"description":"SKU already exists","content":{"application/json":{"schema":{"type":"object","description":"SKU already exists","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"get":{"summary":"List product SKUs","tags":["Product SKUs"],"description":"Get paginated list of product SKUs","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"boolean"},"in":"query","name":"is_active","required":false},{"schema":{"type":"string","enum":["auto","customer_farm","printhive"]},"in":"query","name":"fulfillment_mode","required":false}],"responses":{"200":{"description":"List of product SKUs","content":{"application/json":{"schema":{"type":"object","description":"List of product SKUs","additionalProperties":true}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/product-skus/{id}":{"get":{"summary":"Get product SKU by ID","tags":["Product SKUs"],"description":"Retrieve a single product SKU by its ID","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Product SKU retrieved successfully","content":{"application/json":{"schema":{"type":"object","description":"Product SKU retrieved successfully","additionalProperties":true}}}},"404":{"description":"Product SKU not found","content":{"application/json":{"schema":{"type":"object","description":"Product SKU not found","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"patch":{"summary":"Update product SKU","tags":["Product SKUs"],"description":"Partially update a product SKU","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"fulfillment_mode":{"type":"string","enum":["auto","customer_farm","printhive"]},"metadata":{"type":"object"},"is_active":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Product SKU updated successfully","content":{"application/json":{"schema":{"type":"object","description":"Product SKU updated successfully","additionalProperties":true}}}},"404":{"description":"Product SKU not found","content":{"application/json":{"schema":{"type":"object","description":"Product SKU not found","additionalProperties":true}}}}}},"delete":{"summary":"Delete product SKU","tags":["Product SKUs"],"description":"Delete a product SKU permanently","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Product SKU deleted successfully"},"404":{"description":"Product SKU not found","content":{"application/json":{"schema":{"type":"object","description":"Product SKU not found","additionalProperties":true}}}}}}},"/v1/product-skus/{id}/model-files":{"post":{"summary":"Link model file to SKU","tags":["Product SKUs"],"description":"Create a mapping between a product SKU and a model file","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model_file_id","allowed_filament_types"],"properties":{"model_file_id":{"type":"string","format":"uuid"},"allowed_filament_types":{"type":"array","items":{"type":"string"}},"allowed_filament_colors":{"type":"array","items":{"type":"object","properties":{"slot":{"type":"integer"},"color":{"type":"string"},"hex":{"type":"string"}}}},"priority":{"type":"integer","default":100},"part_name":{"type":"string","nullable":true},"quantity_per_unit":{"type":"integer","minimum":1,"default":1},"make_model_file_id":{"type":"string","nullable":true,"format":"uuid"},"recipe_mode":{"type":"string","enum":["single_sku","grouped_sku","mixed_sku"],"default":"single_sku"},"shopify_location_id":{"type":"string","nullable":true}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Model file linked successfully","content":{"application/json":{"schema":{"type":"object","description":"Model file linked successfully","additionalProperties":true}}}},"404":{"description":"Product SKU or model file not found","content":{"application/json":{"schema":{"type":"object","description":"Product SKU or model file not found","additionalProperties":true}}}},"409":{"description":"Mapping already exists","content":{"application/json":{"schema":{"type":"object","description":"Mapping already exists","additionalProperties":true}}}}}},"get":{"summary":"List model files for SKU","tags":["Product SKUs"],"description":"Get all model files linked to a product SKU","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"List of model file mappings","content":{"application/json":{"schema":{"type":"object","description":"List of model file mappings","additionalProperties":true}}}},"404":{"description":"Product SKU not found","content":{"application/json":{"schema":{"type":"object","description":"Product SKU not found","additionalProperties":true}}}}}}},"/v1/product-skus/{id}/model-files/{mappingId}":{"delete":{"summary":"Remove model file mapping","tags":["Product SKUs"],"description":"Delete the link between a SKU and a model file","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"mappingId","required":true}],"responses":{"204":{"description":"Mapping deleted successfully"},"404":{"description":"Mapping not found","content":{"application/json":{"schema":{"type":"object","description":"Mapping not found","additionalProperties":true}}}}}}},"/v1/product-skus/{id}/model-files/{mappingId}/validate":{"post":{"summary":"Validate model file mapping","tags":["Product SKUs"],"description":"Validate filament requirements and compatibility for a model file mapping","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"mappingId","required":true}],"responses":{"200":{"description":"Validation completed","content":{"application/json":{"schema":{"type":"object","description":"Validation completed","additionalProperties":true}}}},"404":{"description":"Mapping not found","content":{"application/json":{"schema":{"type":"object","description":"Mapping not found","additionalProperties":true}}}}}}},"/v1/v1/orders":{"get":{"summary":"List orders","tags":["Orders"],"description":"Get paginated list of orders with filtering","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string","enum":["pending","pending_sku_mapping","processing","completed","failed","cancelled"]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"order_source","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"from_date","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"to_date","required":false},{"schema":{"type":"string","enum":["auto","customer_farm","printhive"]},"in":"query","name":"fulfillment_mode","required":false},{"schema":{"type":"string","enum":["pending","processing","partial","completed","failed","skipped","cancelled"]},"in":"query","name":"computed_status","required":false}],"responses":{"200":{"description":"List of orders","content":{"application/json":{"schema":{"type":"object","description":"List of orders"}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/v1/orders/{id}":{"get":{"summary":"Get order by ID","tags":["Orders"],"description":"Retrieve a single order with its items","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Order retrieved successfully","content":{"application/json":{"schema":{"type":"object","description":"Order retrieved successfully"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"type":"object","description":"Order not found"}}}}}},"patch":{"summary":"Update order","tags":["Orders"],"description":"Update order fulfillment mode or status","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fulfillment_mode":{"type":"string","enum":["auto","customer_farm","printhive"]},"order_status":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Order updated successfully","content":{"application/json":{"schema":{"type":"object","description":"Order updated successfully"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"type":"object","description":"Order not found"}}}}}}},"/v1/v1/orders/{id}/reprocess":{"post":{"summary":"Reprocess order","tags":["Orders"],"description":"Retry processing a failed order","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Order reprocessing initiated","content":{"application/json":{"schema":{"type":"object","description":"Order reprocessing initiated"}}}},"400":{"description":"Order cannot be reprocessed","content":{"application/json":{"schema":{"type":"object","description":"Order cannot be reprocessed"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"type":"object","description":"Order not found"}}}}}}},"/v1/orders/{id}/map":{"post":{"summary":"Bulk map order items to model file","tags":["Orders"],"description":"Map multiple order items to a model file. Optionally persist SKU mappings for future auto-resolution.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId","model_file_id","mappings","persist"],"properties":{"organizationId":{"type":"string","format":"uuid"},"model_file_id":{"type":"string","format":"uuid"},"mappings":{"type":"array","items":{"type":"object","required":["order_item_id"],"properties":{"order_item_id":{"type":"string","format":"uuid"},"part_name":{"type":["string","null"]},"quantity_per_unit":{"type":"integer","minimum":1,"default":1},"make_model_file_id":{"type":["string","null"],"format":"uuid"},"recipe_mode":{"type":"string","enum":["single_sku","grouped_sku","mixed_sku"],"default":"single_sku"}}}},"persist":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobsCreated":{"type":"number"},"persisted":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}/events":{"get":{"summary":"Get order events","tags":["Orders"],"description":"Get activity/event log for an order","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"List of order events","content":{"application/json":{"schema":{"type":"array","description":"List of order events"}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/v1/orders/{id}/jobs":{"get":{"summary":"Get order jobs","tags":["Orders"],"description":"Get all print jobs created for an order","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"List of jobs for the order","content":{"application/json":{"schema":{"type":"object","description":"List of jobs for the order"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"type":"object","description":"Order not found"}}}}}}},"/v1/v1/production-capacity":{"post":{"summary":"Configure production capacity","tags":["Production Capacity"],"description":"Create or update production capacity configuration","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["capacity_mode"],"properties":{"capacity_mode":{"type":"string","enum":["unlimited","daily","weekly","monthly"]},"max_jobs_per_period":{"type":"integer","minimum":1},"max_print_hours_per_period":{"type":"number","minimum":0},"printer_models":{"type":"array","items":{"type":"string"}},"printer_tags":{"type":"object"},"alert_threshold_percent":{"type":"integer","minimum":0,"maximum":100,"default":80},"alert_enabled":{"type":"boolean","default":true}}}}}},"responses":{"201":{"description":"Capacity configuration created/updated","content":{"application/json":{"schema":{"type":"object","description":"Capacity configuration created/updated"}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get capacity configuration","tags":["Production Capacity"],"description":"Retrieve production capacity configuration for the organization","responses":{"200":{"description":"Capacity configuration","content":{"application/json":{"schema":{"type":"object","description":"Capacity configuration"}}}},"404":{"description":"No capacity configuration found","content":{"application/json":{"schema":{"type":"object","description":"No capacity configuration found"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error"}}}}}},"patch":{"summary":"Update capacity configuration","tags":["Production Capacity"],"description":"Partially update production capacity configuration","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"capacity_mode":{"type":"string","enum":["unlimited","daily","weekly","monthly"]},"max_jobs_per_period":{"type":"integer","minimum":1},"max_print_hours_per_period":{"type":"number","minimum":0},"printer_models":{"type":"array","items":{"type":"string"}},"printer_tags":{"type":"object"},"alert_threshold_percent":{"type":"integer","minimum":0,"maximum":100},"alert_enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Capacity configuration updated","content":{"application/json":{"schema":{"type":"object","description":"Capacity configuration updated"}}}},"404":{"description":"No capacity configuration found","content":{"application/json":{"schema":{"type":"object","description":"No capacity configuration found"}}}}}},"delete":{"summary":"Delete capacity configuration","tags":["Production Capacity"],"description":"Remove production capacity configuration","responses":{"204":{"description":"Capacity configuration deleted"},"404":{"description":"No capacity configuration found","content":{"application/json":{"schema":{"type":"object","description":"No capacity configuration found"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error"}}}}}}},"/v1/v1/production-capacity/alerts":{"get":{"summary":"List capacity alerts","tags":["Production Capacity"],"description":"Get paginated list of capacity alerts","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"from_date","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"to_date","required":false},{"schema":{"type":"string","enum":["info","warning","critical"]},"in":"query","name":"severity","required":false}],"responses":{"200":{"description":"List of capacity alerts","content":{"application/json":{"schema":{"type":"object","description":"List of capacity alerts"}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/v1/production-capacity/status":{"get":{"summary":"Get capacity status","tags":["Production Capacity"],"description":"Get current production capacity utilization","responses":{"200":{"description":"Current capacity status","content":{"application/json":{"schema":{"type":"object","description":"Current capacity status"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error"}}}}}}},"/v1/production-runs":{"get":{"summary":"List Make Production Runs","tags":["Production Runs"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["queued","in_progress","completed","partially_failed","cancelled"]},"in":"query","name":"status","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-runs/{runId}":{"get":{"summary":"Get Make Production Run detail","tags":["Production Runs"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"runId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-runs/{runId}/cancel":{"post":{"summary":"Cancel queued jobs linked to a Make Production Run","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"reason":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"runId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-run-templates":{"get":{"summary":"List Production Run Templates","tags":["Production Runs"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","enum":["active","archived"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["make","sku"]},"in":"query","name":"sourceType","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"sourceId","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a Production Run Template","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","lines"],"properties":{"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"defaultQuantity":{"type":"integer","minimum":1,"default":1},"labelName":{"type":"string","nullable":true},"labelFormat":{"type":"string","minLength":1,"default":"3x2"},"labelMetadata":{"type":"object"},"lines":{"type":"array","minItems":1,"items":{"type":"object","required":["sourceType"],"properties":{"sourceType":{"type":"string","enum":["make","sku"]},"makeId":{"type":"string","format":"uuid","nullable":true},"productSkuId":{"type":"string","format":"uuid","nullable":true},"lineQuantity":{"type":"integer","minimum":1,"default":1},"position":{"type":"integer","minimum":1},"label":{"type":"string","nullable":true},"metadata":{"type":"object"}}}}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-run-templates/{templateId}":{"patch":{"summary":"Update a Production Run Template","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"defaultQuantity":{"type":"integer","minimum":1},"labelName":{"type":"string","nullable":true},"labelFormat":{"type":"string","minLength":1},"labelMetadata":{"type":"object"},"lines":{"type":"array","minItems":1,"items":{"type":"object","required":["sourceType"],"properties":{"sourceType":{"type":"string","enum":["make","sku"]},"makeId":{"type":"string","format":"uuid","nullable":true},"productSkuId":{"type":"string","format":"uuid","nullable":true},"lineQuantity":{"type":"integer","minimum":1,"default":1},"position":{"type":"integer","minimum":1},"label":{"type":"string","nullable":true},"metadata":{"type":"object"}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"templateId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-run-templates/{templateId}/archive":{"post":{"summary":"Archive a Production Run Template","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"templateId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-run-templates/{templateId}/qr-tokens":{"get":{"summary":"List Production QR tokens for a template","tags":["Production Runs"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"templateId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a Production QR token for a template","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"labelName":{"type":"string","nullable":true},"labelFormat":{"type":"string","minLength":1},"labelMetadata":{"type":"object"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"templateId","required":true},{"schema":{"type":"string","minLength":1},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-qr-tokens/{tokenId}":{"patch":{"summary":"Update Production QR label metadata","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"labelName":{"type":"string","nullable":true},"labelFormat":{"type":"string","minLength":1},"labelMetadata":{"type":"object"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"tokenId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-qr-tokens/{tokenId}/revoke":{"post":{"summary":"Revoke a Production QR token","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"tokenId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-qr-tokens/{tokenId}/rotate":{"post":{"summary":"Rotate a Production QR token","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"labelName":{"type":"string","nullable":true},"labelFormat":{"type":"string","minLength":1},"labelMetadata":{"type":"object"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"tokenId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-runs/preview":{"post":{"summary":"Preview a Make Production Run from a template","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templateId"],"properties":{"organizationId":{"type":"string","format":"uuid"},"templateId":{"type":"string","format":"uuid"},"quantity":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-runs/scan/{token}/preview":{"post":{"summary":"Preview a Make Production Run from a QR token","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer","minimum":1}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/production-runs/confirm":{"post":{"summary":"Confirm a Make Production Run and enqueue print jobs","tags":["Production Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["previewHash"],"properties":{"organizationId":{"type":"string","format":"uuid"},"templateId":{"type":"string","format":"uuid"},"token":{"type":"string","minLength":1},"quantity":{"type":"integer","minimum":1},"previewHash":{"type":"string","minLength":1},"duplicateOutputAcknowledged":{"type":"boolean","default":false}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/v1/shippo/oauth/authorize":{"get":{"summary":"Initiate Shippo OAuth","tags":["Shippo","OAuth"],"description":"Redirect user to Shippo OAuth authorization page","parameters":[{"schema":{"type":"string"},"in":"query","name":"redirect_uri","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/v1/shippo/oauth/callback":{"get":{"summary":"OAuth callback","tags":["Shippo","OAuth"],"description":"Handle OAuth callback from Shippo","parameters":[{"schema":{"type":"string"},"in":"query","name":"code","required":false},{"schema":{"type":"string"},"in":"query","name":"state","required":false},{"schema":{"type":"string"},"in":"query","name":"error","required":false},{"schema":{"type":"string"},"in":"query","name":"error_description","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/v1/shippo/oauth/status":{"get":{"summary":"Check OAuth status","tags":["Shippo","OAuth"],"description":"Check if Shippo is connected for the organization","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"account_id":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error"}}}}}}},"/v1/v1/shippo/oauth/disconnect":{"delete":{"summary":"Disconnect Shippo","tags":["Shippo","OAuth"],"description":"Remove Shippo integration for the organization","responses":{"204":{"description":"Disconnected successfully"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error"}}}}}}},"/v1/webhook/shippo":{"post":{"summary":"Shippo webhook endpoint","tags":["Shippo","Webhooks"],"description":"Receive webhook events from Shippo","x-public":true,"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shopify/launch":{"get":{"summary":"Shopify app launch handler","tags":["Shopify"],"parameters":[{"schema":"object","in":"query","name":"type"},{"schema":{"type":"string"},"in":"query","name":"additionalProperties"}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shopify/orders/board":{"get":{"summary":"Get Shopify operations board","tags":["Shopify"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shopify/status":{"get":{"summary":"Get Shopify integration status","tags":["Shopify"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"shop_domain":{"type":"string"},"connected_at":{"type":"string"},"webhooks_registered":{"type":"boolean"},"webhooks_registered_at":{"type":"string"},"webhook_registration_errors":{"type":"array","items":{"type":"string"}},"orders_synced":{"type":"number"},"items_pending_mapping":{"type":"number"},"items_printing":{"type":"number"},"items_completed":{"type":"number"},"last_webhook_at":{"type":"string"},"last_sync_at":{"type":"string"},"has_inventory_scope":{"type":"boolean"},"default_location_id":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shopify/connect":{"post":{"summary":"Start Shopify OAuth flow","tags":["Shopify"],"description":"Generates a Shopify OAuth authorization URL for the given shop domain.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["shop_domain"],"properties":{"shop_domain":{"type":"string","description":"Shopify store domain (e.g. my-store.myshopify.com)"},"organizationId":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authUrl":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shopify/callback":{"get":{"summary":"Shopify OAuth callback","tags":["Shopify"],"description":"Handles the OAuth redirect from Shopify after authorization.","parameters":[{"schema":{"type":"string"},"in":"query","name":"code","required":false},{"schema":{"type":"string"},"in":"query","name":"state","required":false},{"schema":{"type":"string"},"in":"query","name":"shop","required":false},{"schema":{"type":"string"},"in":"query","name":"hmac","required":false},{"schema":{"type":"string"},"in":"query","name":"host","required":false},{"schema":{"type":"string"},"in":"query","name":"timestamp","required":false},{"schema":{"type":"string"},"in":"query","name":"signature","required":false},{"schema":{"type":"string"},"in":"query","name":"error","required":false},{"schema":{"type":"string"},"in":"query","name":"error_description","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shopify/locations":{"get":{"summary":"List Shopify inventory locations","tags":["Shopify"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/shopify/disconnect":{"post":{"summary":"Disconnect Shopify store","tags":["Shopify"],"description":"Deactivates Shopify credentials, cancels queued print jobs, and removes webhooks. Historical orders are preserved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deactivated":{"type":"boolean"},"cancelledJobCount":{"type":"number"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/shopify/settings":{"get":{"summary":"Get Shopify org settings","tags":["Shopify"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"default_location_id":{"type":"string","nullable":true},"inventory_confirmation_mode":{"type":"string","nullable":true}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Update Shopify org settings","tags":["Shopify"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"default_location_id":{"type":"string"},"inventory_confirmation_mode":{"type":"string","enum":["default_full_quantity","require_verification"]}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/veeqo/connect":{"post":{"summary":"Connect Veeqo integration","tags":["Veeqo"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"type":"string"},"organizationId":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/veeqo/disconnect":{"post":{"summary":"Disconnect Veeqo integration","tags":["Veeqo"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deactivated":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/veeqo/status":{"get":{"summary":"Get Veeqo integration status","tags":["Veeqo"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"lastPollAt":{"type":"string","nullable":true},"orderCount":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/veeqo/orders":{"get":{"summary":"List Veeqo orders","tags":["Veeqo"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"page_size","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook/shopify":{"post":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/order-items/{id}/map":{"post":{"summary":"Map order item to model file","tags":["Order Items"],"description":"Manually resolve an order item by mapping it to a model file. Optionally persist the mapping for future orders.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model_file_id","persist"],"properties":{"model_file_id":{"type":"string","format":"uuid"},"persist":{"type":"boolean"},"make_model_file_id":{"type":["string","null"],"format":"uuid"},"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"mapped":{"type":"boolean"},"persisted":{"type":"boolean"},"jobsCreated":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/order-items/{id}/skip":{"post":{"summary":"Skip order item","tags":["Order Items"],"description":"Mark an order item as skipped so no print jobs are created for it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"skipped":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/model-files/{id}/part-mappings":{"get":{"summary":"List part mappings for a model file","tags":["Model Files"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Upsert part mappings for a model file","tags":["Model Files"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId","mappings"],"properties":{"organizationId":{"type":"string"},"save_scope":{"type":"string","enum":["current_order","reusable","draft"],"default":"reusable"},"source_context":{"type":"object","additionalProperties":true},"mappings":{"type":"array","items":{"type":"object","required":["product_sku_id"],"properties":{"part_name":{"type":"string","nullable":true},"quantity_per_unit":{"type":"integer","minimum":1,"default":1},"make_model_file_id":{"type":"string","nullable":true,"format":"uuid"},"recipe_mode":{"type":"string","enum":["single_sku","grouped_sku","mixed_sku"],"default":"single_sku"},"product_sku_id":{"type":"string","format":"uuid"},"shopify_location_id":{"type":"string","nullable":true}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"number"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sku-mapping-resolver/context":{"get":{"summary":"Get SKU mapping resolver context","tags":["Shopify SKU Mapping"],"description":"Hydrates the shared SKU mapping resolver with order, SKU, model file, Make, filament, and existing mapping data.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"orderItemId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"modelFileId","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"productSkuId","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":80},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inventory-transactions/{id}/retry":{"post":{"summary":"Retry a failed inventory sync transaction","tags":["Inventory Transactions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"boolean"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feature-flags":{"get":{"summary":"Get evaluated feature flags","tags":["Feature Flags"],"description":"Returns all feature flags with their evaluated enabled/disabled status for the authenticated user and specified organization","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":true,"description":"The organization ID to evaluate feature flags for"},{"schema":{"type":"string","enum":["development","staging","production"],"default":"production"},"in":"query","name":"environment","required":false,"description":"The environment context for rule evaluation"}],"responses":{"200":{"description":"Feature flags evaluated successfully","content":{"application/json":{"schema":{"type":"object","description":"Feature flags evaluated successfully","properties":{"flags":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Map of feature flag names to their enabled status"}}}}}},"400":{"description":"Bad request - missing required parameters","content":{"application/json":{"schema":{"type":"object","description":"Bad request - missing required parameters","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized - invalid or missing authentication","content":{"application/json":{"schema":{"type":"object","description":"Unauthorized - invalid or missing authentication","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Forbidden - user is not a member of the specified organization","content":{"application/json":{"schema":{"type":"object","description":"Forbidden - user is not a member of the specified organization","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/feature-flags/host":{"get":{"summary":"Get evaluated feature flags for a host (API key auth)","tags":["Feature Flags"],"description":"Returns all feature flags evaluated for the organization associated with the API key. No user-specific rules are applied.","parameters":[{"schema":{"type":"string","enum":["development","staging","production"],"default":"production"},"in":"query","name":"environment","required":false,"description":"The environment context for rule evaluation"}],"responses":{"200":{"description":"Feature flags evaluated successfully","content":{"application/json":{"schema":{"type":"object","description":"Feature flags evaluated successfully","properties":{"flags":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Map of feature flag names to their enabled status"}}}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"type":"object","description":"Unauthorized - invalid or missing API key","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error","properties":{"error":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}}}}}},"/v1/organizations":{"get":{"summary":"List user organizations","tags":["Organizations"],"description":"Returns all organizations the authenticated user is a member of, including their role in each organization","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of organizations","content":{"application/json":{"schema":{"description":"List of organizations","type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Organization ID"},"name":{"type":"string","description":"Organization name"},"role":{"type":"string","description":"User's role in the organization"}},"required":["id","name","role"]}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"description":"Internal server error","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}":{"patch":{"summary":"Update organization","tags":["Organizations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/members":{"get":{"summary":"List organization members","tags":["Organizations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Invite or add an organization member","tags":["Organizations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"type":"string","enum":["member","admin"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/members/{userId}":{"patch":{"summary":"Update an organization member's role","tags":["Organizations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["member","admin"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"userId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove an organization member","tags":["Organizations"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"userId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/training/stats":{"get":{"summary":"Get training data statistics","tags":["Training"],"description":"Returns statistics about collected training data for the user's organization","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Training data statistics","content":{"application/json":{"schema":{"description":"Training data statistics","type":"object","properties":{"totalFrames":{"type":"number"},"labelCounts":{"type":"object","additionalProperties":{"type":"number"}},"reviewedCount":{"type":"number"},"pendingReviewCount":{"type":"number"},"framesByDay":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/training/frames":{"get":{"summary":"List training frames","tags":["Training"],"description":"Returns paginated list of training frames for review","parameters":[{"schema":{"type":"number","default":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","default":50,"maximum":100},"in":"query","name":"pageSize","required":false},{"schema":{"type":"string"},"in":"query","name":"label","required":false},{"schema":{"type":"boolean"},"in":"query","name":"reviewed","required":false},{"schema":{"type":"string","default":"created_at"},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"in":"query","name":"sortOrder","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of training frames","content":{"application/json":{"schema":{"description":"List of training frames","type":"object","properties":{"frames":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"printerId":{"type":"string"},"jobId":{"type":"number","nullable":true},"frameUrl":{"type":"string"},"frameTimestamp":{"type":"string"},"printProgress":{"type":"number","nullable":true},"layerNumber":{"type":"number","nullable":true},"printerModel":{"type":"string","nullable":true},"label":{"type":"string"},"labelSource":{"type":"string"},"labelConfidence":{"type":"number","nullable":true},"verificationEventType":{"type":"string","nullable":true},"failureReason":{"type":"string","nullable":true},"reviewed":{"type":"boolean"},"reviewerId":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"correctedLabel":{"type":"string","nullable":true},"createdAt":{"type":"string"},"fileSize":{"type":"number","nullable":true},"resolution":{"type":"string","nullable":true},"qualityScore":{"type":"number","nullable":true},"qualityFlags":{"type":"object","nullable":true,"additionalProperties":true},"priority":{"type":"string","nullable":true},"modelConfidence":{"type":"number","nullable":true},"modelPredictedLabel":{"type":"string","nullable":true},"modelVersion":{"type":"string","nullable":true}}}},"pagination":{"type":"object","properties":{"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"},"totalPages":{"type":"number"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/training/frames/{id}/review":{"post":{"summary":"Review a training frame","tags":["Training"],"description":"Submit a review for a training frame, optionally correcting the label","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"correctedLabel":{"type":"string","nullable":true,"description":"Corrected label if original was wrong"},"reviewed":{"type":"boolean","description":"Whether the frame has been reviewed"}},"required":["reviewed"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Training frame ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Review submitted successfully","content":{"application/json":{"schema":{"description":"Review submitted successfully","type":"object","properties":{"success":{"type":"boolean"},"frame":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"reviewed":{"type":"boolean"},"correctedLabel":{"type":"string","nullable":true},"modelConfidence":{"type":"number","nullable":true},"modelPredictedLabel":{"type":"string","nullable":true},"modelVersion":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"description":"Forbidden","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"description":"Not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/training/export":{"get":{"summary":"Export training data","tags":["Training"],"description":"Export labeled training data in various formats for model training","parameters":[{"schema":{"type":"string","enum":["yolo","json"],"default":"json"},"in":"query","name":"format","required":false,"description":"Export format (json for raw data, yolo for YOLO annotation format)"},{"schema":{"type":"string"},"in":"query","name":"label","required":false,"description":"Filter by specific label"},{"schema":{"type":"boolean"},"in":"query","name":"reviewed","required":false,"description":"Only include reviewed frames"},{"schema":{"type":"number","default":1000,"maximum":10000},"in":"query","name":"limit","required":false,"description":"Maximum number of frames to export"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Exported training data","content":{"application/json":{"schema":{"description":"Exported training data"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/training/frames/{id}":{"delete":{"summary":"Delete a training frame","tags":["Training"],"description":"Delete a training frame from the database and storage","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true,"description":"Training frame ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Frame deleted successfully","content":{"application/json":{"schema":{"description":"Frame deleted successfully","type":"object","properties":{"success":{"type":"boolean"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"description":"Forbidden","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"description":"Not found","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/training/review-queue":{"get":{"summary":"Get prioritized review queue","tags":["Training"],"description":"Returns training frames ordered by review priority","parameters":[{"schema":{"type":"number","default":1},"in":"query","name":"page","required":false},{"schema":{"type":"number","default":50,"maximum":100},"in":"query","name":"pageSize","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/training/opt-in":{"get":{"summary":"Get training data opt-in status","tags":["Training"],"description":"Get the organization's training data collection opt-in status","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Opt-in status","content":{"application/json":{"schema":{"description":"Opt-in status","type":"object","properties":{"optIn":{"type":"boolean"},"consentAt":{"type":"string","nullable":true}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}},"post":{"summary":"Update training data opt-in status","tags":["Training"],"description":"Update the organization's training data collection opt-in status","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"optIn":{"type":"boolean","description":"Whether to opt in to training data collection"}},"required":["optIn"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Opt-in status updated","content":{"application/json":{"schema":{"description":"Opt-in status updated","type":"object","properties":{"success":{"type":"boolean"},"optIn":{"type":"boolean"},"consentAt":{"type":"string","nullable":true}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"description":"Forbidden","type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/internal/subtasks/{id}/start-print-attempts/begin":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"protocolVersion":{"enum":[1,2]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/start-print-attempts/{id}/command-result":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"enum":["acknowledged"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"enum":["ambiguous"]},"code":{"type":"string","enum":["MQTT_TIMEOUT","COMMAND_RESULT_UNKNOWN"]},"message":{"type":"string","minLength":1}},"required":["kind","code","message"],"additionalProperties":false},{"type":"object","properties":{"kind":{"enum":["rejected"]},"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1}},"required":["kind","code","message"],"additionalProperties":false}]}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/start-print-attempts/recover":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"printerId":{"type":"string","format":"uuid"},"deviceTaskId":{"type":"string","pattern":"^[1-9][0-9]*$"}},"required":["printerId","deviceTaskId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/start-print-attempts/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/start-print-attempts/{id}/local-lab-proof":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{jobId}/subtasks":{"post":{"tags":["Sub-Tasks"],"description":"Create sub-tasks for a print job","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","properties":{"task_type":{"type":"string","enum":["empty_bed_detection","temperature_check","gcode_command","ai_detection","capture_frame","cooldown_check","printer_ready_check","file_upload","start_print","bed_clear","wait_for_temperature","reheat","webhook_signal","mqtt_signal","prime_nozzle","verify_bed_clear","post_complete_bed_detection","bed_occupancy_verification"]},"phase":{"type":"string","enum":["pre","in_flight","post"]},"is_required":{"type":"boolean"},"max_retries":{"type":"number"},"timeout_ms":{"type":"number"},"parameters":{"type":"object"},"schedule_interval_ms":{"type":"number"}},"required":["task_type","phase"]}}},"required":["tasks"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"subtasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"task_type":{"type":"string"},"phase":{"type":"string"},"status":{"type":"string"}}}}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Sub-Tasks"],"description":"List sub-tasks for a print job","parameters":[{"schema":{"type":"string","enum":["pre","in_flight","post"]},"in":"query","name":"phase","required":false},{"schema":{"type":"string","enum":["QUEUED","IN_PROGRESS","FINISHED","FAILED","SKIPPED"]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{jobId}/subtask-runs/{subtaskId}/review":{"get":{"tags":["Sub-Tasks"],"description":"Get job-scoped subtask run review details","parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"path","name":"jobId","required":true},{"schema":{"type":"string"},"in":"path","name":"subtaskId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/subtasks/{id}":{"patch":{"tags":["Sub-Tasks"],"description":"Update a sub-task status or result","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["QUEUED","IN_PROGRESS","FINISHED","FAILED","SKIPPED"]},"result":{"type":"object"},"error_message":{"type":"string"},"retry_count":{"type":"number"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/subtasks/{id}/execute":{"post":{"tags":["Sub-Tasks"],"description":"Manually trigger sub-task execution","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/subtasks/{id}/retry":{"post":{"tags":["Sub-Tasks"],"description":"Retry a failed sub-task","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/subtasks/{id}/skip":{"post":{"tags":["Sub-Tasks"],"description":"Skip a failed sub-task","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/pending-subtasks":{"get":{"tags":["Sub-Tasks"],"description":"Get pending sub-tasks for a printer","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{jobId}/can-start":{"get":{"tags":["Sub-Tasks"],"description":"Check if job can start (all required pre-tasks complete)","parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/subtask-test-runs":{"post":{"tags":["Sub-Tasks"],"description":"Create an admin-triggered production-path subtask test run","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_type":{"type":"string"},"job_id":{"type":"number"},"printer_id":{"type":"string"},"inspection_z_buffer":{"type":"number"},"empty_bed_threshold":{"type":"number"},"max_attempts":{"type":"number"},"motion_confirmed":{"type":"boolean"}},"required":["task_type","job_id"]}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/subtask-runs":{"get":{"tags":["Sub-Tasks"],"description":"List admin-visible subtask runs","responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/subtask-runs/{subtaskId}":{"get":{"tags":["Sub-Tasks"],"description":"Get subtask run review details","parameters":[{"schema":{"type":"string"},"in":"path","name":"subtaskId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/subtask-runs/{subtaskId}/feedback":{"post":{"tags":["Sub-Tasks"],"description":"Record run-level feedback or frame correction for a subtask run","parameters":[{"schema":{"type":"string"},"in":"path","name":"subtaskId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/subtasks/{id}/frames":{"post":{"tags":["Sub-Tasks"],"description":"Internal endpoint for persisting subtask frame captures through the API","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"frame_base64":{"type":"string"},"content_type":{"type":"string"},"frame_timestamp":{"type":"string"},"metadata":{"type":"object"},"model_predicted_label":{"type":"string","nullable":true},"model_confidence":{"type":"number","nullable":true},"model_version":{"type":"string","nullable":true}},"required":["frame_base64"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/subtasks/{id}/events":{"post":{"tags":["Sub-Tasks"],"description":"Internal endpoint for appending durable subtask timeline events","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/subtasks/{id}/claim-bed-clear-execution":{"post":{"tags":["Sub-Tasks"],"description":"Atomically claim one current BED_CLEAR subtask before motion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"job_id":{"type":"integer","minimum":1},"printer_id":{"type":"string","format":"uuid"},"expected_model_id":{"type":"string","minLength":1},"expected_hardware_profile":{"type":"string","enum":["none","farmloop_stage_1"]},"authorization_mode":{"type":"string","enum":["production","supervised"]},"expected_rollout_evidence":{"anyOf":[{"type":"object"},{"type":"null"}]},"supervised_run_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"expected_plan_hash":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]}},"required":["job_id","printer_id","expected_model_id","expected_hardware_profile","authorization_mode","expected_rollout_evidence","supervised_run_id","expected_plan_hash"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/subtasks/{id}/consume-supervised-arm":{"post":{"tags":["Sub-Tasks"],"description":"Atomically consume one human-armed Stage 1 validation token before motion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"run_id":{"type":"string","minLength":1}},"required":["run_id"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/internal/subtasks/{id}/result":{"post":{"tags":["Sub-Tasks"],"description":"Internal endpoint for updating subtask results from hive-link","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["FINISHED","FAILED"]},"result":{"type":"object"},"error":{"type":"string"},"executionTimeMs":{"type":"number"},"dispatchLeaseToken":{"type":"string","format":"uuid"}},"required":["status","executionTimeMs"]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/loop-runs":{"post":{"tags":["Loop Runs"],"description":"Create a new loop run","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"total_iterations":{"type":"number","minimum":1},"cooldown_between_iterations_seconds":{"type":"number","minimum":0},"failure_policy":{"type":"string"},"verify_bed_clear":{"type":"boolean"},"printer_id":{"type":"string"},"print_job_id":{"type":"string"},"model_file_id":{"type":"string"},"config":{"type":"object"}},"required":["printer_id"]}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Loop Runs"],"description":"List loop runs","parameters":[{"schema":{"type":"string"},"in":"query","name":"printer_id","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"schema":{"type":"number"},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/loop-runs/{id}":{"get":{"tags":["Loop Runs"],"description":"Get a loop run by ID","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/loop-runs/{id}/start":{"post":{"tags":["Loop Runs"],"description":"Start a loop run (stub)","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/loop-runs/{id}/pause":{"post":{"tags":["Loop Runs"],"description":"Pause a running loop run","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/loop-runs/{id}/resume":{"post":{"tags":["Loop Runs"],"description":"Resume a paused loop run","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/loop-runs/{id}/cancel":{"post":{"tags":["Loop Runs"],"description":"Cancel a loop run (stub)","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/loop-runs/{id}/complete-iteration":{"post":{"tags":["Loop Runs"],"description":"Mark the current iteration complete and advance to the next (or complete the loop run)","parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/auto-bed-clear/preflight":{"get":{"tags":["Printers"],"description":"Get the Stage 1 Auto Bed Clear preflight decision for a printer and model file","parameters":[{"schema":{"type":"string"},"in":"query","name":"modelFileId","required":true},{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files/{fileId}/compatible-printers":{"get":{"summary":"Get printers ranked by compatibility with a file","tags":["Files"],"description":"Returns all printers in the organization ranked by their compatibility with the specified model file. Considers printer model, available filament slots, and material matching with color proximity.","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false,"description":"Organization ID (uses default if not provided)"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"in":"query","name":"includeOffline","required":false,"description":"Include offline printers in results"},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"makeId","required":false,"description":"Make ID to use for exact material matching via make_materials"},{"schema":{"type":"string","default":"15"},"in":"query","name":"colorThreshold","required":false,"description":"Delta-E threshold for color proximity matching (0-100)"},{"schema":{"type":"string"},"in":"query","name":"materialIds","required":false,"description":"JSON array of {index, materialId} for explicit material requirements"},{"schema":{"type":"string"},"in":"query","name":"acceptableMaterials","required":false,"description":"JSON array of acceptable material-set options: {optionId, label?, materialIds:[{index, materialId}]}"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"strategyExactMaterial","required":false,"description":"Enable exact material ID matching strategy"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"strategyTypeColor","required":false,"description":"Enable type + color matching strategy"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"strategyLooseMatch","required":false,"description":"Enable loose (type only) matching strategy"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"fileId","required":true,"description":"The model file ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"sliced_for_model":{"type":["null","string"]},"sliced_for_model_display":{"type":["null","string"]},"required_filaments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"type":{"type":"string"},"color":{"type":"string"},"used_grams":{"type":"number"}}}}}},"printers":{"type":"array","items":{"type":"object","properties":{"printer_id":{"type":"string"},"name":{"type":"string"},"model":{"type":"string"},"model_id":{"type":["null","string"]},"score":{"type":"number"},"match_type":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"is_connected":{"type":"boolean"},"compatibility_details":{"type":"object","additionalProperties":true},"state_observed_at":{"type":["null","string"]},"material_evidence":{"type":"object","additionalProperties":true},"material_evidence_gate":{"type":"object","additionalProperties":true}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/pause-light-settings":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["version","patterns"],"properties":{"version":{"type":"number","enum":[2]},"patterns":{"type":"object","required":["filament_runout","user_pause","gcode_pause","error","default"],"properties":{"filament_runout":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"user_pause":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"gcode_pause":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"error":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"default":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}}}}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}},"put":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["version","patterns"],"properties":{"version":{"type":"number","enum":[2]},"patterns":{"type":"object","required":["filament_runout","user_pause","gcode_pause","error","default"],"properties":{"filament_runout":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"user_pause":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"gcode_pause":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"error":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"default":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/pause-light-settings/host":{"get":{"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["version","patterns"],"properties":{"version":{"type":"number","enum":[2]},"patterns":{"type":"object","required":["filament_runout","user_pause","gcode_pause","error","default"],"properties":{"filament_runout":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"user_pause":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"gcode_pause":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"error":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"default":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}}}}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/pause-light-settings/preview":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["printerId","pattern"],"properties":{"printerId":{"type":"string"},"pattern":{"type":"object","required":["enabled","sequence","chamberLight","workLight"],"properties":{"enabled":{"type":"boolean"},"sequence":{"type":"array","items":[{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"},{"type":"boolean"}],"additionalItems":false,"minItems":5,"maxItems":5},"chamberLight":{"type":"boolean"},"workLight":{"type":"boolean"}}},"durationMs":{"minimum":1000,"maximum":30000,"default":5000,"type":"number"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/schedules/bed-clear-watch":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["timezone","enabled","bands","config"],"properties":{"timezone":{"minLength":1,"type":"string"},"enabled":{"type":"boolean"},"bands":{"type":"array","items":{"type":"object","required":["day_of_week","start","end","level"],"properties":{"day_of_week":{"minimum":0,"maximum":6,"type":"integer"},"start":{"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","type":"string"},"end":{"pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","type":"string"},"level":{"anyOf":[{"type":"string","enum":["off"]},{"type":"string","enum":["reduced"]},{"type":"string","enum":["active"]}]}}}},"config":{"type":"object","required":["level_intervals","give_up"],"properties":{"level_intervals":{"type":"object","required":["active","reduced","off"],"properties":{"active":{"minimum":1,"type":"integer"},"reduced":{"minimum":1,"type":"integer"},"off":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}]}}},"give_up":{"type":"object","required":["max_inspections","max_age_ms"],"properties":{"max_inspections":{"minimum":1,"type":"integer"},"max_age_ms":{"minimum":1,"type":"integer"}}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/v1/organizations/{organizationId}/operator-annotations":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-annotations/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-annotations/{id}/resolve":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tasks":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["printer_id","task_type"],"properties":{"printer_id":{"type":"string"},"task_type":{"type":"string","enum":["file_upload","file_delete"]},"model_file_id":{"type":"string"},"file_name":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"organizationId":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"printer_id","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"task_type","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printer-tasks/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","downloading","uploading","in_progress","completed","failed","cancelled"]},"progress":{"type":"number","minimum":0,"maximum":100},"speed":{"type":"number"},"error_code":{"type":"string"},"error_message":{"type":"string"},"started_at":{"type":"string"},"completed_at":{"type":"string"},"metadata":{"type":"object"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{printerId}/maintenance/plan":{"get":{"summary":"Get maintenance plan and task states for a printer","tags":["Maintenance"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"printerId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/maintenance/due":{"get":{"summary":"Get due/overdue maintenance tasks across organization","tags":["Maintenance"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"priority","required":false},{"schema":{"type":"integer","default":50},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/maintenance/summary":{"get":{"summary":"Get maintenance dashboard summary","tags":["Maintenance"],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{printerId}/maintenance/tasks/{taskType}/complete":{"post":{"summary":"Complete a maintenance task","tags":["Maintenance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string"},"nozzle_index":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"printerId","required":true},{"schema":{"type":"string"},"in":"path","name":"taskType","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{printerId}/maintenance/tasks/{taskType}/snooze":{"post":{"summary":"Snooze a maintenance task","tags":["Maintenance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["days"],"properties":{"days":{"type":"integer","minimum":1},"nozzle_index":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"printerId","required":true},{"schema":{"type":"string"},"in":"path","name":"taskType","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{printerId}/maintenance/tasks/{taskType}/dismiss":{"post":{"summary":"Dismiss a maintenance task","tags":["Maintenance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"nozzle_index":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"printerId","required":true},{"schema":{"type":"string"},"in":"path","name":"taskType","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{printerId}/maintenance/tasks/{taskType}/override":{"put":{"summary":"Override maintenance task trigger intervals","tags":["Maintenance"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["custom_interval_override"],"properties":{"custom_interval_override":{"type":"array","items":{"type":"object"}},"nozzle_index":{"type":"integer"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"printerId","required":true},{"schema":{"type":"string"},"in":"path","name":"taskType","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{printerId}/maintenance/evaluate":{"post":{"summary":"Force re-evaluation of maintenance tasks","tags":["Maintenance"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"printerId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{printerId}/maintenance/seed":{"post":{"summary":"Seed maintenance tasks for a printer","tags":["Maintenance"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"printerId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/action-feed":{"get":{"summary":"Get prioritized action feed for the organization","tags":["Action Feed"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"types","required":false,"description":"Comma-separated action types to filter"},{"schema":{"type":"string"},"in":"query","name":"minPriority","required":false,"description":"Minimum priority score"},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Max items to return (default 50)"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/action-feed/read":{"post":{"summary":"Mark an action feed item read or unread for the authenticated user","tags":["Action Feed"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1},"action_key":{"type":"string","minLength":1},"read":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/action-feed/dismiss":{"post":{"summary":"Dismiss an action feed item for the authenticated user","tags":["Action Feed"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string","minLength":1}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/action-feed/acknowledge":{"post":{"summary":"Acknowledge or dismiss action feed items","tags":["Action Feed"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["keys","action"],"properties":{"keys":{"type":"array","items":{"type":"string"},"minItems":1},"action":{"type":"string","enum":["acknowledged","dismissed"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/action-feed/assign":{"post":{"summary":"Assign or unassign an action feed item to a technician","tags":["Action Feed"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string"},"assignedTo":{"type":["string","null"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/action-feed/reads":{"get":{"summary":"Get the caller's read action feed keys","tags":["Action Feed"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/action-feed/history":{"get":{"summary":"Get action feed history","tags":["Action Feed"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"performedBy","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/briefing":{"get":{"summary":"Daily mobile briefing for the organization's Home screen","tags":["Mobile Briefing"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/ams":{"get":{"summary":"Aggregated AMS slots across the organization's enabled printers","tags":["AMS"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/printers/{id}/ams":{"get":{"summary":"Per-printer AMS slots for mobile filament mapping","tags":["AMS"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/assistant/voice/session":{"post":{"summary":"Start a Hex realtime voice session","tags":["Assistant"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"clientContext":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts":{"get":{"summary":"List assistant recommendation receipts for the organization","tags":["Recommendation Receipts"],"parameters":[{"schema":{"type":"string","enum":["pending","accepted","assigned","done","dismissed","snoozed","stale"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["assistant_chat","farm_playbook","farm_briefing","scheduled_alert"]},"in":"query","name":"source","required":false},{"schema":{"type":"string","enum":["clear_bed","start_job","resolve_at_risk","resolve_offline","preload_filament","material_runway"]},"in":"query","name":"kind","required":false},{"schema":{"type":"string","format":"uuid"},"in":"query","name":"printerId","required":false},{"schema":{"type":"string"},"in":"query","name":"printJobId","required":false},{"schema":{"type":"string"},"in":"query","name":"since","required":false,"description":"ISO timestamp lower bound on created_at"},{"schema":{"type":"string"},"in":"query","name":"until","required":false,"description":"ISO timestamp upper bound on created_at"},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Max items (default 50, max 200)"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/analytics":{"get":{"summary":"Recommendation follow-through analytics by action kind","tags":["Recommendation Receipts"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"since","required":false,"description":"ISO timestamp lower bound on created_at"},{"schema":{"type":"string"},"in":"query","name":"until","required":false,"description":"ISO timestamp upper bound on created_at"},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/batch":{"post":{"summary":"Batch-create assistant recommendation receipts with dedupe","tags":["Recommendation Receipts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["receipts"],"properties":{"organizationId":{"type":"string","format":"uuid"},"receipts":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["kind","source","title"],"additionalProperties":false,"properties":{"kind":{"type":"string","enum":["clear_bed","start_job","resolve_at_risk","resolve_offline","preload_filament","material_runway"]},"source":{"type":"string","enum":["assistant_chat","farm_playbook","farm_briefing","scheduled_alert"]},"title":{"type":"string","minLength":1},"description":{"type":["string","null"]},"suggestedAction":{"type":["string","null"]},"printerId":{"type":["string","null"],"format":"uuid"},"printJobId":{"type":["integer","null"]},"modelFileId":{"type":["string","null"],"format":"uuid"},"materialId":{"type":["string","null"],"format":"uuid"},"slot":{"type":["string","null"]},"deepLink":{"type":["string","null"]},"priority":{"type":["integer","null"]},"impactScore":{"type":["number","null"]},"sourceSessionId":{"type":["string","null"]},"sourceMessageId":{"type":["string","null"]},"sourceTool":{"type":["string","null"]},"sourceSnapshotHash":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":true}}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/promote-playbook":{"post":{"summary":"Promote selected farm-playbook recommendations into receipts","tags":["Recommendation Receipts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["recommendationKeys"],"properties":{"organizationId":{"type":"string","format":"uuid"},"recommendationKeys":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1}},"windowDays":{"type":"number","minimum":0.04,"maximum":90},"maxQueueScan":{"type":"integer","minimum":1,"maximum":50},"sourceSessionId":{"type":["string","null"]},"sourceMessageId":{"type":["string","null"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/{receiptId}/accept":{"post":{"summary":"Accept (acknowledge) a recommendation receipt","tags":["Recommendation Receipts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"receiptId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/{receiptId}/assign":{"post":{"summary":"Assign a recommendation receipt to a user","tags":["Recommendation Receipts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["assignedTo"],"properties":{"organizationId":{"type":"string","format":"uuid"},"assignedTo":{"type":"string","format":"uuid"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"receiptId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/{receiptId}/done":{"post":{"summary":"Mark a recommendation receipt done","tags":["Recommendation Receipts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"receiptId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/{receiptId}/dismiss":{"post":{"summary":"Dismiss a recommendation receipt with a reason","tags":["Recommendation Receipts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["dismissReason"],"properties":{"organizationId":{"type":"string","format":"uuid"},"dismissReason":{"type":"string","enum":["stale","incorrect","already_handled","unsafe","not_worth_it"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"receiptId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/{receiptId}/snooze":{"post":{"summary":"Snooze a recommendation receipt until a later time","tags":["Recommendation Receipts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["snoozedUntil"],"properties":{"organizationId":{"type":"string","format":"uuid"},"snoozedUntil":{"type":"string","description":"ISO timestamp to snooze until"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"receiptId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/recommendation-receipts/{receiptId}/events":{"get":{"summary":"List a recommendation receipt's lifecycle audit events","tags":["Recommendation Receipts"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"receiptId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/assistant-feedback":{"post":{"summary":"Create or update feedback for one assistant answer","tags":["Assistant Feedback"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["rating"],"additionalProperties":false,"properties":{"organizationId":{"type":"string","format":"uuid"},"rating":{"type":"string","enum":["helpful","not_helpful"]},"reason":{"type":["string","null"],"enum":["wrong_recommendation","stale_or_missing_data","not_actionable","unsafe_or_should_require_confirmation","missing_context","hard_to_act_on",null]},"note":{"type":["string","null"],"maxLength":1000},"metadata":{"type":"object","additionalProperties":true,"properties":{"messageId":{"type":"string"},"conversationId":{"type":"string"},"eveSessionId":{"type":"string"},"clientMessageId":{"type":"string"},"streamIndex":{"type":"number"},"promptHash":{"type":"string"},"promptExcerpt":{"type":"string"},"answerExcerpt":{"type":"string"},"pageContextKind":{"type":"string"},"sourceSurface":{"type":"string","enum":["main_transcript","focused_dialog"]},"provenanceSummary":{"type":"object","additionalProperties":true},"artifactKinds":{"type":"array","items":{"type":"string"}},"workflowKinds":{"type":"array","items":{"type":"string"}},"toolNames":{"type":"array","items":{"type":"string"}},"hasSourcesPanel":{"type":"boolean"},"hasWorkflowCard":{"type":"boolean"},"hasRecommendationCard":{"type":"boolean"},"hasApprovalPrompt":{"type":"boolean"},"hasAnnotationContext":{"type":"boolean"},"agentVersion":{"type":"string"},"modelVersion":{"type":"string"},"clientVersion":{"type":"string"},"answerGeneratedAt":{"type":"string"},"feedbackSubmittedAt":{"type":"string"}}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List assistant answer feedback for an organization","tags":["Assistant Feedback"],"parameters":[{"schema":{"type":"string","enum":["helpful","not_helpful"]},"in":"query","name":"rating","required":false},{"schema":{"type":"string","enum":["wrong_recommendation","stale_or_missing_data","not_actionable","unsafe_or_should_require_confirmation","missing_context","hard_to_act_on"]},"in":"query","name":"reason","required":false},{"schema":{"type":"string","enum":["new","reviewed","linked_issue","converted_to_eval"]},"in":"query","name":"reviewStatus","required":false},{"schema":{"type":"string"},"in":"query","name":"conversationId","required":false},{"schema":{"type":"string"},"in":"query","name":"messageId","required":false},{"schema":{"type":"string"},"in":"query","name":"toolName","required":false},{"schema":{"type":"string"},"in":"query","name":"pageContextKind","required":false},{"schema":{"type":"string"},"in":"query","name":"workflowKind","required":false},{"schema":{"type":"string"},"in":"query","name":"artifactKind","required":false},{"schema":{"type":"string"},"in":"query","name":"since","required":false},{"schema":{"type":"string"},"in":"query","name":"until","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/assistant-feedback/analytics":{"get":{"summary":"Assistant answer feedback trend metrics","tags":["Assistant Feedback"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"since","required":false},{"schema":{"type":"string"},"in":"query","name":"until","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/assistant-feedback/{feedbackId}":{"patch":{"summary":"Update feedback rating/reason or maintainer review state","tags":["Assistant Feedback"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"rating":{"type":"string","enum":["helpful","not_helpful"]},"reason":{"type":["string","null"],"enum":["wrong_recommendation","stale_or_missing_data","not_actionable","unsafe_or_should_require_confirmation","missing_context","hard_to_act_on",null]},"note":{"type":["string","null"],"maxLength":1000},"reviewStatus":{"type":"string","enum":["new","reviewed","linked_issue","converted_to_eval"]},"linkedIssueUrl":{"type":["string","null"]},"convertedEvalPath":{"type":["string","null"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"feedbackId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/assistant-feedback/{feedbackId}/eval-seed":{"post":{"summary":"Draft a sanitized eval seed skeleton from negative feedback","tags":["Assistant Feedback"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"linkedIssueUrl":{"type":["string","null"]},"convertedEvalPath":{"type":["string","null"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"feedbackId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/jobs":{"post":{"summary":"Create a slice job","tags":["HiveSlice"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organizationId","slicer","inputFileIds","printerProfileId","filamentProfileId","processProfileId"],"properties":{"organizationId":{"type":"string"},"slicer":{"type":"string","enum":["bambu_studio","orca_slicer"]},"inputFileIds":{"type":"array","items":{"type":"string"},"minItems":1},"printerProfileId":{"type":"string"},"filamentProfileId":{"type":"string"},"processProfileId":{"type":"string"},"transforms":{"type":"object","properties":{"scale":{"type":"number"},"rotate":{"type":"number"},"rotateX":{"type":"number"},"rotateY":{"type":"number"},"arrange":{"type":"boolean"},"orient":{"type":"boolean"},"centerX":{"type":"number"},"centerY":{"type":"number"},"repetitions":{"type":"integer","minimum":1}}}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List slice jobs","tags":["HiveSlice"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"integer","default":20,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","default":0},"in":"query","name":"offset","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/jobs/{jobId}":{"get":{"summary":"Get slice job status","tags":["HiveSlice"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/jobs/{jobId}/cancel":{"post":{"summary":"Cancel a slice job","tags":["HiveSlice"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/jobs/{jobId}/retry":{"post":{"summary":"Retry a failed slice job","tags":["HiveSlice"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/callback":{"post":{"summary":"Callback from slicing container","tags":["HiveSlice"],"description":"Internal endpoint called by Fly containers to report progress, completion, or failure","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jobId","type"],"properties":{"jobId":{"type":"string"},"type":{"type":"string","enum":["progress","completed","failed"]},"progress":{"type":"integer","minimum":0,"maximum":100},"phase":{"type":"string"},"error":{"type":"string"},"failureType":{"type":"string","enum":["retriable","terminal"]},"resultMetadata":{"type":"object"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/usage":{"get":{"summary":"Get HiveSlice usage and quota","tags":["HiveSlice"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/profiles":{"get":{"summary":"List slicer profiles","tags":["HiveSlice"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"string","enum":["bambu_studio","orca_slicer"]},"in":"query","name":"slicer","required":false},{"schema":{"type":"string","enum":["printer","filament","process"]},"in":"query","name":"profileType","required":false},{"schema":{"type":"string"},"in":"query","name":"printerModel","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Upload a custom slicer profile","tags":["HiveSlice"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hiveslice/profiles/{profileId}":{"delete":{"summary":"Delete a custom slicer profile","tags":["HiveSlice"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"profileId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer-gateway/updates/{target}/{arch}/{currentVersion}":{"get":{"summary":"Check for a Slicer Gateway desktop update","tags":["Public","Slicer Gateway"],"description":"Public Tauri updater endpoint for Print Hive Slicer Gateway. Returns 204 when no eligible update is configured for the requested target, architecture, and current version.","x-public":true,"parameters":[{"schema":{"type":"string"},"in":"path","name":"target","required":true},{"schema":{"type":"string"},"in":"path","name":"arch","required":true},{"schema":{"type":"string"},"in":"path","name":"currentVersion","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer-gateway/printers":{"get":{"summary":"List Gateway routing printers","tags":["Slicer Gateway"],"description":"Returns printer summaries used by Print Hive Slicer Gateway when routing captured prints to a selected physical printer.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer-gateway/captures/route":{"post":{"summary":"Route a captured slicer file","tags":["Slicer Gateway"],"description":"Uploads a captured slicer output, creates model/model_file records, and creates either a Smart Queue print job or a direct-printer job with upload task.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer-gateway/model-files/{modelFileId}/destination":{"patch":{"summary":"Move a routed Gateway model file","tags":["Slicer Gateway"],"description":"Moves a routed Slicer Gateway model file into an existing Print Hive model destination after the capture has already been routed.","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"modelFileId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer/status":{"get":{"summary":"Slicer status & user info","tags":["Slicer"],"description":"Returns connected user name, organization, and API version. Used by OrcaSlicer to verify credentials.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer/printers":{"get":{"summary":"List printers for slicer","tags":["Slicer"],"description":"Returns printers available for the authenticated user, with model and online status.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer/upload":{"post":{"summary":"Upload sliced file","tags":["Slicer"],"description":"Upload a .3mf/.gcode file from the slicer and queue Model File processing.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slicer/print":{"post":{"summary":"Upload a sliced file for printing","tags":["Slicer"],"description":"Upload a sliced file and queue Model File processing. Printing can start after the Model File is Ready.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/search":{"get":{"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/command/overview":{"get":{"summary":"Command dashboard overview KPIs","tags":["Analytics"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/command/utilization-trend":{"get":{"summary":"Daily utilization trend","tags":["Analytics"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"number","minimum":1,"maximum":90,"default":30},"in":"query","name":"days","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/command/filament-trend":{"get":{"summary":"Daily filament consumption by material","tags":["Analytics"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"number","minimum":1,"maximum":90,"default":30},"in":"query","name":"days","required":false},{"schema":{"type":"string","enum":["type","top10","all"],"default":"type"},"in":"query","name":"groupBy","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/command/jobs-per-day":{"get":{"summary":"Jobs completed/failed per day","tags":["Analytics"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false},{"schema":{"type":"number","minimum":1,"maximum":90,"default":30},"in":"query","name":"days","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/command/printer-efficiency":{"get":{"summary":"Printer efficiency breakdown by model","tags":["Analytics"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"organizationId","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/operator-sessions/presence":{"post":{"summary":"Record a visible-app presence heartbeat for session summary delivery","tags":["Operator Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-dispatch/profiles":{"get":{"summary":"List operator dispatch profiles for the organization","tags":["Operator Dispatch"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-dispatch/profiles/me":{"get":{"summary":"Read the caller's dispatch profile","tags":["Operator Dispatch"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update the caller's dispatch profile","tags":["Operator Dispatch"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"availabilityMode":{"type":"string","enum":["available","busy","supervisor_only","off_shift","unavailable"]},"zoneTag":{"type":["string","null"]},"capabilityTags":{"type":"array","items":{"type":"string","enum":["bed_clear","filament_swap","error_resolution","maintenance","readiness_override","setup","capacity","order_mapping"]}},"assignmentNotificationsEnabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-dispatch/profiles/{userId}":{"patch":{"summary":"Update another operator's dispatch profile","tags":["Operator Dispatch"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"availabilityMode":{"type":"string","enum":["available","busy","supervisor_only","off_shift","unavailable"]},"zoneTag":{"type":["string","null"]},"capabilityTags":{"type":"array","items":{"type":"string","enum":["bed_clear","filament_swap","error_resolution","maintenance","readiness_override","setup","capacity","order_mapping"]}},"assignmentNotificationsEnabled":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-dispatch/queue":{"get":{"summary":"Read the operator-aware dispatch queue","tags":["Operator Dispatch"],"parameters":[{"schema":{"type":"string","enum":["personal","supervisor"]},"in":"query","name":"mode","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-dispatch/assign":{"post":{"summary":"Assign, unassign, or accept dispatch work","tags":["Operator Dispatch"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key","action"],"properties":{"key":{"type":"string","minLength":1},"source":{"type":"string","enum":["action_feed","recommendation_receipt"]},"action":{"type":"string","enum":["assign_to_me","assign","unassign","accept"]},"assignedTo":{"type":["string","null"]},"reason":{"type":["string","null"]},"sourceLabel":{"type":"string","enum":["manual_assignment","hex_proposal","assign_to_me"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-dispatch/proposals":{"post":{"summary":"Preview a confirmation-gated assignment proposal","tags":["Operator Dispatch"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string","minLength":1}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/operator-dispatch/telemetry":{"get":{"summary":"Read aggregate dispatch telemetry","tags":["Operator Dispatch"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"since","required":false},{"schema":{"type":"string"},"in":"query","name":"until","required":false},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"organizationId","required":true}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/eve/operations/proposals":{"post":{"summary":"Create a server-bound Hex operation proposal","tags":["Hex","Public"],"description":"Validates an untrusted operation draft and returns the payload-free, server-authored consent card. Reusing an idempotency key returns the original proposal.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["contractVersion","operationType","payload","idempotencyKey"],"properties":{"contractVersion":{"type":"integer","enum":[1]},"operationType":{"type":"string"},"target":{"type":"object","additionalProperties":true},"payload":{"type":"object","additionalProperties":true},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200},"conversationId":{"type":["string","null"],"format":"uuid"},"clientConversationId":{"type":["string","null"]},"commandSource":{"type":"string"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["proposal","replayed"],"properties":{"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"replayed":{"type":"boolean"}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["proposal","replayed"],"properties":{"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"replayed":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/eve/operations/proposals/{proposalId}":{"get":{"summary":"Read a canonical Hex operation proposal","tags":["Hex","Public"],"description":"Returns one exact proposal version for recovery or cross-device rendering without exposing its normalized execution payload.","parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"version","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"proposalId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["proposal"],"properties":{"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/eve/operations/decide":{"post":{"summary":"Approve or cancel one canonical Hex operation proposal","tags":["Hex","Public"],"description":"Records one identity-only approval or cancellation. Exact retries return the durable decision receipt; conflicting transitions are refused.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["proposalId","proposalVersion","decision"],"properties":{"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"decision":{"type":"string","enum":["approved","cancelled"]}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["proposal","receipt","replayed","code"],"properties":{"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"receipt":{"type":"object","additionalProperties":false,"required":["id","proposalId","proposalVersion","decision","actorUserId","decidedAt","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"decision":{"type":"string","enum":["approved","cancelled"]},"actorUserId":{"type":"string"},"decidedAt":{"type":"string","format":"date-time"},"proposalToDecisionMs":{"type":"number","minimum":0},"replayed":{"type":"boolean"}}},"replayed":{"type":"boolean"},"code":{"type":"string"}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["proposal","receipt","replayed","code"],"properties":{"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"receipt":{"type":"object","additionalProperties":false,"required":["id","proposalId","proposalVersion","decision","actorUserId","decidedAt","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"decision":{"type":"string","enum":["approved","cancelled"]},"actorUserId":{"type":"string"},"decidedAt":{"type":"string","format":"date-time"},"proposalToDecisionMs":{"type":"number","minimum":0},"replayed":{"type":"boolean"}}},"replayed":{"type":"boolean"},"code":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/eve/transcribe":{"post":{"summary":"Transcribe a short Hex voice command","tags":["Hex","Public"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["model","organizationId","text"],"properties":{"model":{"type":"string"},"organizationId":{"type":["null","string"]},"text":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/eve/speech":{"post":{"summary":"Synthesize Hex speech audio for a spoken reply","tags":["Hex","Public"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":4000},"voice":{"type":"string"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","audioPath","contentType","expiresAt","model","voice"],"properties":{"id":{"type":"string"},"audioPath":{"type":"string"},"contentType":{"type":"string"},"expiresAt":{"type":"string"},"model":{"type":"string"},"voice":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/eve/speech/{id}":{"get":{"summary":"Download synthesized Hex speech audio","tags":["Hex","Public"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/eve/conversations":{"get":{"summary":"List Hex conversations for the authenticated user and active organization","tags":["Hex","Public"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create or update a Hex conversation snapshot","tags":["Hex","Public"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"id":{"type":["string","null"],"format":"uuid"},"clientId":{"type":["string","null"]},"title":{"type":["string","null"]},"sessionId":{"type":["string","null"]},"continuationToken":{"type":["string","null"]},"status":{"type":"string","enum":["waiting","completed","failed","unknown"]},"streamIndex":{"type":"number","minimum":0},"messages":{"type":"array","items":{"type":"object","required":["id","role","body","time"],"properties":{"id":{"type":"string"},"role":{"type":"string","enum":["operator","eve"]},"body":{"type":"string"},"time":{"type":"string"},"status":{"type":"string","enum":["complete","streaming","failed"]},"workflow":{},"activity":{"type":"object","additionalProperties":false,"required":["version","status","entries","overflowCount"],"properties":{"version":{"type":"number","enum":[1]},"status":{"type":"string","enum":["active","completed","failed","stopped"]},"entries":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["id","label","status","durationMs"],"properties":{"id":{"type":"string","pattern":"^activity-[0-9]+$"},"label":{"type":"string","enum":["Read fleet telemetry","Checked the production queue","Reviewed filament","Reviewed farm activity","Used a farm tool"]},"status":{"type":"string","enum":["completed","failed"]},"durationMs":{"type":"number","minimum":0,"maximum":604800000}}}},"overflowCount":{"type":"number","minimum":0,"maximum":1000000}}}}}}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/eve/operation-audit":{"post":{"summary":"Record a Hex operation proposal audit event","tags":["Hex","Public"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["proposal","decision"],"properties":{"conversationId":{"type":["string","null"],"format":"uuid"},"clientConversationId":{"type":["string","null"]},"proposal":{"type":"object","additionalProperties":true},"decision":{"type":"string","enum":["proposed","approved","cancelled"]},"commandSource":{"type":"string"},"executionResult":{"type":["object","null"],"additionalProperties":true},"failureReason":{"type":["string","null"]}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/eve/operations/execute":{"post":{"summary":"Execute one approved, server-bound Hex operation proposal","tags":["Hex","Public"],"description":"Executes canonical identity-only proposals through an atomic server claim. During the bounded compatibility window, legacy self-contained cards are accepted only when explicitly enabled.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"anyOf":[{"required":["proposalId","proposalVersion"]},{"required":["proposal"]}],"properties":{"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"payload":{},"conversationId":{"type":["string","null"],"format":"uuid"},"clientConversationId":{"type":["string","null"]},"proposal":{"type":"object","additionalProperties":true},"commandSource":{"type":"string"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["success","proposal","receipt"],"properties":{"success":{"type":"boolean"},"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"receipt":{"type":"object","additionalProperties":false,"required":["id","proposalId","proposalVersion","operationType","status","outcomeCode","claimedAt","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"status":{"type":"string","enum":["claimed","executed","failed_before_mutation","indeterminate"]},"outcomeCode":{"type":"string"},"result":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"failureReason":{"type":["null","string"]},"downstreamAttemptId":{"type":["null","string"]},"claimedAt":{"type":"string","format":"date-time"},"decisionToExecutionMs":{"type":"number","minimum":0},"completedAt":{"type":["null","string"]},"replayed":{"type":"boolean"}}}}}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":false,"required":["success","proposal","receipt"],"properties":{"success":{"type":"boolean"},"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"receipt":{"type":"object","additionalProperties":false,"required":["id","proposalId","proposalVersion","operationType","status","outcomeCode","claimedAt","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"status":{"type":"string","enum":["claimed","executed","failed_before_mutation","indeterminate"]},"outcomeCode":{"type":"string"},"result":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"failureReason":{"type":["null","string"]},"downstreamAttemptId":{"type":["null","string"]},"claimedAt":{"type":"string","format":"date-time"},"decisionToExecutionMs":{"type":"number","minimum":0},"completedAt":{"type":["null","string"]},"replayed":{"type":"boolean"}}}}},{"type":"object","additionalProperties":false,"required":["success","proposalId","operationType","status","result"],"properties":{"success":{"type":"boolean","enum":[true]},"proposalId":{"type":"string"},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"status":{"type":"string","enum":["executed"]},"result":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}}]}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["success","proposal","receipt"],"properties":{"success":{"type":"boolean"},"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"receipt":{"type":"object","additionalProperties":false,"required":["id","proposalId","proposalVersion","operationType","status","outcomeCode","claimedAt","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"status":{"type":"string","enum":["claimed","executed","failed_before_mutation","indeterminate"]},"outcomeCode":{"type":"string"},"result":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"failureReason":{"type":["null","string"]},"downstreamAttemptId":{"type":["null","string"]},"claimedAt":{"type":"string","format":"date-time"},"decisionToExecutionMs":{"type":"number","minimum":0},"completedAt":{"type":["null","string"]},"replayed":{"type":"boolean"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":false,"required":["success","proposal","receipt"],"properties":{"success":{"type":"boolean"},"proposal":{"type":"object","additionalProperties":false,"required":["kind","contractVersion","id","version","operationType","title","summary","consequence","risk","requiresConfirmation","parameters","status","createdAt","expiresAt"],"properties":{"kind":{"type":"string","enum":["eve.operation.proposal"]},"contractVersion":{"type":"integer","enum":[1]},"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"title":{"type":"string"},"summary":{"type":"string"},"consequence":{"type":"string"},"risk":{"type":"string","enum":["low","medium","high"]},"requiresConfirmation":{"type":"boolean","enum":[true]},"target":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}}},"status":{"type":"string","enum":["proposed","approved","cancelled","expired","claimed","executed","failed_before_mutation","indeterminate"]},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","format":"date-time"}}},"receipt":{"type":"object","additionalProperties":false,"required":["id","proposalId","proposalVersion","operationType","status","outcomeCode","claimedAt","replayed"],"properties":{"id":{"type":"string","format":"uuid"},"proposalId":{"type":"string","format":"uuid"},"proposalVersion":{"type":"integer","minimum":1},"operationType":{"type":"string","enum":["set_printer_ready","release_printers_batch","trigger_bov_batch","create_job","duplicate_job","restart_job","filament_rotation_action"]},"status":{"type":"string","enum":["claimed","executed","failed_before_mutation","indeterminate"]},"outcomeCode":{"type":"string"},"result":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"failureReason":{"type":["null","string"]},"downstreamAttemptId":{"type":["null","string"]},"claimedAt":{"type":"string","format":"date-time"},"decisionToExecutionMs":{"type":"number","minimum":0},"completedAt":{"type":["null","string"]},"replayed":{"type":"boolean"}}}}},{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["error","message"],"properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/v1/eve/assistant-settings":{"get":{"summary":"Read the active user's org-scoped Hex assistant settings","tags":["Hex","Public"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Update the active user's org-scoped Hex assistant settings","tags":["Hex","Public"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"autonomyLevel":{"type":"string","enum":["confirm_all","auto_low_risk","auto_low_and_medium_risk"]},"dailyBriefingTime":{"type":"string"},"activityDetailLevel":{"type":"string","enum":["plain","advanced"]},"responseStreamingMode":{"type":"string","enum":["live","smooth"]},"voice":{"type":"object","additionalProperties":false,"properties":{"voiceEnabled":{"type":"boolean"},"wakeWordEnabled":{"type":"boolean"},"wakeWordPhrase":{"type":"string"}}}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/assistant/capabilities":{"get":{"summary":"Read the active organization's Hex capability map","tags":["Hex","Public"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"organizationId","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hex/dispatch-check":{"post":{"summary":"Check whether the active organization may start a Hex turn","tags":["Hex","Public"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workflow":{"type":"string"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hex/usage/open":{"post":{"summary":"Open a Hex usage ledger row for one dispatch-gate decision","tags":["Hex","Public"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hex/usage/finalize":{"post":{"summary":"Finalize a Hex usage ledger row with a terminal status","tags":["Hex","Public"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hex/usage/history":{"get":{"summary":"Admin-only Hex usage history and spend attribution for an organization","tags":["Hex","Public"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/health":{"get":{"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}},"default":{"description":"Unexpected error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"servers":[{"url":"https://api.printhiv3d.com","description":"Production"}],"tags":[{"name":"API Keys","description":"API key management endpoints"},{"name":"Files","description":"File management endpoints"},{"name":"Printer Events","description":"Printer event handling endpoints"},{"name":"Printer Config","description":"Printer configuration management endpoints"},{"name":"Printers","description":"Printer management endpoints"},{"name":"Print Jobs","description":"Print job management endpoints"},{"name":"Batch Jobs","description":"Batch job management endpoints"},{"name":"Models","description":"3D model management endpoints"},{"name":"Listings","description":"Product listing management endpoints"},{"name":"Onboarding","description":"User onboarding endpoints"},{"name":"Platform Credentials","description":"Platform credential management endpoints"},{"name":"Loop","description":"Loop integration endpoints"},{"name":"Discord","description":"Discord integration endpoints"},{"name":"Notifications","description":"Notification management endpoints"},{"name":"Lifecycle Emails","description":"Lifecycle email drip management endpoints"},{"name":"Hosts","description":"Host management endpoints"},{"name":"Telemetry","description":"Host telemetry and metrics endpoints"},{"name":"RPI Images","description":"Raspberry Pi image generation endpoints"},{"name":"Organization Settings","description":"Organization settings management endpoints"},{"name":"Tasks","description":"Task and swimlane management endpoints"},{"name":"Product SKUs","description":"Product SKU management for order fulfillment"},{"name":"Makes","description":"Makes (production batches) management with SKU linking"},{"name":"Orders","description":"Order management and processing endpoints"},{"name":"Production Capacity","description":"Production capacity tracking and alerts"},{"name":"Shippo","description":"Shippo integration endpoints"},{"name":"OAuth","description":"OAuth 2.0 endpoints"},{"name":"Updates","description":"Hive Link update and installation endpoints"},{"name":"Feature Flags","description":"Feature flag evaluation endpoints"},{"name":"Organizations","description":"Organization management endpoints"},{"name":"Training","description":"Training data collection and management endpoints"},{"name":"Sub-Tasks","description":"Sub-task management for print jobs"},{"name":"Loop Runs","description":"Loop run management for iterative printing"},{"name":"Purchase Requests","description":"Inventory purchase request management endpoints"},{"name":"Inventory Orders","description":"Inventory order management endpoints"},{"name":"Maintenance","description":"Printer maintenance plan and task management"},{"name":"Public","description":"Public endpoints (no authentication required)"}]}