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 to process (max 10MB, must be application/pdf)
Content format. Options: image, carousel, reel
Visual style template. Options: infographic, screenshot, meme, minimal, magazine, neon, news
Target platform. Options: instagram, tiktok, youtube_shorts
Number of slides for carousel format (as string). Range: “1”-“5”. Only applicable when format is carousel
Maximum video duration in seconds (as string). Range: “15”-“180”. Only applicable when format is reel
Custom instructions for content generation
Enable captions for video reels. Use "true" or "false". Only applicable when format is reel
Caption style. Options: modern, minimal. Requires captionsEnabled: "true"
Caption position. Options: bottom, center. Requires captionsEnabled: "true"
Caption font size. Options: small, medium, large. Requires captionsEnabled: "true"
Additional style variant for customization
Response
Indicates if the request was successful
Human-readable status message
Unique identifier for the content generation job
Initial job status (always “pending”)
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