{"openapi":"3.0.3","info":{"title":"API","version":"1"},"paths":{"/api/tasks/forms":{"post":{"summary":"Parse web page data or pdf file into form configuration","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"url","example":"https://www.miamigov.com/files/sharedassets/public/building/fbc-2020-hvhz-uniform-roofing-application-form.pdf"},"content_type":{"type":"string","enum":["pdf","html"],"default":"pdf"},"xpath":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","$ref":"#/components/schemas/FormTask"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/tasks/workflows":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"url","example":"https://www.miamigov.com/Permits-Construction/Permit-Catalog"},"xpath":{"type":"string","example":"//*[@id=\"main-content\"]/div/div[1]"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","$ref":"#/components/schemas/WorkflowTask"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/tasks/workflow_steps":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"url","example":"https://www.miamigov.com/Permits-Construction/Permit-Catalog/Request-a-Temporary-Event-Permit-TEP"},"xpath":{"type":"string","example":"//*[@id=\"tabs-body\"]"},"extract_connected_data":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","$ref":"#/components/schemas/WorkflowStepsTask"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/tasks/{id}":{"get":{"summary":"Fetch a task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Task ID"}],"responses":{"200":{"description":"Task object","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","oneOf":[{"$ref":"#/components/schemas/FormTask"},{"$ref":"#/components/schemas/WorkflowTask"},{"$ref":"#/components/schemas/WorkflowStepsTask"}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"schemas":{"Task":{"type":"object","required":["id","type","attributes"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","default":"task"},"attributes":{"type":"object","required":["id","status","created_at","updated_at","type","parameters","result"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["created","processing","completed","failed"]},"created_at":{"type":"string","format":"timestamp"},"updated_at":{"type":"string","format":"timestamp"},"type":{"type":"string","enum":["form","workflows","workflow_steps"]},"parameters":{"type":"object"},"result":{"type":"object"}}}}},"FormTask":{"allOf":[{"$ref":"#/components/schemas/Task"},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","default":"task"},"attributes":{"type":"object","properties":{"type":{"type":"string","default":"form"}}}}}]},"WorkflowTask":{"allOf":[{"$ref":"#/components/schemas/Task"},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","default":"task"},"attributes":{"type":"object","properties":{"type":{"type":"string","default":"workflows"}}}}}]},"WorkflowStepsTask":{"allOf":[{"$ref":"#/components/schemas/Task"},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","default":"task"},"attributes":{"type":"object","properties":{"type":{"type":"string","default":"workflow_steps"}}}}}]},"Error":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorItem"}}}},"ErrorItem":{"type":"object","required":["id","detail","status","title","source"],"properties":{"id":{"type":"string","format":"uuid"},"detail":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"source":{"type":"object","required":["pointer"],"properties":{"pointer":{"type":"string"}}}}}}},"security":[{"basicAuth":[]}],"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/Pavel-Kuzovkin/93f9f5d4-7c51-4e78-bb8f-fa672c3000b6/1"},{"url":"https://{defaultHost}","variables":{"defaultHost":{"default":"cv-intelli-form.herokuapp.com"}}}]}