> For the complete documentation index, see [llms.txt](https://docs.mioffice.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mioffice.ai/queue.md).

# Queue

## Poll job status

> Check the status and queue position of an async processing job.

```json
{"openapi":"3.0.3","info":{"title":"MiOffice API","version":"1.0.0"},"servers":[{"url":"https://mioffice.ai","description":"Production"}],"paths":{"/api/queue":{"get":{"operationId":"getJobStatus","summary":"Poll job status","description":"Check the status and queue position of an async processing job.","tags":["Queue"],"parameters":[{"name":"jobId","in":"query","required":true,"schema":{"type":"string"},"description":"Job ID from the 202 response"},{"name":"jobToken","in":"query","required":true,"schema":{"type":"string"},"description":"Job token for authorization"}],"responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","processing","done","error"]},"position":{"type":"integer"},"estimatedWaitMs":{"type":"integer"},"error":{"type":"string"}}}}}},"400":{"description":"Missing jobId or jobToken"},"403":{"description":"Invalid job token"},"404":{"description":"Job not found"}}}}}}
```

## Cancel a queued job

> Cancel a job that hasn't started processing yet.

```json
{"openapi":"3.0.3","info":{"title":"MiOffice API","version":"1.0.0"},"servers":[{"url":"https://mioffice.ai","description":"Production"}],"paths":{"/api/queue":{"delete":{"operationId":"cancelJob","summary":"Cancel a queued job","description":"Cancel a job that hasn't started processing yet.","tags":["Queue"],"parameters":[{"name":"jobId","in":"query","required":true,"schema":{"type":"string"}},{"name":"jobToken","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"boolean"}}}}}},"403":{"description":"Invalid job token"},"404":{"description":"Job not found or already completed"}}}}}}
```

## Fetch completed job result

> Download the processed file after job completes. One-time fetch — result is purged after retrieval.

```json
{"openapi":"3.0.3","info":{"title":"MiOffice API","version":"1.0.0"},"servers":[{"url":"https://mioffice.ai","description":"Production"}],"paths":{"/api/queue/result":{"get":{"operationId":"getJobResult","summary":"Fetch completed job result","description":"Download the processed file after job completes. One-time fetch — result is purged after retrieval.","tags":["Queue"],"parameters":[{"name":"jobId","in":"query","required":true,"schema":{"type":"string"}},{"name":"jobToken","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Processed file binary","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"202":{"description":"Job not ready yet — poll /api/queue first"},"403":{"description":"Invalid job token"},"404":{"description":"Job not found"},"410":{"description":"Result expired or already fetched"}}}}}}
```
