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

Endpoint

POST /api/v1/process-text-async

Authentication

Requires API key in x-api-key header.

Request Body

text
string
required
The text content to transform into social media content
format
string
required
Content format. Options: image, carousel, reel
visualTemplate
string
Visual style template. Options: infographic, screenshot, meme, minimal, magazine, neon, news, auto
platform
string
Target platform. Options: instagram, tiktok, youtube_shorts
slideCount
number
Number of slides for carousel format. Range: 1-5. Only applicable when format is carousel
maxDuration
number
Maximum video duration in seconds. Range: 15-180. Only applicable when format is reel
customPrompt
string
Custom instructions for content generation
captionsEnabled
boolean
Enable captions for video reels. 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-text-async \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "5 essential tips for remote work success",
    "format": "carousel",
    "slideCount": 5,
    "visualTemplate": "minimal",
    "platform": "instagram"
  }'

Example Response

{
  "success": true,
  "message": "Text 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

  • Jobs are processed asynchronously. Use the returned jobId to check status and retrieve results
  • Processing time varies by format: images (~30s), carousels (~1-2min), reels (~2-5min)
  • The visualTemplate parameter is optional. If set to auto or omitted, the system will choose the best template