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/jsonembed-api-key: your-api-key-here(required)
Request Body
| Field | Type | Required | Description | Allowed Values |
|---|---|---|---|---|
postType | string | Yes | Type of post to generate | "CAROUSEL" |
requestorId | string | No | Custom identifier for tracking | Any string |
templateId | string | Yes | ID of the template to use | Valid template ID |
brandId | string | Yes | ID of the brand configuration | Valid brand ID |
presetId | string | Yes | ID of the AI configuration preset | Valid preset ID |
responseType | string | No | Output format (default: “PDF”) | "PDF", "PNG" |
aiGeneration | object | Yes | AI generation configuration | See below |
AI Generation Object
| Field | Type | Required | Description | Allowed Values |
|---|---|---|---|---|
type | string | Yes | Type of AI generation | "text", "article", "x" |
context | string | Yes | Context/prompt for AI generation | Any string |
instructions | string | No | Additional instructions for AI | Any string |
How type and context work together:
"text"—contextis a plain-text topic or prompt describing what to create (e.g."Create a carousel about digital marketing tips")"article"—contextis the URL of an article to turn into a carousel"x"—contextis 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
embedPostIdwhile the carousel is generated in the background. Poll Check Post Status with theembedPostIduntil the status isCOMPLETED, then call Get Post Output to retrieve the final files.
Last updated on