Skip to main content
POST
/
api
/
v1
/
process-pdf-async
Generate Content from PDF
curl --request POST \
  --url https://api.example.com/api/v1/process-pdf-async \
  --header 'Content-Type: application/json' \
  --data '
{
  "format": "<string>",
  "visualTemplate": "<string>",
  "platform": "<string>",
  "slideCount": "<string>",
  "maxDuration": "<string>",
  "customPrompt": "<string>",
  "captionsEnabled": "<string>",
  "captionsStyle": "<string>",
  "captionsPosition": "<string>",
  "captionsFontSize": "<string>",
  "visualStyleVariant": "<string>"
}
'
{
  "error": "Invalid format. Must be: image, carousel, or reel"
}

Endpoint

POST /api/v1/process-pdf-async

Authentication

Requires API key in x-api-key header.

Request

This endpoint accepts multipart/form-data for file upload.
pdf
file
required
PDF file to process (max 10MB, must be application/pdf)
format
string
required
Content format. Options: image, carousel, reel
visualTemplate
string
Visual style template. Options: infographic, screenshot, meme, minimal, magazine, neon, news
platform
string
Target platform. Options: instagram, tiktok, youtube_shorts
slideCount
string
Number of slides for carousel format (as string). Range: “1”-“5”. Only applicable when format is carousel
maxDuration
string
Maximum video duration in seconds (as string). Range: “15”-“180”. Only applicable when format is reel
customPrompt
string
Custom instructions for content generation
captionsEnabled
string
Enable captions for video reels. Use "true" or "false". Only applicable when format is reel
captionsStyle
string
Caption style. Options: modern, minimal. Requires captionsEnabled: "true"
captionsPosition
string
Caption position. Options: bottom, center. Requires captionsEnabled: "true"
captionsFontSize
string
Caption font size. Options: small, medium, large. Requires captionsEnabled: "true"
visualStyleVariant
string
Additional style variant for customization

Response

success
boolean
Indicates if the request was successful
message
string
Human-readable status message
data
object

Example Request

curl -X POST https://api.distylia.com/api/v1/process-pdf-async \
  -H "x-api-key: YOUR_API_KEY" \
  -F "[email protected]" \
  -F "format=carousel" \
  -F "slideCount=5" \
  -F "visualTemplate=minimal" \
  -F "platform=instagram"

Example Response

{
  "success": true,
  "message": "PDF processing job created successfully",
  "data": {
    "jobId": "550e8400-e29b-41d4-a716-446655440000",
    "status": "pending"
  }
}

Error Responses

{
  "error": "Invalid format. Must be: image, carousel, or reel"
}

Notes

  • Maximum file size is 10MB
  • Only PDF files are accepted (validated by MIME type)
  • All form fields except pdf and format are optional
  • Number fields (slideCount, maxDuration) must be sent as strings in form data
  • Boolean fields (captionsEnabled) must be sent as "true" or "false" strings
  • Jobs are processed asynchronously. Use the returned jobId to check status and retrieve results
  • PDF content is extracted and transformed into social media content using AI