Skip to Content
Audiobooks

Cancel an audiobook

POST
/documents/{id}/audiobooks/{audiobookId}/cancel

Formats and speeds of the same settings share one generation run, so stopping it also cancels the other whole-book requests that share it. POST to the collection with the same settings resumes from the cached audio.

Authorization

headerAuthorizationBearer <token>

Authorization code with S256 PKCE. Discover issuer metadata at /.well-known/oauth-authorization-server/api/auth and resource metadata at /.well-known/oauth-protected-resource/api/v1. Request the /api/v1 resource explicitly. The same token endpoint also supports the advertised OAuth device grant.

Scope: audio:generate

Path Parameters

id*string
Match^[a-f0-9]{64}$
audiobookId*string

Response Body

Cancelled state, which later reads also report. Chapter cancel is rejected.

application/json
  1. response
id*string
documentId*string
Match^[a-f0-9]{64}$
status*string

cancelled: someone stopped the request. A POST with the same settings resumes it from the cached audio.

Value in"idle""preparing""queued""generating""complete""stopped""usage_limited""interrupted""failed""building""waiting""ready""cancelled"
progress*|
Range0 <= value <= 1
provider*string

Speech provider, as a request names it.

model*string
voice*string
modelSpeed*number

The rate the model speaks at; speed is the finished file's playback speed.

requestedAt*|

When it was last requested or cancelled; null when nobody has asked for it.

Formatdate-time
format*string
Value in"mp3""m4b"
speed*number
chapter*integer|null
downloadUrl*string|null
filename*string|null
webUrl*string
Formaturi
webDownloadUrl*|
Formaturi
retryAfterMs*number|null
generation*
segments*|null
artifact*
Example Request
curl -X POST 'https://reader.example/api/v1/documents/string/audiobooks/string/cancel'
Example Response
{  "id": "string",  "documentId": "string",  "status": "idle",  "progress": 0,  "provider": "string",  "model": "string",  "voice": "string",  "modelSpeed": 0,  "requestedAt": "2019-08-24T14:15:22Z",  "format": "mp3",  "speed": 0,  "chapter": 0,  "downloadUrl": "string",  "filename": "string",  "webUrl": "http://example.com",  "webDownloadUrl": "http://example.com",  "retryAfterMs": 0,  "generation": {    "state": "idle",    "operationId": "string",    "issue": {      "code": "string",      "message": "string"    }  },  "segments": {    "plannedSegments": 0,    "completedSegments": 0,    "skippedSegments": 0,    "lastSkipIssue": {      "code": "string",      "message": "string"    },    "chapters": [      {        "index": 0,        "title": "string",        "spineHref": "string",        "page": 0,        "plannedSegments": 0,        "completedSegments": 0,        "skippedSegments": 0,        "generatingSegments": 0,        "durationMs": 0      }    ]  },  "artifact": {    "state": "none",    "operationId": "string",    "issue": {      "code": "string",      "message": "string"    }  }}