curl --request POST \
--url https://anythingmd.com/api/v1/jobs/{jobId}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://anythingmd.com/api/v1/jobs/{jobId}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://anythingmd.com/api/v1/jobs/{jobId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://anythingmd.com/api/v1/jobs/{jobId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"status": "queued",
"source": {
"type": "document",
"documentId": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"fileSource": "managed",
"includeImages": true,
"cached": true,
"pageRange": {
"start": 4503599627370496,
"end": 4503599627370496
},
"partial": true,
"nextStartPage": 4503599627370496,
"estimatedTotalPages": 0,
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"errorCode": "<string>",
"idempotencyKey": "<string>",
"usage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"stage": "preparing",
"stageProgress": 50,
"message": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Cancel a job
Cancels a job that has not finished. Reserved credits are refunded. Requires the documents:delete scope.
curl --request POST \
--url https://anythingmd.com/api/v1/jobs/{jobId}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://anythingmd.com/api/v1/jobs/{jobId}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://anythingmd.com/api/v1/jobs/{jobId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://anythingmd.com/api/v1/jobs/{jobId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "<string>",
"operation": "convert",
"capabilityVersion": "<string>",
"status": "queued",
"source": {
"type": "document",
"documentId": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"fileSource": "managed",
"includeImages": true,
"cached": true,
"pageRange": {
"start": 4503599627370496,
"end": 4503599627370496
},
"partial": true,
"nextStartPage": 4503599627370496,
"estimatedTotalPages": 0,
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"errorCode": "<string>",
"idempotencyKey": "<string>",
"usage": {
"inputBytes": 4503599627370495,
"discoveredPages": 4503599627370495,
"ocrPages": 4503599627370495,
"outputBytes": 4503599627370495,
"durationMs": 4503599627370495
},
"stage": "preparing",
"stageProgress": 50,
"message": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Create a key under Settings → API Keys and send it as Authorization: Bearer amd_live_…. See https://docs.anythingmd.com/authentication.
Headers
If reused within the retention window, replay the original result instead of a second mutation
1Path Parameters
Id of an async job
1Response
Updated job (status canceled when cancellation succeeded)
Id of an async job
1convert Pinned version of this capability. Quotes, receipts, rate cards, and Skills key off operation + version.
1queued, running, input_required, succeeded, failed, canceled, expired - Option 1
- Option 2
Show child attributes
Show child attributes
ISO-8601 creation time
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$ISO-8601 last status change
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$managed, external True when results were returned from content-hash cache
Pages this job converted (1-based, inclusive), when known
Show child attributes
Show child attributes
True when the job stopped at the pages its credits covered; convert the rest with startPage = nextStartPage
Present on partial jobs: the first page not yet converted
2 <= x <= 9007199254740991Page count read from the file before converting, when it could be read
-9007199254740991 <= x <= 9007199254740991^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$Present when status is failed
Stable machine code when status is failed. stranded_running means the worker or client disappeared; it is not a conversion failure.
Natural usage units for this job; never credits or currency
Show child attributes
Show child attributes
Fine-grained phase within the current status
preparing, converting, finalizing, complete, error 0–100 progress within the current stage
0 <= x <= 100Human-readable status for display