Start converting one PDF (metered)
const url = 'https://api.gevell.com/api/v1/convert?outputs=pdf%2Chtml';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/pdf'}, body: 'binary'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.gevell.com/api/v1/convert?outputs=pdf%2Chtml' \ --header 'Content-Type: application/pdf' \ --header 'X-API-Key: <X-API-Key>' \ --data binaryReserves the page count at your account’s per-page rate, then starts the conversion. Settlement happens when the conversion finishes; a conversion that fails releases the reservation and charges nothing. Honours AI opt-out settings.
Send the PDF as the raw body (application/pdf, with outputs and
fileName as query parameters, or X-File-Name), or JSON naming a staged
upload (inputKey, from POST /api/v1/tagging/uploads) or a public fileUrl.
Idempotency-Key (8-200 characters, A-Z a-z 0-9 . _ : -): the same key
from the same account returns the existing file and job (idempotentReplay: true, 202) and never reserves or charges again. A repeat while the first
request is still running answers 409 IDEMPOTENT_REQUEST_IN_PROGRESS
(with Retry-After). The same key with a different file size, source or
outputs answers 422 IDEMPOTENCY_KEY_REUSED. A start that failed
(402, 4xx) leaves the key free to retry. Keys are remembered for 24 hours.
A conversion that failed stays failed under its key: start again with a new key. A start that
failed before the conversion launched is retried for real.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”Query Parameters
Section titled “Query Parameters”Example
pdf,htmlRaw-body only. Comma-separated: html, pdf, conformance.
Raw-body only.
Request Bodyrequired
Section titled “Request Bodyrequired”Exactly one of inputKey or fileUrl.
object
What to deliver. Default ["pdf","conformance"]. pdf and conformance
come together; add html for the accessible HTML.
Responses
Section titled “ Responses ”Conversion started (or an idempotent replay). Poll GET /api/v1/convert/{fileId}.
object
object
Processing for a new job; on an idempotent replay, the file’s current status.
What to deliver. Default ["pdf","conformance"]. pdf and conformance
come together; add html for the accessible HTML.
Present (true) when this is a repeat of an earlier start with the same Idempotency-Key.
Example
{ "data": { "outputs": [ "html" ] }}Invalid body
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}Missing or invalid API key
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}Insufficient balance. Nothing was stored. The message and details state the amount needed.
object
object
object
object
Amounts are cents for pay-as-you-go accounts, pages for plan allowances.
object
Example
{ "success": false, "error": { "details": { "mode": "paygo" } }}InputKey is outside your own storage prefix
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}InputKey not found
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}AI services disabled for the account or organisation
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}PDF over 25 MB (FILE_TOO_LARGE)
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}Encrypted or unreadable PDF (PAGE_COUNT_UNAVAILABLE), or IDEMPOTENCY_KEY_REUSED
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}SPEND_LIMIT_EXCEEDED or DOLLAR_BUDGET_EXCEEDED
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}Unexpected error
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}Billing, the idempotency store or the daily system cost cap (SYSTEM_COST_CAP_REACHED) is temporarily unavailable; retry
object
object
object
Example
{ "success": false, "error": { "code": "INSUFFICIENT_CREDITS" }}