# Generate Posts

This endpoint generates **AI-powered social media post content** based on the provided parameters. The AI processes the specified `post_type` and `input` to create engaging and relevant content.

***

### Endpoint

**Method:** `POST`\
**URL:**

```
https://app.marketingblocks.ai/api/v1/social-sparks/create-post-generation
```

***

### Authorization

All requests must include a **Bearer Token** with the `social-post-generation` permission:

```http
Authorization: Bearer <token>
```

***

### Request Body

The request body must be in **JSON** format and include the following parameters:

| Field       | Type   | Required | Description                                                                   |
| ----------- | ------ | -------- | ----------------------------------------------------------------------------- |
| `post_type` | string | Yes      | The type of post to generate. Determines the style and format of the content. |
| `input`     | string | Yes      | The main theme, topic, or subject matter for the post.                        |
| `web_hook`  | string | No       | Optional webhook URL for receiving async results.                             |

***

#### Supported `post_type` values

* **text\_only** – A simple text-based post (e.g., updates, announcements).
* **ai\_image\_post** – A post that includes AI-generated images.
* **ai\_banner\_post** – A banner-style graphic post, ideal for promotions or ads.
* **breel** – A dynamic video + text format, good for showcasing products.
* **talking\_reel** – A video featuring a speaker discussing a topic.
* **faceless\_reel** – A video with visuals + voiceover, without showing a person.

***

### Example Request

#### curl

```bash
curl --location 'https://app.marketingblocks.ai/api/v1/social-sparks/create-post-generation' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "post_type":"breel", 
    "input": "flower sales"
    // "web_hook": "https://web-hook-url" // optional
}'
```

***

### Example Response

**200 OK**

```json
{
  "id": "842c8151-8f9d-4eab-ae81-6690730b8b02",
  "status": "queued",
  "message": "post generation is in queued.",
  "request_body": {
    "post_type": "breel",
    "input": "flower sales",
    "brand_id": null,
    "web_hook": null
  }
}
```

***

### Response Structure

| Field          | Type   | Description                                            |
| -------------- | ------ | ------------------------------------------------------ |
| `id`           | string | Unique identifier for the generated post.              |
| `status`       | string | Status of the request (`queued`, `success`, `failed`). |
| `message`      | string | Message with details about the outcome.                |
| `request_body` | object | Echoes back the original request parameters.           |
| `brand_id`     | string | (Optional) Brand identifier if provided.               |
| `web_hook`     | string | (Optional) Webhook URL if provided.                    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.marketingblocks.ai/agentic-ai-docs/api-reference/social-growth-engine/content-creation/generate-posts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
