# Jobs resources

## Post Jobs

> accept a document for processing

```json
{"openapi":"3.1.0","info":{"title":"Helvia.ai Document Segmenter","version":"1.1.0"},"tags":[{"name":"Jobs resources"}],"security":[{"JWTBearer":[]}],"components":{"securitySchemes":{"JWTBearer":{"type":"http","scheme":"bearer"}},"schemas":{"Body_post_jobs_jobs_post":{"properties":{"uploadfile":{"type":"string","format":"binary","title":"Uploadfile"},"doctype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctype","default":""},"maxsize":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maxsize","default":5000},"usetags":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Usetags","default":"[]"},"maxtags":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maxtags","default":1},"callbackurl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callbackurl"},"process_images":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Process Images","default":false},"pdf_parsing_backend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Parsing Backend","default":"pymupdf"},"enable_ocr":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Ocr","default":false},"ocr_backend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Backend"},"force_full_page_ocr":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Force Full Page Ocr","default":false}},"type":"object","required":["uploadfile"],"title":"Body_post_jobs_jobs_post"},"ProcessDocReplySchema":{"properties":{"success":{"type":"boolean","title":"Success"},"jobid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jobid"},"documentid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Documentid"}},"type":"object","required":["success","jobid","documentid"],"title":"ProcessDocReplySchema"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/jobs":{"post":{"tags":["Jobs resources"],"summary":"Post Jobs","description":"accept a document for processing","operationId":"post_jobs_jobs_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_post_jobs_jobs_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessDocReplySchema"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Jobs

> return a list of all jobs

```json
{"openapi":"3.1.0","info":{"title":"Helvia.ai Document Segmenter","version":"1.1.0"},"tags":[{"name":"Jobs resources"}],"security":[{"JWTBearer":[]}],"components":{"securitySchemes":{"JWTBearer":{"type":"http","scheme":"bearer"}},"schemas":{"JobsReplySchema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JobSchema"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"JobsReplySchema"},"JobSchema":{"properties":{"id":{"type":"string","title":"Id"},"ip":{"type":"string","title":"Ip"},"documentid":{"type":"string","title":"Documentid"},"status":{"$ref":"#/components/schemas/JobStatus"},"created":{"type":"string","format":"date-time","title":"Created"},"updated":{"type":"string","format":"date-time","title":"Updated"},"completed":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed"},"maxsize":{"type":"integer","title":"Maxsize"},"timeit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeit"},"callbackurl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callbackurl"},"progress":{"type":"integer","title":"Progress"}},"type":"object","required":["id","ip","documentid","status","created","updated","completed","maxsize","timeit","callbackurl","progress"],"title":"JobSchema"},"JobStatus":{"type":"string","enum":["NEW","PENDING","PROCESSING","COMPLETED","FAILED","CANCELED"],"title":"JobStatus"}}},"paths":{"/jobs/":{"get":{"tags":["Jobs resources"],"summary":"Get Jobs","description":"return a list of all jobs","operationId":"get_jobs_jobs__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobsReplySchema"}}}},"404":{"description":"Not found"}}}}}}
```

## Get Job

> return the details of one job

```json
{"openapi":"3.1.0","info":{"title":"Helvia.ai Document Segmenter","version":"1.1.0"},"tags":[{"name":"Jobs resources"}],"security":[{"JWTBearer":[]}],"components":{"securitySchemes":{"JWTBearer":{"type":"http","scheme":"bearer"}},"schemas":{"JobSchema":{"properties":{"id":{"type":"string","title":"Id"},"ip":{"type":"string","title":"Ip"},"documentid":{"type":"string","title":"Documentid"},"status":{"$ref":"#/components/schemas/JobStatus"},"created":{"type":"string","format":"date-time","title":"Created"},"updated":{"type":"string","format":"date-time","title":"Updated"},"completed":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed"},"maxsize":{"type":"integer","title":"Maxsize"},"timeit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeit"},"callbackurl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callbackurl"},"progress":{"type":"integer","title":"Progress"}},"type":"object","required":["id","ip","documentid","status","created","updated","completed","maxsize","timeit","callbackurl","progress"],"title":"JobSchema"},"JobStatus":{"type":"string","enum":["NEW","PENDING","PROCESSING","COMPLETED","FAILED","CANCELED"],"title":"JobStatus"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/jobs/{jobid}":{"get":{"tags":["Jobs resources"],"summary":"Get Job","description":"return the details of one job","operationId":"get_job_jobs__jobid__get","parameters":[{"name":"jobid","in":"path","required":true,"schema":{"type":"string","title":"Jobid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSchema"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Delete Job

> delete a job and all related documents

```json
{"openapi":"3.1.0","info":{"title":"Helvia.ai Document Segmenter","version":"1.1.0"},"tags":[{"name":"Jobs resources"}],"security":[{"JWTBearer":[]}],"components":{"securitySchemes":{"JWTBearer":{"type":"http","scheme":"bearer"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/jobs/{jobid}":{"delete":{"tags":["Jobs resources"],"summary":"Delete Job","description":"delete a job and all related documents","operationId":"delete_job_jobs__jobid__delete","parameters":[{"name":"jobid","in":"path","required":true,"schema":{"type":"string","title":"Jobid"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Cancel Job

> cancel a job

```json
{"openapi":"3.1.0","info":{"title":"Helvia.ai Document Segmenter","version":"1.1.0"},"tags":[{"name":"Jobs resources"}],"security":[{"JWTBearer":[]}],"components":{"securitySchemes":{"JWTBearer":{"type":"http","scheme":"bearer"}},"schemas":{"CancelJobSchema":{"properties":{"status":{"$ref":"#/components/schemas/JobStatus"}},"type":"object","required":["status"],"title":"CancelJobSchema"},"JobStatus":{"type":"string","enum":["NEW","PENDING","PROCESSING","COMPLETED","FAILED","CANCELED"],"title":"JobStatus"},"JobSchema":{"properties":{"id":{"type":"string","title":"Id"},"ip":{"type":"string","title":"Ip"},"documentid":{"type":"string","title":"Documentid"},"status":{"$ref":"#/components/schemas/JobStatus"},"created":{"type":"string","format":"date-time","title":"Created"},"updated":{"type":"string","format":"date-time","title":"Updated"},"completed":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed"},"maxsize":{"type":"integer","title":"Maxsize"},"timeit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeit"},"callbackurl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callbackurl"},"progress":{"type":"integer","title":"Progress"}},"type":"object","required":["id","ip","documentid","status","created","updated","completed","maxsize","timeit","callbackurl","progress"],"title":"JobSchema"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/jobs/{jobid}":{"patch":{"tags":["Jobs resources"],"summary":"Cancel Job","description":"cancel a job","operationId":"cancel_job_jobs__jobid__patch","parameters":[{"name":"jobid","in":"path","required":true,"schema":{"type":"string","title":"Jobid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelJobSchema"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSchema"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
