{"openapi":"3.1.0","info":{"title":"Porter API","version":"1.0.0"},"servers":[{"url":"https://api.autotune.porter.fi/v1"}],"paths":{"/account":{"get":{"summary":"Check your key and processing limits","operationId":"account_account_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/uploads":{"post":{"summary":"Prepare a PDF upload","description":"Requires Idempotency-Key. POST the returned fields and PDF to upload_url. The API key must not be sent to storage.","operationId":"create_upload_uploads_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs":{"post":{"summary":"Process an uploaded PDF","description":"Requires Idempotency-Key. validate_only never reserves page credits. fix_only skips accessibility checks, not input or repair integrity checks.","operationId":"create_job_jobs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}":{"get":{"summary":"Get the exact job outcome","operationId":"get_job_jobs__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/download":{"get":{"summary":"Download this run’s repaired PDF","operationId":"get_download_jobs__job_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/report":{"get":{"summary":"Read this run’s accessibility report","operationId":"get_report_jobs__job_id__report_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketAccessibilityReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/{file_id}":{"delete":{"summary":"Delete the PDF and its retained artifacts","operationId":"delete_file_files__file_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccessibilityRuleCategory":{"properties":{"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"rules":{"items":{"$ref":"#/components/schemas/AccessibilityRuleSummary"},"type":"array","title":"Rules"},"passedRules":{"type":"integer","title":"Passedrules","description":"Count of passed rules in this category.","default":0},"failedRules":{"type":"integer","title":"Failedrules","description":"Count of failed rules in this category excluding font-only warnings.","default":0},"warningRules":{"type":"integer","title":"Warningrules","description":"Count of font-only rule failures in this category treated as warnings.","default":0},"passedChecks":{"type":"integer","title":"Passedchecks","description":"Count of passed checks in this category.","default":0},"failedChecks":{"type":"integer","title":"Failedchecks","description":"Count of failed checks in this category excluding font-only warnings.","default":0},"warningChecks":{"type":"integer","title":"Warningchecks","description":"Count of failed checks in this category from font-only warnings.","default":0}},"type":"object","required":["title","description"],"title":"AccessibilityRuleCategory"},"AccessibilityRuleInstance":{"properties":{"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errormessage"},"pageIndex":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pageindex","description":"0-based page index (when available)."},"pageNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pagenumber","description":"1-based page number (when available)."},"objectType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objecttype","description":"Best-effort playa object type for the referenced content (e.g. 'text', 'image', 'path', 'xobject', 'annotation')."},"fontName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fontname"},"mcid":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mcid"},"annotSubtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Annotsubtype"},"outlineTitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outlinetitle"},"outlineDestPageIndex":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outlinedestpageindex"},"bboxPct":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Bboxpct","description":"BBox in page percentages: left/right/bottom/top in [0,1]."}},"additionalProperties":false,"type":"object","title":"AccessibilityRuleInstance"},"AccessibilityRuleSummary":{"properties":{"ruleKey":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rulekey"},"ruleId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ruleid"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"specification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specification"},"clause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clause"},"testNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Testnumber","description":"veraPDF test number for this rule (when available)."},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note","description":"Optional human-readable note for certain ruleIds (e.g., font-resource warnings that are not actionable)."},"isWarning":{"type":"boolean","title":"Iswarning","description":"True only for font-resource warning rules (ruleId in fontWarningRuleIds).","default":false},"githubClauseLink":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Githubclauselink","description":"GitHub wiki link for the PDF/UA-1 rule (when clause and testNumber are available)."},"passed":{"type":"boolean","title":"Passed"},"passedChecks":{"type":"integer","title":"Passedchecks","default":0},"failedChecks":{"type":"integer","title":"Failedchecks","default":0},"instances":{"items":{"$ref":"#/components/schemas/AccessibilityRuleInstance"},"type":"array","title":"Instances","description":"Per-check instances (context, page, bbox, etc) for failed checks."}},"type":"object","required":["passed"],"title":"AccessibilityRuleSummary"},"AccessibilitySnapshot":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/AccessibilityRuleCategory"},"type":"array","title":"Categories"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errormessage","description":"Optional error message when the accessibility checker could not produce a valid veraPDF result (e.g., veraPDF crashed)."},"passedRules":{"type":"integer","title":"Passedrules","description":"Count of passed rules (font-only rule failures are excluded from failedRules and counted in warningRules).","default":0},"failedRules":{"type":"integer","title":"Failedrules","description":"Count of failed rules excluding font-only warnings.","default":0},"warningRules":{"type":"integer","title":"Warningrules","description":"Count of font-only rule failures treated as warnings.","default":0},"passedChecks":{"type":"integer","title":"Passedchecks","description":"Count of passed checks.","default":0},"failedChecks":{"type":"integer","title":"Failedchecks","description":"Count of failed checks excluding font-only warnings.","default":0},"warningChecks":{"type":"integer","title":"Warningchecks","description":"Count of failed checks from font-only rule failures treated as warnings.","default":0}},"type":"object","title":"AccessibilitySnapshot"},"DownloadResponse":{"properties":{"file_id":{"type":"string","title":"File Id"},"download_url":{"type":"string","title":"Download Url"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"}},"type":"object","required":["file_id","download_url","expires_in_seconds"],"title":"DownloadResponse"},"FileAccessibility":{"properties":{"file_id":{"type":"string","title":"File Id"},"before":{"anyOf":[{"$ref":"#/components/schemas/AccessibilitySnapshot"},{"type":"null"}]},"after":{"anyOf":[{"$ref":"#/components/schemas/AccessibilitySnapshot"},{"type":"null"}]}},"type":"object","required":["file_id"],"title":"FileAccessibility"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobRequest":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"mode":{"type":"string","enum":["fix_and_validate","fix_only","validate_only"],"title":"Mode","default":"fix_and_validate"},"reference":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Reference"},"retention":{"type":"string","enum":["14","90","keep"],"title":"Retention","default":"14"},"automatic_improvements":{"type":"boolean","title":"Automatic Improvements","description":"Opt in to later validated improvement runs, potentially days or weeks later. Requires fix_and_validate, the automatic-rerun entitlement and a retained file.","default":false}},"additionalProperties":false,"type":"object","required":["upload_id"],"title":"JobRequest"},"JobResponse":{"properties":{"id":{"type":"string","title":"Id"},"file_id":{"type":"string","title":"File Id"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"mode":{"type":"string","enum":["fix_and_validate","fix_only","validate_only"],"title":"Mode"},"status":{"type":"string","enum":["queued","processing","validating","completed","failed"],"title":"Status"},"trigger":{"type":"string","enum":["initial","manual_retry","automatic_improvement"],"title":"Trigger"},"previous_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Job Id"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count"},"has_output":{"type":"boolean","title":"Has Output"},"validation":{"$ref":"#/components/schemas/ValidationResult"},"error":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["id","file_id","reference","mode","status","trigger","page_count","has_output","validation","created_at","expires_at"],"title":"JobResponse"},"TicketAccessibilityReport":{"properties":{"ticket_id":{"type":"string","title":"Ticket Id"},"files":{"items":{"$ref":"#/components/schemas/FileAccessibility"},"type":"array","title":"Files"},"deep_dive_enabled":{"type":"boolean","title":"Deep Dive Enabled","default":false}},"type":"object","required":["ticket_id"],"title":"TicketAccessibilityReport"},"UploadRequest":{"properties":{"filename":{"type":"string","maxLength":255,"minLength":1,"title":"Filename"},"size_bytes":{"type":"integer","exclusiveMinimum":0,"title":"Size Bytes"}},"additionalProperties":false,"type":"object","required":["filename","size_bytes"],"title":"UploadRequest"},"UploadResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"upload_url":{"type":"string","title":"Upload Url"},"fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Fields"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"}},"type":"object","required":["upload_id","upload_url","fields","expires_in_seconds"],"title":"UploadResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationResult":{"properties":{"status":{"type":"string","enum":["pending","running","completed","failed","skipped"],"title":"Status"},"failed_checks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Checks"},"failed_rules":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Rules"}},"type":"object","required":["status"],"title":"ValidationResult"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"Organization API key, created in API setup.","scheme":"bearer"}}}}