Skip to main content
POST
/
api
/
v1
/
dev
/
tools
/
pdf
/
toimage
PDF to image
curl --request POST \
  --url https://api.autype.com/api/v1/dev/tools/pdf/toimage \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "fileId": "550e8400-e29b-41d4-a716-446655440000",
  "format": "png",
  "dpi": 150,
  "pages": [
    "1",
    "3"
  ],
  "webhook": {
    "webhookUrl": "https://example.com/webhook",
    "webhookAuth": {
      "headerName": "X-API-Key",
      "headerValue": "my-secret-key",
      "basicAuthUsername": "user",
      "basicAuthPassword": "pass"
    }
  }
}
'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "action": "pdf.merge",
  "status": "PENDING",
  "inputFileIds": [
    "file-id-1",
    "file-id-2"
  ],
  "outputFileId": null,
  "error": null,
  "createdAt": "2023-11-07T05:31:56Z",
  "startedAt": {},
  "completedAt": {},
  "metadata": {}
}

Authorizations

X-API-Key
string
header
required

API Key (starts with ak_...)

Body

application/json
fileId
string
required

File ID of the PDF to convert

Example:

"550e8400-e29b-41d4-a716-446655440000"

format
enum<string>

Output image format (default: "png")

Available options:
png,
jpeg
Example:

"png"

dpi
number

Resolution in DPI, 72–600 (default: 150)

Required range: 72 <= x <= 600
Example:

150

pages
string[]

Page specifications to convert (e.g. "1", "2-5"). If omitted, all pages are converted.

Example:
["1", "3"]
webhook
object

Optional webhook configuration

Response

201 - application/json

PDF to image job created

id
string
required

Job ID

Example:

"550e8400-e29b-41d4-a716-446655440000"

action
string
required

Action that was performed

Example:

"pdf.merge"

status
enum<string>
required

Current job status

Available options:
PENDING,
PROCESSING,
COMPLETED,
FAILED
Example:

"PENDING"

inputFileIds
string[]
required

Input file IDs

Example:
["file-id-1", "file-id-2"]
outputFileId
object
required

Output file ID (available when COMPLETED)

Example:

null

error
object
required

Error message (available when FAILED)

Example:

null

createdAt
string<date-time>
required

Job creation timestamp

startedAt
object
required

Job start timestamp

completedAt
object
required

Job completion timestamp

metadata
object

Additional metadata (e.g. PDF metadata result)