Skip to Content

Initiate AI Generation

POST https://embed-api.postnitro.ai/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

How type and context work together:

  • "text"context is a plain-text topic or prompt describing what to create (e.g. "Create a carousel about digital marketing tips")
  • "article"context is the URL of an article to turn into a carousel
  • "x"context is the URL of an X (Twitter) post to turn into a carousel

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": "text", "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" } }

Generation is asynchronous. This endpoint returns immediately with an embedPostId while the carousel is generated in the background. Poll Check Post Status with the embedPostId until the status is COMPLETED, then call Get Post Output to retrieve the final files.

Last updated on