Skip to main content
POST
/
api
/
v1
/
dev
/
tools
/
pdf
/
pages
Keep or remove PDF pages
curl --request POST \
  --url https://api.autype.com/api/v1/dev/tools/pdf/pages \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "fileId": "550e8400-e29b-41d4-a716-446655440000",
  "pages": [
    "1",
    "3-5"
  ],
  "mode": "keep",
  "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

Example:

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

pages
string[]
required

Page specifications (e.g. "1", "2-5", "3-")

Example:
["1", "3-5"]
mode
enum<string>
required

Whether to keep or remove the specified pages

Available options:
keep,
remove
Example:

"keep"

webhook
object

Optional webhook configuration

Response

201 - application/json

Pages 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)