Skip to main content
POST
/
api
/
businesses
/
{business_id}
/
posts
/
generate
Generate posts
curl --request POST \
  --url https://api.mymarky.ai/api/businesses/{business_id}/posts/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>",
  "website_url": "<string>",
  "custom_idea": "<string>",
  "count": 1,
  "creative_formats": [],
  "ai_image_style": "<string>",
  "template_ids": [
    "<string>"
  ],
  "voice": "<string>",
  "include_stock": true,
  "aspect_ratio": "<string>"
}
'
import requests

url = "https://api.mymarky.ai/api/businesses/{business_id}/posts/generate"

payload = {
    "content": "<string>",
    "website_url": "<string>",
    "custom_idea": "<string>",
    "count": 1,
    "creative_formats": [],
    "ai_image_style": "<string>",
    "template_ids": ["<string>"],
    "voice": "<string>",
    "include_stock": True,
    "aspect_ratio": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    content: '<string>',
    website_url: '<string>',
    custom_idea: '<string>',
    count: 1,
    creative_formats: [],
    ai_image_style: '<string>',
    template_ids: ['<string>'],
    voice: '<string>',
    include_stock: true,
    aspect_ratio: '<string>'
  })
};

fetch('https://api.mymarky.ai/api/businesses/{business_id}/posts/generate', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.mymarky.ai/api/businesses/{business_id}/posts/generate",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'content' => '<string>',
    'website_url' => '<string>',
    'custom_idea' => '<string>',
    'count' => 1,
    'creative_formats' => [
        
    ],
    'ai_image_style' => '<string>',
    'template_ids' => [
        '<string>'
    ],
    'voice' => '<string>',
    'include_stock' => true,
    'aspect_ratio' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mymarky.ai/api/businesses/{business_id}/posts/generate"

	payload := strings.NewReader("{\n  \"content\": \"<string>\",\n  \"website_url\": \"<string>\",\n  \"custom_idea\": \"<string>\",\n  \"count\": 1,\n  \"creative_formats\": [],\n  \"ai_image_style\": \"<string>\",\n  \"template_ids\": [\n    \"<string>\"\n  ],\n  \"voice\": \"<string>\",\n  \"include_stock\": true,\n  \"aspect_ratio\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.mymarky.ai/api/businesses/{business_id}/posts/generate")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"content\": \"<string>\",\n  \"website_url\": \"<string>\",\n  \"custom_idea\": \"<string>\",\n  \"count\": 1,\n  \"creative_formats\": [],\n  \"ai_image_style\": \"<string>\",\n  \"template_ids\": [\n    \"<string>\"\n  ],\n  \"voice\": \"<string>\",\n  \"include_stock\": true,\n  \"aspect_ratio\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.mymarky.ai/api/businesses/{business_id}/posts/generate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"content\": \"<string>\",\n  \"website_url\": \"<string>\",\n  \"custom_idea\": \"<string>\",\n  \"count\": 1,\n  \"creative_formats\": [],\n  \"ai_image_style\": \"<string>\",\n  \"template_ids\": [\n    \"<string>\"\n  ],\n  \"voice\": \"<string>\",\n  \"include_stock\": true,\n  \"aspect_ratio\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "job_id": "<string>",
  "data": [
    {
      "post_id": "<string>",
      "caption": "<string>",
      "idea": "<string>",
      "text_content": {},
      "slides": [
        {
          "image_url": "<string>",
          "image_keyword": "<string>"
        }
      ],
      "topic_title": "<string>",
      "category_name": "<string>",
      "template_id": "<string>",
      "theme_name": "<string>",
      "title": "",
      "creative_format": "design",
      "rendered_urls": [
        "<string>"
      ],
      "score": {}
    }
  ],
  "error": "<string>"
}
{
  "error": {
    "type": "<string>",
    "message": "<string>",
    "doc_url": "<string>",
    "param": "<string>",
    "request_id": "<string>"
  }
}
{
  "error": {
    "type": "<string>",
    "message": "<string>",
    "doc_url": "<string>",
    "param": "<string>",
    "request_id": "<string>"
  }
}
{
  "error": {
    "type": "<string>",
    "message": "<string>",
    "doc_url": "<string>",
    "param": "<string>",
    "request_id": "<string>"
  }
}
{
  "error": {
    "type": "<string>",
    "message": "<string>",
    "doc_url": "<string>",
    "param": "<string>",
    "request_id": "<string>"
  }
}
{
  "error": {
    "type": "<string>",
    "message": "<string>",
    "doc_url": "<string>",
    "param": "<string>",
    "request_id": "<string>"
  }
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}
{
  "error": {
    "type": "<string>",
    "message": "<string>",
    "doc_url": "<string>",
    "param": "<string>",
    "request_id": "<string>"
  }
}
{
  "error": {
    "type": "<string>",
    "message": "<string>",
    "doc_url": "<string>",
    "param": "<string>",
    "request_id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

business_id
string
required

A UUID identifier.

Body

application/json
content
string | null

Plain text content to generate posts from (used as the post topic).

website_url
string | null

URL to scrape for content context. The page text is used as input for generation.

custom_idea
string | null

Skip ideation and use this text directly as the post idea for all generated posts.

count
integer
default:1

Number of posts to generate (1-10).

Required range: 1 <= x <= 10
creative_formats
enum<string>[] | null

Which post formats to generate (round-robins across the list). One or more of: design, carousel, meme, image, gif, video, ai-image, ai-video. Omit to use the business's default mix.

Available options:
design,
carousel,
meme,
image,
gif,
video,
ai-image,
ai-video
ai_image_type
enum<string> | null

Sub-type for AI-image generation (only used when a creative_format is 'ai-image'): design, photo, infographic, or meme.

Available options:
design,
photo,
infographic,
meme
ai_image_style
string | null

Visual style modifier for AI images (e.g. 'corporate-flat', 'isometric', 'comic'). Only used for 'ai-image'.

template_ids
string[] | null

Restrict design generation to these specific template IDs instead of auto-selecting.

voice
string | null

Override the brand voice/tone for this generation only (the business's saved Profile is used when omitted).

include_stock
boolean | null

Whether stock photos (Unsplash/Pexels) may be used. Omit to use the business's saved preference.

aspect_ratio
string | null

Aspect ratio for generated media, e.g. '1:1' (square), '9:16' (story/reel), '4:5' (portrait). Omit for the business default.

Response

Generation job created

job_id
string
required

ID to poll for status

status
enum<string>
required

Current job status

Available options:
pending,
completed,
failed
data
PostResult · object[] | null

Generated posts (when status=completed)

error
string | null

Error message (when status=failed)