The New Black AI

Social Publishing API

Post AI-generated fashion visuals to Instagram, TikTok, X, Pinterest and YouTube by API — immediately or on a schedule, through the exact pipeline the app's own publish button uses. One endpoint for every platform: the connected account you name decides where the post goes.

Needs a key with the publish scope and an active plan; create keys and connect the platforms from your profile. Generate the visuals first with any workflow of the API. A Shopify store has its own page.

GET/v1/publish/accounts

The social accounts connected to your account, with the placements each accepts for an image and for a video. The connection_id is what the publish call wants.

Request

curl https://thenewblack.ai/api/v1/publish/accounts \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"

Response · 200

{ "accounts": [
    { "connection_id": "b41f...", "platform": "instagram",
      "username": "yourbrand", "display_name": "Your Brand",
      "link": "https://instagram.com/yourbrand",
      "placements": { "image": ["feed", "story", "carousel"],
                      "video": ["reel", "story"] } },
    { "connection_id": "7c2a...", "platform": "pinterest",
      "username": "yourbrand", "display_name": "Your Brand",
      "link": "https://pinterest.com/yourbrand",
      "placements": { "image": ["pin"], "video": ["pin"] } } ] }
POST/v1/publish

Creates one post on one connected account. Without scheduled_at it goes out now — a single image usually returns already posted with its permalink; a video answers publishing and finishes in the background (poll the post, below).

connection_idstringrequiredThe destination account, from /v1/publish/accounts.
placementstringrequiredWhere on the platform: feed, story, carousel, reel (Instagram) · tiktok · post (X) · pin (Pinterest) · short (YouTube). The accounts listing says which ones each connection accepts.
media_idsarrayrequiredThe creations to post — ids your generations returned, in order. A carousel takes several; most placements take one.
captionstringoptionalThe post's text. Instagram's caption rules, X's 280 characters and TikTok's 2200 are enforced at the door.
scheduled_atstringoptionalISO timestamp up to a year ahead. Absent means now.
board_idstringoptionalPinterest only, required there: the board to pin onto. board_name may ride along as a display snapshot.
titlestringoptionalA pin's or Short's own title (100 characters max).
linkstringoptionalA pin's outbound link — a full http(s) url.
tiktokobjectoptionalTikTok only, required there: privacy_level (PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR or SELF_ONLY) plus the booleans allow_comment, allow_duet, allow_stitch, brand_organic, brand_content.
collaboratorsstringoptionalInstagram feed, carousel and reel: up to 3 usernames to invite as collaborators, comma-separated.
is_ai_generatedbooleanoptionalDefaults to true — posts carry the platform's AI-generated disclosure where one exists. Send false only for media that genuinely is not.

Request

curl -X POST https://thenewblack.ai/api/v1/publish \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{ "connection_id": "b41f...", "placement": "feed",
        "media_ids": ["9f2c1e2a-..."],
        "caption": "Boxy tweed jacket — new drop." }'

Response · 201

{ "post": {
    "id": "e77d...", "platform": "instagram", "placement": "feed",
    "status": "posted",
    "scheduled_at": "2026-08-26T14:03:22Z",
    "posted_at": "2026-08-26T14:03:29Z",
    "permalink": "https://www.instagram.com/p/DAbCdEfGhIj/",
    "error_code": null, "error_detail": null } }
GET/v1/publish/{id}

One post's state. scheduled waits for its time, publishing is on its way, posted carries the permalink, failed carries the reason in error_code and error_detail. A video typically settles within a minute or two — poll every few seconds.

Request

curl https://thenewblack.ai/api/v1/publish/e77d... \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"

Errors

400statusrequiredbad_placement · bad_shape · bad_caption · missing_board · missing_privacy_level — the request breaks a platform rule; the message says which.
403statusrequiredpremium_required — publishing needs an active plan on the account.
404statusrequiredconnection_not_found · media_not_found — the connection or a creation is not this account's.
409statusrequiredconnection_expired — the platform connection lapsed; reconnect it from your profile.

Frequently asked questions

Which platforms can I publish to through the API?

Every platform your account has connected: Instagram (feed, story, carousel, reel), TikTok, X, Pinterest and YouTube Shorts. One endpoint serves them all — the connection you name decides the platform, and the placement decides the format.

Do I need anything besides an API key?

Three things: a key carrying the publish scope, an active plan on the account, and the platform connected once from your profile on thenewblack.ai. Connections belong to the paying account — on a team, that is the leader's connections.

Can I schedule a post for later?

Yes — send scheduled_at as an ISO timestamp up to a year ahead. Without it the post goes out immediately: a single image usually returns already posted, permalink included. A scheduled post appears in the studio's publishing history like any in-app scheduled post, and can be cancelled there.

Why does TikTok need extra fields?

TikTok's platform rules require the privacy level and interaction switches to be chosen explicitly for every post, never defaulted. Send them in the tiktok object — privacy_level plus the allow_comment, allow_duet, allow_stitch and branded-content booleans.

Can I publish an arbitrary image URL?

No. The route publishes creations of your account, named by the media ids your generations returned. An unknown id answers 404 media_not_found.

Does this use a different pipeline than the app?

No — it is the same corridor the studio's publish modal walks, rule for rule: same placement grammar, same per-platform validation, same worker. A post published by API shows in the studio's publishing history, exactly as if it had been posted in-app.

Publishing to a Shopify store — product pages rather than feeds — has its own page. Back to the API reference.