# AdBrain API - guide for agents Base URL: https://adbrainai.com/api/v1 OpenAPI 3.1 spec: https://adbrainai.com/api/v1/openapi.json MCP endpoint: https://adbrainai.com/mcp Auth: Authorization: Bearer (the user creates keys in AdBrain: Settings > API keys) ## How it works Every capability is a SKILL. Call POST /skills/{name}/invoke with a JSON body matching the skill's input schema. GET /skills lists them with schemas. Long-running skills (video.edit, video.revise, static.generate, script.write, agent tasks) return a job handle immediately ({job_id|batch_id|task_id}); poll GET /jobs/{id} until status is done or failed. A result with status 'needs_input' is a question for a human - relay it and call again with the answer. Read/edit ANY record with record.get / record.update (entity_type + id + fields) - scripts, brands, products, raw assets, video cuts, folders. Ids: brand_id and product_id are strings; script_id, edit_id, asset_id are integers. List skills return them. Usage is metered in credits like the app; a 402 means the account needs credits. ## Webhooks (signed) POST /webhooks {url, events?} subscribes; the response includes the signing secret ONCE. Deliveries: JSON {event, ts, data}; headers X-AdBrain-Event and X-AdBrain-Signature = HMAC-SHA256 hex of the raw body with the secret. Events: script.status_changed, video_edit.completed, video_edit.failed, video_edit.cancelled, video_edit.review_status_changed ## Common flows - Kick off edits: video.edit {script_id, variants, aspect_ratio} (16:9 for CTV/YouTube, 9:16 for Reels/TikTok) -> poll job -> video_edit.completed webhook carries video_url + review_url. - Revise a cut: video.revise {edit_id, instructions, music_asset_id?} -> poll job. - Approve work: record.update entity_type='video_edit' fields={review_status:'approved'}; scripts: record.update entity_type='script' fields={status:'Approved'}. - Review policy (what a human approves before a cut posts): brand default via record.update entity_type='brand' fields={review_policy:'auto'|'cut'|'script'}; per cut via video.edit {review_policy} or record.update entity_type='video_edit' fields={review_policy} ('default' = follow the brand). A 'script' cut waits in status 'held' until its script is Approved. - Hand over a whole goal: POST /agent/tasks {goal, inputs} -> poll GET /agent/tasks/{task_id}. ## Skills - script.write: Write ad scripts for a brand's product, optionally following a reference example (a Foreplay ad, a swipe-file example, or a pasted TikTok / Instagram / YouTube / Facebook link). Produces ranked hooks and fully filled-out - brand.list: List the brands the user has in AdBrain, each with its products and ids. Personal/creator brands have brand_type 'personal', zero products, and suggested_product_id '__brand__' for script.write / static.generate. Each br - brand.get: Get full details for a single brand by its brand_id: brand info and voice, the full product list with their ids, and the brand's saved LANDING PAGES (id, name, headline, offer, url - pass a landing_page_id to script.writ - brand.create: Create a new brand manually with fields you already have — NO file analysis. Do NOT use this when the user attached upload files; use brand.bootstrap_from_materials instead. Use only for a bare manual shell (name + paste - brand.bootstrap_from_materials: Set up a NEW brand from uploaded chat files (brand guidelines, PDFs, images, docs). ALWAYS use this instead of brand.create when the user attached ANY files to create a brand, when website import failed, or when there ar - brand.analyze_material: Analyze ONE file (brand guideline image, PDF, Word doc) and extract structured brand fields, colors, typography, and asset metadata. Works on EITHER a fresh chat attachment (chat_attachment_id - a file just dropped into - brand.update: Update an existing brand by MERGING new values in: basic/detailed info, rules, founder story, website, brand colors, typography, market awareness/saturation, content focus (ads/organic/both), and add_products for new pro - brand.set_colors: Set or fix a brand's color palette RELIABLY. Use this whenever the user wants the brand colors corrected or replaced - e.g. 'the brand colors are wrong, here are the right ones', a pasted list of hex codes, a brand-kit s - brand.create_from_website: Onboard a brand into AdBrain from its website URL. Scrapes the site, extracts the brand info and up to 10 products with AI, and saves it as a new brand owned by the user. Use this when the user wants to make ads but has - brand.refresh_from_website: Re-scrape an EXISTING brand's live website to pull FRESH product images and info onto the brand you already have. Adds products it's missing, refreshes info on existing products, and ingests new reference images, logo, a - product.add_from_url: Add a single product to an EXISTING brand by scraping its product page URL. Use this whenever the brand already exists and the user shares a product/PDP link or asks to add a product - do NOT onboard a new brand for this - raw.save: Save material as a reusable, named BRAND RAW ASSET (the brand's own working material) from ANY of three sources: (1) chat_attachment_id - a file the user dropped into chat (image, VIDEO clip, AUDIO recording, or document - product.create: Create ONE new product on an EXISTING brand from facts you already have - the path for a pre-launch product with no product page yet, or any product whose details you gathered yourself (from packaging photos, a brief, a - product.delete: Delete a product from one of the user's brands (soft delete - it moves to trash and can be restored). Use this to remove a DUPLICATE product entry or a junk/accidental product so the catalog is clean. Pass the product_id - product.update: Update individual fields on ONE existing product (a MERGE - omitted/empty fields keep their current value, so it never wipes the product). Use to correct a single product: fix its name, rewrite its Basic vs Detailed info - script.list: List the user's recent scripts (newest first) with their titles, ad type, brand, and the swipe-file example each one followed (followed_example_id - its creative lineage). Use this to recall what's already been written o - script.get: Read ONE script in full: all three hooks with their on-screen captions, the shared body, the complete strategy read (awareness, funnel, target demo/age/gender, emotions, the attached customer persona resolved to its name - script.feedback: Read the reviewer feedback (comments) left on a script via its review link - who wrote each comment, which field it's anchored to (a hook, the body, the idea summary), the exact text they highlighted, and whether it's be - script.enhance: Make a TARGETED revision to ONE field of an existing script - a hook slot (hook_1 .. hook_10; scripts have 3 unless hooks were added with script.add_hook) or body (the shared script body). This is the same versioned Enha - script.add_hook: Add ONE new hook (= one more VERSION) to an existing script, in its next empty slot (max 10 hooks per script). Use this when the user wants more versions of a script than it has hooks: '7 versions' of a 3-hook script = c - script.update: Edit a script's title and metadata/strategy fields directly - the same fields the user can edit on the script page. Use it to RENAME a script when its content has meaningfully changed (e.g. revisions replaced the hook th - swipe.list: List the ads saved in the user's Swipe File (examples worth emulating), with titles, format, source, brand, and each video's detected TYPES (video_styles - e.g. 'Trending Sound', 'Voice Over', 'Founder-Led', 'Talking Hea - swipe.get: Get one Swipe File example by id, including its analysis. After swipe.add_from_url or swipe.analyze returns 'analysis_in_progress', call this ONCE with the example_id: it waits for the analysis to finish (up to a couple - swipe.frames: LOOK at the actual screenshots a video swipe example was analyzed from. Returns the timestamped frames as IMAGES you can see (plus their fetchable URLs), straight from storage - no re-download, no re-processing. Use it w - swipe.add_from_url: Save ads from social links (TikTok, Instagram, YouTube, Facebook, or X/Twitter) into the user's Swipe File and analyze them - transcript, visual breakdown, hooks, and a replication guide. Use this when the user shares ad - swipe.add_from_ad: Import the ACTUAL creative file behind one of the brand's own ads into the Swipe File - works for ads from the brand's Meta connection AND ads tracked by Triple Whale (TW mirrors the media in its own bucket). This is THE - swipe.analyze: Analyze a Swipe File example by its id (use swipe.list to find ids) and return its structured breakdown - transcript, visual analysis, hooks, and replication guide. If it was already analyzed, returns the saved analysis - swipe.update: Rename a swipe-file example (set its title) and optionally update its description/notes. Use this to PRESERVE the user's own project names and identifiers: when a file they uploaded or a project they referenced carries a - inspiration.find: Find fresh ad INSPIRATION (real ads + emulatable organic formats) for a brand. Use this when the user asks to 'find ideas', 'find inspiration', 'what should we make', 'find examples to copy/emulate' and does NOT give a s - inspiration.follow: Manage the account's FOLLOWED inspiration sources - the creators and advertisers AdBrain 'stalks' on every inspiration pull. action='list' shows everything currently followed (organic creator feeds + Meta Ad Library adve - reaction.find: Find viral videos a creator can REACT to (reaction-video source material). Use this when the user asks for 'videos to react to', 'reaction content', 'find clips for my creator to respond to', or wants to make reaction/gr - raw.list: List the raw assets in the user's library (uploaded images, video clips, audio and documents), with names, type and size. Use this to see what source material is already on hand. THE ADBRAIN LIBRARY (global, built into e - raw.upload: Get a FILE from outside AdBrain into a brand's Raw Assets - footage, photos, audio, documents - when the user says 'upload this to AdBrain', 'get these off my drive into AdBrain', 'add this folder of clips'. Three action - persona.list: List the customer personas visible to the user — their own/org personas PLUS admin-curated GLOBAL personas (is_global=true, usable by every account). Optionally filtered to one brand (also returns non-brand-specific pers - persona.create: Create a reusable customer persona for the user (optionally tied to one or more brands via brand_ids). Use this when the user describes who their customer is, shares persona/audience research, or asks you to define a tar - persona.update: Update ONE existing customer persona by MERGING new values in (omitted fields keep their current value): name, age_range, gender, short_description, key_motivations, and brand_ids (the full replacement list of brand ids - creator.list: List the account's CREATOR profiles - the real people (founder, recurring creators) and AI characters AdBrain makes things featuring. Each row: id, name, kind ('person' | 'ai'), brand_ids (empty = every brand), profile_p - creator.get: Open ONE creator profile in full: name, kind, description, brand_ids, consent, reference_images (asset ids, which is the profile picture, whether its face is enrolled), voice_samples, the cloned voice (has_voice, voice_s - creator.create: Create a CREATOR profile: someone AdBrain will make things featuring. kind 'person' = a real person (founder, recurring creator), 'ai' = an AI character. brand_ids ties the profile to those brands (omit = usable with eve - creator.update: Change anything on a CREATOR profile, any mix in one call (only what you pass changes): name, kind, description, brand_ids (the FULL list; [] = every brand), profile_picture_asset_id (one of their reference photos), add_ - creator.find: SEARCH EXISTING RAW ASSETS FOR CREATORS and tag every image and video they appear in - 'identify all the creators in my footage', 'find Dylan in the Betterbrand library', 'who is in this folder'. It compares faces agains - creator.find_status: Progress of the library search started by creator.find - or stop it. Returns each creator with a search on record: status (running | done | stopped | failed), files done / total, matched (files that creator was found in) - static.generate: Generate static ad image(s) for one of the user's brands + products from an idea or angle. This is AdBrain's strongest creative tool. You need a brand_id and product_id (from brand.list; personal brands use suggested_pro - video.edit: CUT a finished video ad (mp4) for a script from the brand's OWN uploaded footage - AdBrain's editor picks the shots, cuts to the script's hook/body/CTA, times on-screen captions, records the voiceover (when configured), - video.revise: Make a REVISED version of a finished video cut from feedback. Pulls the cut's unresolved review comments (timecoded, with the reviewer's drawings on the frames) and any `instructions` you pass, hands them to the editor w - video.list: List the video cuts AdBrain has edited (newest first): id, title, status/progress, review status (draft / in_review / changes_requested / approved), script, brand/product, duration, review-link state and whether it has u - static.list: List the user's recent static-ad / carousel batches (newest first) and the ads/slides inside each one. Each ad is returned with its 1-based ORDINAL (position in the batch tray, the order the user sees), its ad_id, headli - static.revise: Revise static ad(s) or carousel slide(s) the user ALREADY generated - editing the EXISTING ad in place (a new version inside the SAME tray), NOT making a new batch. Use this whenever the user asks to fix/change/tweak ads - static.feedback: Read the reviewer feedback (comments) left on a batch of static ads / carousel slides via its review link - who wrote each comment, which ad it's pinned to (ordinal + headline included so you can map it precisely), wheth - image.generate: Generate a brand-new image from a text description using GPT Image 2.5. This is for PLAIN image creation - NOT an advertisement (no headline, CTA, or marketing layout, no text added unless the prompt explicitly asks). Us - image.edit: Edit or transform an EXISTING image with GPT Image 2.5 from a plain-language instruction (e.g. 'make the teeth clean and white', 'remove the background', 'put the product on a marble counter'). This is NOT for making ads - artifact.create: Save a piece of content you've produced as a viewable artifact that opens in the side panel (and can be shared with a public link). Use this to DELIVER research, reports, lists of studies, competitor breakdowns, comparis - artifact.get: Read one of the user's saved artifacts by id - a markdown document or HTML report previously produced with artifact.create (research findings, competitor breakdowns, summaries). Returns the title and full content. Use it - artifact.update: Revise an existing artifact (markdown document or HTML page) IN PLACE - new content and/or a new title on the SAME artifact id. Use this whenever the user wants a document or page you already delivered changed in ANY way - artifact.search: Search the user's saved knowledge base - every research document and report previously produced (markdown/html artifacts: ingredient research, competitor breakdowns, audience studies, claims with citations). ALWAYS try t - artifact.share: Publish a public, login-free share link for a deliverable, by its id. Returns a shareable URL. Works for ANY shareable type - pass type to say what the id refers to: 'artifact' (documents/HTML reports/inspiration pulls - - capabilities: List everything AdBrain can do right now - the full catalog of skills (name, what each does, and its inputs). Use this when you're unsure whether AdBrain can do something, when planning a complex multi-step job, or when - collection.list: List the user's folders (shareable collections of saved work) with their names, item counts, and the brands referenced inside. Use it to find a folder the user mentions by name; then collection.get to see what's inside. - collection.get: Open one of the user's folders by id and list EVERYTHING inside - swipe examples, scripts, documents, raw assets, static-ad batches, individually picked static ads and video cuts, each with its id and title. Use it whene - memory.search: Search EVERYTHING this account knows in one call: swipe-file analyses, script hooks and bodies, brand records/products/rules, raw-asset labels and transcripts, personas, landing pages, saved research documents, and remem - memory.recall: CROSS-CHAT RECAP (not for the current conversation - that is already in front of you): what this account has been doing recently in OTHER chats: recent chats (titles + summaries), recently created artifacts, swipe-file s - memory.save: LONG-TERM MEMORY - save one durable nugget at the organization level so it survives across conversations and every user in the org. HIGH BAR: only save if you'd genuinely need to recall it in a SEPARATE future session to - idea.save: Remember a rough ad idea, or a whole batch of them, for later (saved to the user's Rough Ideas). Use this when the user pastes/dumps a bunch of ideas, notes, and reference links together (a Notion doc, a list of 'things - idea.list: List the rough ideas the user saved to work on later (from idea.save / Rough Ideas). Use this when the user wants to act on remembered ideas - 'write scripts from my saved ideas', 'what ideas do I have for [brand]?', 'wo - orchestrate: Hand off a BIG, multi-part or multi-brand job to AdBrain's orchestrator instead of doing it yourself in one turn. Use this when the request clearly needs many separate pieces of work - e.g. 'make a content plan for each - goal.update: Manage this chat's SESSION GOAL (the standing objective the user set with /goal, shown to you as [SESSION GOAL]). action='done' marks it met - call this ONLY when every part of the goal is actually delivered (the deliver - upload.appraise: Cheaply LOOK at a chat upload before deciding what it is. Samples a few frames (video) or the image itself and guesses: is this a produced AD EXAMPLE to copy, or the user's own RAW MATERIAL (b-roll, interviews, product s - user.ask: PAUSE this job and ask the user ONE question in the chat, then wait for their answer. Use it whenever the user's call genuinely changes what you'd build: (1) a blocker only they can resolve (an upload that could be an ex - trash.restore: Bring deleted OR disappeared things BACK. Use whenever the user asks to restore, recover, undelete, or 'bring back' something they removed - a brand, script, swipe-file example, raw asset, static-ad batch, video cut (ite - feedback.submit: Log a feature request or product feedback for the AdBrain team. Use this when the user asks for a capability AdBrain does NOT have yet (e.g. AI voiceover/audio, a fully rendered video, an integration we don't support) af - performance.get: REAL ad performance for a brand (actual spend/impressions/clicks/purchases/revenue/ROAS from the brand's connected sources - the Meta Marketing API connection, Meta Ads Manager CSV imports, and Triple Whale pixel attribu - performance.asset_breakdown: What's INSIDE one ad: the individual creatives Meta rotated inside a Flex / Related Media / Dynamic ad, each with its own numbers (spend, share of the ad's spend, Meta-reported purchases/ROAS, CTR, thumbnails and live Fa - performance.brief: ON-DEMAND ONLY: a written retrospective of the brand's real ad results (this week vs last: what's winning and why, emerging angles/hooks/personas, iterate candidates, fatigue, next directions). It is NOT generated automa - organic.performance_get: REAL ORGANIC results for a brand's OWN connected social accounts (TikTok, Instagram, YouTube, Facebook, X, LinkedIn, Threads, Pinterest...) - the organic twin of performance.get. Returns the window's totals vs the previo - organic.brief: ON-DEMAND ONLY: a written retrospective of the brand's REAL organic results on its connected social accounts (this week vs last: which hooks, angles, formats and platforms earned views, saves, shares and follows; which o - performance.winners: The brand's CURRENT WINNERS with the creative elements that made them win - the evidence a creative strategist works from. Paid ads (from the connected ad data: spend, ROAS/nc-ROAS, purchases) and organic posts (from the - record.get: Read the FULL canonical record of ANY content entity by type + id - the universal fallback when no dedicated read skill covers what you need (if the user can see it in the product, you can read it here). entity_type is o - record.update: Edit fields on ANY content entity by type + id - the universal fallback when no dedicated edit skill covers the field (if the user can edit it in the product, you can edit it here). MERGE semantics: only the fields you p - folder.manage: Manage the library's FOLDERS like a file manager - the same powers the user has in Raw Assets and the Script Library. kind='asset' folders hold raw assets (footage, photos, graphics, audio, documents); kind='script' fold - raw.organize: ORGANIZE A BRAND'S RAW ASSETS IN BULK - the ONLY right tool when the user asks to organize / sort / file / clean up their footage, b-roll, uploads or library, or when a brand has more than a handful of unfiled assets. On - web.fetch: Read a PUBLIC web page and return its readable text, title/description, and the images and logos it contains (with URLs). Use it right after web_search to actually read the page you found - a review, a pricing page, a co - web.screenshot: Capture a REAL public web page with a headless browser and save the capture as an image raw asset of a brand (it is indexed like any upload, so statics, scripts and the video editor can use it). viewport: 'mobile' (390x8 - web.grab_asset: Download one or more PUBLIC images, logos (png/svg/webp/jpg) or short mp4s from the web and save them as raw assets of a brand - the brand's own logo from their site, product photos from their store, a partner / press lo - social.look: LOOK at a public social post or profile exactly the way a person would - WITHOUT saving anything. Give it a link to a tweet / X post, Instagram post or Reel, TikTok, YouTube video or Short, Facebook video, or LinkedIn po - collection.manage: Create and maintain SHAREABLES - the hand-off folders a user shares with one public link (any mix of swipe examples, scripts, documents, raw assets, static batches, individually picked static ads, video cuts). Actions: ' - record.delete: Move ONE content record to trash (SOFT delete - recoverable with trash.restore). Deletable types: artifact, brand, collection, creator, inspiration_result, landing_page, org_memory, persona, posting_destination, product, - x.post: ADMIN ONLY. Publish a post to Cortex's own X (Twitter) account. Two modes: pass `text` to post exactly that (you write it in your X voice - short, native, no hashtags, no links, under 280 chars), or pass `swipe_example_i - x.reply: ADMIN ONLY. Reply to a specific tweet from Cortex's X account. Pass the `tweet_id` (from x.mentions, or extracted from a pasted x.com/twitter.com status link) and the reply `text` in your X voice - remember that on X, on - x.mentions: ADMIN ONLY. Read recent @-mentions of Cortex's X account (who said what, with tweet ids you can hand to x.reply), plus her own recent posts/replies from the receipts log. Read-only - does NOT advance the autopilot's ment - x.timeline: What Cortex has publicly posted on her own X (Twitter) account @-handle recently - her daily ad teardowns (each tied to a global swipe-file example), replies, and thread engagements. Available to EVERYONE (it's all publi - post.destinations: The social accounts a brand can post to (its posting destinations): id, platform (tiktok / instagram / youtube / facebook / threads / twitter / linkedin / pinterest), @handle, connected state, and whether auto-post is on - post.publish: Publish to a brand's connected social accounts - organic posting to TikTok / Instagram / YouTube / Facebook / Threads / X / LinkedIn / Pinterest / Bluesky through the posting provider. THREE KINDS OF POST, and YOU choose - post.list: Social posts AdBrain has made (newest first): platform, status (queued | scheduled | publishing | published | failed | cancelled), the public URL once live, the error when it failed, and what it was (source_type video_ed