API

Create AI-generated Facebook and Instagram posts from your own systems with the Trigger API — one HTTP call from "new blog post" to platform-tuned posts in your review queue.

Overview

The Trigger API turns any URL or raw text into ready-to-publish social posts. AI Social Posting reads the source, writes platform-tuned captions, generates the image, and either parks the post in your review queue (default) or publishes it automatically. Typical use: call it from your CMS whenever you publish a blog post.

Everything the call takes from a brand is configured outside AI Social Posting. Which Facebook and Instagram accounts a post can reach comes from the pages assigned to that brand on Settings → Connections → Meta integration, and the writing voice, image style and default watermark (the brand's logo) come from Brand → Brand settings → Social.

In the dashboard, Marketing → AI Social Posting → API opens with the plain-language part — Create posts from your other apps, How it works and Before you start (links to your API key, your connected pages, your logo and the Review queue) — and puts the technical reference below a For developers divider, with Post angles after it.

Authentication

API Key RequiredInclude the Y-API-Key header in all requests. Create or rotate the key under Settings → Connections → MCP & API keys — the same key works for every Yaplet API.

Endpoint

POST https://yaplet.com/api/social-posting/trigger

Accepts a JSON body and returns 202 Accepted — generation runs asynchronously and typically completes within ~2 minutes.

Request Fields

Required (one of)

FieldTypeDescription
urlstringPage to post about. Read server-side.
contentstringRaw text to post about (max 40,000 characters).

Optional

FieldTypeDefaultDescription
brand_idstringYour only brandWhich brand the post belongs to, which decides the pages it goes to — the ordinary Yaplet brand from the sidebar's brand card. Leave it out if you have only one brand, or if only one of your brands has connected pages; with several brands you must send it.
platformsstring[]Every platform the brand has connected"FACEBOOK", "INSTAGRAM".
page_idsstring[]All the brand's pagesPost to a subset of the brand's pages — the Facebook and Instagram accounts assigned to it on Settings → Connections → Meta integration.
modestring"approval""approval" parks the post in the review queue; "auto" publishes as soon as it's generated.
scheduled_atISO date—Auto mode only: publish at this time instead of immediately (max 1 year ahead).
generate_imagebooleantrueMust stay true when INSTAGRAM is targeted, unless you supply image_url. Mutually exclusive with image_url.
image_urlstring—Bring your own image (public https URL) — downloaded, normalized and re-hosted like an upload.
first_commentbooleanfalseThe AI writes a per-platform first comment posted right after each post goes live. Soft: a failed comment never blocks the post.
include_source_linkbooleantrueWith first_comment: true on a URL-sourced post, the Facebook comment carries the source link (the one clickable place). Instagram stays link-free.
watermark_idstringThe brand's default logoA logo (watermark) from your library, placed on the generated image. Its id is what this field refers to. The brand default is set at Brand settings → Social; send null for no logo.
lengthstringThe standard length"short", "medium" or "long". Omit it and the post is written at the standard length.
anglestring—A ready-made take: tip, faq, use_case, feature, myth_bust, behind_the_scenes or audience_question.
instructionsstring—Per-post steer for the AI (max 4,000 characters).
namestringGeneratedA name for the post, shown only in your post list.

Code Examples

const response = await fetch("https://yaplet.com/api/social-posting/trigger", {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Y-API-Key": "YOUR_API_KEY",
    },
    body: JSON.stringify({
        url: "https://your-blog.com/new-feature",
        platforms: ["FACEBOOK", "INSTAGRAM"],
        mode: "approval",
        first_comment: true,
        instructions: "Friendly tone, no emojis.",
    }),
});

const result = await response.json();
console.log(result); // { id, status: "PENDING_GENERATION", mode, targets }

Response

Status: 202 Accepted

{
    "id": "9f4c1e6a-...",
    "status": "PENDING_GENERATION",
    "mode": "approval",
    "targets": 2
}

How It Works

Your app sends content

It sends a link or some text with your API key. The post is checked right away — a bad setup (no connected page, no linked Instagram) fails the call immediately instead of failing later.

Yaplet writes the post

Within about 2 minutes it reads the source, writes the captions, hashtags, alt text and first comments, and creates (or re-hosts) the image with your logo.

You approve it, or it goes out

In approval mode the finished draft appears in Marketing → AI Social Posting → Review queue and reviewers get an in-app notification. In auto mode it publishes as soon as it's ready, or at scheduled_at.

It's published

Each Facebook page and Instagram account gets its own post and succeeds or fails on its own — the optional first comment is posted right after each one goes live. If writing fails, nothing is published and the post shows why.

Post Angles

The optional angle field takes one of these ready-made approaches:

ValueWhat the post does
tipShares one practical tip from the source that people can use right away.
faqAnswers one common customer question on the topic, plainly and helpfully.
use_caseTells a short, real story of solving a problem: the situation, what was done, the result.
featureHighlights one feature or offer and the clear benefit it brings.
myth_bustClears up one common misconception and explains what's actually true.
behind_the_scenesShows how something works or is made, in an honest, human way.
audience_questionStarts a conversation with one easy question to your audience.

Errors

StatusMeaning
401Missing or invalid Y-API-Key.
403AI Social Posting is not available on your plan — the module is not part of your organization's plan.
400Validation problem — the message says which field. That includes sending both url and content (or neither), a page_ids entry that isn't one of the brand's pages, and leaving out brand_id when you have several brands.
404The brand_id or watermark_id wasn't found (a brand that isn't yours, or a logo that isn't in your library).
422The brand has no connected Facebook page, or you asked for Instagram but no page has an Instagram account linked — or you have no brand yet.
429More than 20 posts are already waiting to be written, or too many requests in a short burst — try again shortly.
500Something went wrong on our side while creating the post.

Billing

BillingWriting captions and creating images are paid like the rest of Yaplet's AI: your free 14 days' credits first, then credit you bought, then your plan's usage billing. When none of those can pay, nothing is written and the post shows as Failed with a note to add credit or choose a plan in Billing. A failed generation never publishes anything and is never charged; the Failed post in your list shows the reason.

© 2026 Yaplet. All rights reserved.