{"openapi":"3.1.0","info":{"title":"RPA Portais","summary":"Notas de saída baixadas dos portais fiscais com o certificado A1.","description":"Guia de integração: [/](/). Toda rota, menos `/health`, exige `X-API-Key`.","version":"0.1.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/portals":{"get":{"summary":"List Portals","operationId":"list_portals_portals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PortalView"},"type":"array","title":"Response List Portals Portals Get"}}}}},"security":[{"APIKeyHeader":[]}]}},"/portals/{portal_name}/jobs":{"post":{"summary":"Create Job","operationId":"create_job_portals__portal_name__jobs_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"portal_name","in":"path","required":true,"schema":{"type":"string","title":"Portal Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}":{"get":{"summary":"Get Job","operationId":"get_job_jobs__job_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/cancel":{"post":{"summary":"Cancel Job","operationId":"cancel_job_jobs__job_id__cancel_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/file":{"get":{"summary":"Get File","operationId":"get_file_jobs__job_id__file_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"expires","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires"}},{"name":"sig","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sig"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobStatus":{"type":"string","enum":["queued","running","awaiting_captcha","retry_scheduled","cancelled","succeeded","failed"],"title":"JobStatus"},"JobView":{"properties":{"id":{"type":"string","title":"Id"},"portal":{"type":"string","title":"Portal"},"status":{"$ref":"#/components/schemas/JobStatus"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"attempts":{"type":"integer","title":"Attempts"},"max_attempts":{"type":"integer","title":"Max Attempts"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt At"},"status_url":{"type":"string","title":"Status Url"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"},"captcha_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captcha Url"},"live_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Live Url"}},"type":"object","required":["id","portal","status","params","created_at","started_at","finished_at","error","attempts","max_attempts","next_attempt_at","status_url","download_url","captcha_url","live_url"],"title":"JobView"},"PortalView":{"properties":{"name":{"type":"string","title":"Name"},"params_schema":{"additionalProperties":true,"type":"object","title":"Params Schema"}},"type":"object","required":["name","params_schema"],"title":"PortalView"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"Chave entregue pela Khontra","in":"header","name":"X-API-Key"}}}}