Skip to main content

Generate Product Marketing Post (v1)

Method & Path

POST /api/v1/workspace/:workspaceId/storefront/products/:productId/generate-post

Description

Generates marketing post text (and optional AI image) for a storefront product, stores the result, and creates storefront marketing-post entries linked to the product.

Authentication

Required: Workspace staff auth with permission store.products.manage.

Persona access: Workspace Owner, Staff (role-based).

Headers

NameValueRequired
AuthorizationBearer WORKSPACE_TOKENYes
Content-Typeapplication/jsonYes

Path Parameters

NameTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
productIdstringYesStorefront product identifier

Query Parameters

NameTypeRequiredDescription
generateImagesbooleanNoGenerate a marketing image (default: false)
postsCountnumberNoNumber of posts (1-3, default: 3)
useProductImagesbooleanNoAnalyze product images with Vision API
imagePromptstringNoAdvanced image prompt (overrides structured inputs)
adTypestringNoAd type
tonestringNoWriting tone
focusPointsstringNoKey selling points
targetAudiencestringNoTarget audience
imageTypestringNopost or story
artStylestringNohero, negative_space, depth, lifestyle
moodstringNoluxury, soft_feminine, modern, medical_clean
backgroundstringNogradient, surface_backdrop, pastel, auto
productCompositionstringNosingle_hero, grouped, side_layout
visualBoldnessstringNolow, medium, high

Request Body

No body required.

Response 200 OK

{
"jobId": "65f50e1b6c6b9e2f1c0e61aa",
"status": "queued"
}

Notes

  • Progress and completion are streamed via Socket.IO events: post-generation:progress and post-generation:completed.
  • Completion payload includes the generated posts, overlays, and storefrontPostIds.

Common Errors

  • 400 Bad Request: Invalid inputs (postsCount, price, currency, imageUrl)
  • 401 Unauthorized: Missing/invalid auth token
  • 403 Forbidden: Missing store.products.manage permission
  • 404 Not Found: Workspace or product not found
  • 422 Unprocessable Entity: Validation errors
  • 500 Internal Server Error: Unexpected generation error