Generate channel content with AI
const url = 'https://api.crossmart.io/api/v1/workspaces/example/ai/content-generations';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"connectionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","productIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.crossmart.io/api/v1/workspaces/example/ai/content-generations \ --header 'Content-Type: application/json' \ --data '{ "connectionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "productIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'Queues the Content Generator for each product: it writes a title and description fitted to the store’s channel. The results arrive as pending suggestions to review; nothing changes until one is approved. Each product uses one AI credit: answers 402 when the plan’s credits this month do not cover them (while plans are enforced), 429 past the rate limit, and 503 while AI is not configured.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The store to write for
Example generated
{ "connectionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "productIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}Responses
Section titled “Responses”object
Products queued; their suggestions arrive in the inbox
Example generated
{ "queued": 1}The organization’s plan does not allow this (ENTITLEMENTS_ENFORCED is on). code and feature say why; upgrading the plan resolves it.
object
The code of the organization’s plan
Null is unlimited
How many more the request asked for
Example
{ "statusCode": 402, "error": "Payment Required", "code": "plan_limit_reached", "message": "The Free plan includes 2 connected channels, and 2 are in use. Upgrade the plan to add more.", "feature": "active_listings", "plan": "free"}Too many AI requests from you in this workspace. Wait a minute and try again.