Request body
sourceUrl— HTTPS or signed URL pointing to the ebook archive. Required iffileis not provided.file— Optional uploaded EPUB or MOBI file (multipart/form-data).sourceName— Optional label saved with the extracted records.options— Optional object. Supported keys:segmentLength— Target characters per chunk (default1000).includeTableOfContents— Boolean; append TOC entries to each chunk (defaulttrue).language— ISO language hint for sentence segmentation.
webhookUrl— Optional HTTPS URL Horizon should call when the extraction finishes.
Sample request
Response
Returns202 Accepted with jobId, status, and statusUrl. When processing finishes quickly, the normalized chapter chunks appear in result.
Notes
- Inline images are ignored; image captions are captured when present.
- TOC entries are mapped into chunk attributes (
chapter,section). - Use signed URLs that remain valid for several minutes; larger ebooks can take up to 5 minutes to process.
- Poll
GET /jobs/{jobId}(identical tostatusUrl) if you need to check progress or refetch the normalized chunks. - To upload the ebook directly, send
multipart/form-datawith afilefield instead ofsourceUrl.
x402 flow
Ebook extraction is billed per archive through Coinbase’s x402 protocol. If funding is required, Horizon issues:accepts data to your facilitator, complete the /verify and /settle cycle, then retry the call with the Base64 payload in X-PAYMENT. Horizon resumes the job and includes X-PAYMENT-RESPONSE when settlement succeeds.Body
application/json
Provide either sourceUrl or file.
Extraction hints such as language, segmentLength, transcriptionModel, or sheet preferences depending on the endpoint.
Webhook to call when the extraction completes.
Upload the raw file instead of providing sourceUrl.
Response
Extraction job accepted
Example:
"job_01hx9q9"
Available options:
queued, processing, completed, failed Canonical link to GET /jobs/{jobId} for this job.
Example:
"extract/pdf"
Present when the job completes synchronously.
Estimated seconds until completion.