Generate a post image

Changed on

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Generates the image for a single post and saves it on the plan.

For a generated calendar post, pass its source_post_id as post_id and its id as scheduled_post_id. The image is saved directly on that calendar row, including replenished posts absent from the plan. The returned plan remains the original plan; reload List scheduled posts for the updated row. A 404 (social_calendar_post_not_found) means the row does not match the app and source post. A 409 (social_calendar_post_not_editable or social_calendar_post_changed) means the row cannot be edited or changed during generation; reload it before retrying.

The post's own image_prompt wins over the image_prompt you send, so the request body only decides the prompt for a post that has none. To change an image that already exists, send refinement_instruction.

<Note>If the post already has an image_url and you send no refinement_instruction, the existing image is returned as-is. Nothing is generated and no credits are charged.</Note>

Generating an image costs 1 credit and fails with a 402 when the workspace is out of quota. Image generation is budgeted at up to 60 seconds per attempt, so use a client timeout above that.

This endpoint is limited to 12 requests per minute, separately from the other social content endpoints.

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403. New social content generation and edits also return 403 with code app_marketing_not_allowed when the app's owning workspace has the FERPA designation. Historical reads and resetting the plan remain available.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time. Send only the fields documented here. Other request fields are not supported and their behavior can change.</Warning>

post/api/apps/{app_id}/virality/posts/{post_id}/generate-image

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/virality/posts/{post_id}/generate-image
  • Auth: HTTP bearer

Path parameters

post_idstring required

ID of the post, as returned in the content plan. Must be a UUID.

app_idstring required

ID of the app.

Request body

scheduled_post_idstring nullable

Optional calendar post ID from List scheduled posts. Its source_post_id must match the post_id in the URL. Updates the calendar row rather than the original plan; requires Social Calendar V2. Only proposal and scheduled posts can be edited.

image_promptstring required

Prompt to generate the image from. Used only when the post carries no image_prompt of its own, which is the prompt the plan generated for it. Send the post's own image_prompt back if you want to be sure of what is used.

refinement_instructionstring nullable

What to change about the existing image. Sending this regenerates the image even when the post already has one. The first 300 characters are used.

Example request

{
  "scheduled_post_id": "6820f3a4e7b91d003c45a1f2",
  "image_prompt": "A freelancer closing a laptop at a tidy desk, warm morning light",
  "refinement_instruction": "Make the lighting cooler and remove the coffee cup."
}

Response

Successful Response

image_urlstring nullable

URL of the post image.

Example response

{
  "image_url": "https://storage.base44.com/virality/3f2504e0.png",
  "plan": {
    "id": "8c1f9a2e-3b7d-4c5e-9f01-2a3b4c5d6e7f",
    "app_id": "6820f3a4e7b91d003c45a1f2",
    "strategy": {
      "app_summary": "A CRM for freelancers who want to track leads without a spreadsheet.",
      "marketing_approach": "Lead with the spreadsheet pain, then show the app solving it.",
      "platforms": [
        {
          "reasoning": "Instagram rewards a consistent series, so these build on each other.",
          "posts": [
            {
              "id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
              "angle_label": "Pain point",
              "post_number": 1,
              "total_posts": 5,
              "suggested_day": 1,
              "rationale": "Opens on the spreadsheet frustration the audience already has.",
              "content": "Still tracking leads in a spreadsheet? I built the thing I wanted instead.",
              "image_url": "https://storage.base44.com/virality/3f2504e0.png",
              "image_prompt": "A freelancer closing a laptop at a tidy desk, warm morning light",
              "hashtags": [
                "freelance",
                "buildinpublic"
              ],
              "post_title": "I built a CRM because spreadsheets kept losing my leads",
              "suggested_subreddits": [
                "r/freelance",
                "r/SideProject"
              ],
              "launch_comment": "Happy to answer questions about how it works.",
              "option_label": "Direct and personal",
              "best_for_context": "Best if your audience already knows you"
            }
          ]
        }
      ]
    },
    "created_at": "2026-08-24T09:15:00+00:00",
    "updated_at": "2026-08-24T10:02:00+00:00"
  }
}

Changes