Parameters

NameTypeRequiredDescription
brandIdstringYesOcoya brand id from ocoya_list_brands.
promptstringYesCampaign prompt or brief. Minimum 3 characters.
goalstringNoCampaign objective. Defaults to awareness. One of awareness, leads, launch, offer, education, event.
durationnumberNoCampaign duration in days, from 1 to 90. Defaults to 7.
startDatestringNoDay of the first post, YYYY-MM-DD. Must be tomorrow or later. Defaults to tomorrow.
postsPerDaynumberNoHow often to post: 0.5 is every other day, 1-4 is posts per day. Omit to spread count posts evenly over duration. One of 0.5, 1, 2, 3, 4.
countnumberNoNumber of posts to generate, from 1 to 90. Defaults to 7.
postLengthstringNoCaption length for each generated post. Defaults to medium. One of short, medium, long, extra_long.
channelIdsstring[]NoChannel ids from ocoya_list_channels to attach when generated campaign posts are saved.
generateMediabooleanNoWhether to generate images for campaign posts.
imageCountnumberNoNumber of images to generate for each campaign post, from 1 to 10. Values above 1 create carousel-style post creatives. Defaults to 1.
referenceUrlsstring[]NoOptional image URLs to use as visual references when generateMedia is true. Maximum 3.
referenceDesignIdsstring[]NoOptional Studio design ids from ocoya_list_studio_templates to use as visual references when generateMedia is true. Maximum 3.
studioDesignIdstringNoOptional id of the brand’s own Studio design from ocoya_list_studio_designs. Every post’s image is then that design, with its text layers written by the AI from each caption. Every other layer stays as designed unless set in studioDesignFields. imageCount and references are ignored.
studioDesignFieldsobjectNoOptional values for the Studio design’s layers, keyed by field id from ocoya_get_studio_design: an image URL for an image field (a logo, a product photo), a CSS colour for a colour field, or text for a text field, which is then used as given instead of being written by the AI. Only used with studioDesignId.
typestringNoKind of campaign. Defaults to social. seo: count SEO posts (1-20, default 3) for blog channels, each keyword-researched and written in full with SEO fields, spread over duration days (default 5); channelIds must be blog or site channels, postLength sets their length (short 600-900 words to extra_long 2,000-3,000), generateMedia adds an AI thumbnail to each in thumbnailAspectRatio; costs 1 credit for the plan and 2 per post plus images; each saved one works with ocoya_get_seo_post. email: count AI-written emails (1-10, default 3) to the brand’s contacts, sent from startDate at postsPerDay (0.5, 1 or 2 a day, at 10:00 and 16:00 brand time), reviewed with ocoya_get_campaign and sent with ocoya_schedule_email_campaign. For email, channelIds, duration, postLength, imageCount, references and Studio designs are ignored, and generateMedia (default true) draws a picture per email. One of social, seo, email.
thumbnailAspectRatiostringNotype seo only: the shape of each post’s AI thumbnail. Defaults to 16:9. One of 16:9, 1:1, 4:5.
sendTimesstring[]Notype email only: the exact ISO send time of each email, overriding count, startDate and postsPerDay. Up to 10.
audienceobjectNotype email only: Who gets it: every subscribed contact (omit groupIds), or the contacts in any of groupIds. Group ids from ocoya_list_contact_groups.
templateIdstringNotype email only: the template every email is written in, from ocoya_list_email_templates, or auto to pick the best fit. Omit for AI’s own layout.
productIdsstring[]Notype email only: the brand’s product ids the campaign is about.

Request example

{
  "name": "ocoya_create_ai_campaign",
  "arguments": {
    "brandId": "cmayvq3hk00017apshay5qezu",
    "prompt": "Write a launch post for our new analytics dashboard.",
    "channelIds": ["clh49poxf008x8kov4ncbjty9"]
  }
}

Returns

Returns campaignId, status, queued, generation, type and sendTimes. This tool creates content, which can reach your connected networks once it publishes.