Initiate AI Generation

POST /post/initiate/generate

Generates a carousel post using AI with predefined content generation presets.

Headers

  • Content-Type: application/json
  • embed-api-key: your-api-key-here (required)

Request Body

FieldTypeRequiredDescriptionAllowed Values
postTypestringYesType of post to generate"CAROUSEL"
requestorIdstringNoCustom identifier for trackingAny string
templateIdstringYesID of the template to useValid template ID
brandIdstringYesID of the brand configurationValid brand ID
presetIdstringYesID of the AI configuration presetValid preset ID
responseTypestringNoOutput format (default: “PDF”)"PDF", "PNG"
aiGenerationobjectYesAI generation configurationSee below

AI Generation Object

FieldTypeRequiredDescriptionAllowed Values
typestringYesType of AI generation"text", "article", "x"
contextstringYesContext/prompt for AI generationAny string
instructionsstringNoAdditional instructions for AIAny string

Example Request

curl --location 'https://embed-api.postnitro.ai/post/initiate/generate' \
--header 'Content-Type: application/json' \
--header 'embed-api-key: pn-plnnepb6v9omx2ik88v793ak' \
--data '{
    "postType": "CAROUSEL",
    "requestorId": "user123",
    "templateId": "xtrnxgfgk9a08tmsz2601k1c",
    "brandId": "cmdhb8oe10006v0pmh6a4no6t",
    "presetId": "preset123",
    "responseType": "PNG",
    "aiGeneration": {
        "type": "article",
        "context": "Create a carousel about digital marketing tips",
        "instructions": "Focus on actionable tips for small businesses"
    }
}'

Response

{
    "success": true,
    "message": "CAROUSEL generation initiated",
    "data": {
        "embedPostId": "post123",
        "status": "PENDING"
    }
}