Hanzo
OpenapiSocial

Stores a post for the org and answers 201 with the stored row.

Stores a post for the org and answers 201 with the stored row.

POST /v1/social/posts

Addresshttps://api.hanzo.ai/v1/social/posts
MethodPOST
Operationpost_social_posts
AuthAuthorization: Bearer $HANZO_API_KEY

Stores a post for the org and answers 201 with the stored row.

A post created as scheduled for a time that has already passed is published IMMEDIATELY, and the row returned carries that outcome — this is the one behaviour a reader would otherwise miss. A future-scheduled post is left for the scheduler, and a draft is left alone. Publishing never fails the creation: the post is stored either way, and a publish that could not run leaves the row for the scheduler to retry.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
channelbodystringChannel is the network to publish to: x, facebook, instagram, linkedin, tiktok, youtube or threads.
contentbodystringContent is the post's text. Required — an empty body is a 400 — and bounded at 8192 characters, comfortably above every network's own limit.
mediabodystring[]Media is the post's attached media as URLs, at most 10, each bounded at 1024 characters.
scheduleAtbodyintegerScheduleAt is when to publish, as a unix timestamp in SECONDS. 0 means unscheduled. A negative value is clamped to 0.
statusbodystringStatus is the post's lifecycle state: draft, scheduled, published or failed. Omitted means draft.

Response

StatusBodyMeaning
201socialPostcreated

201 body — 11 fields.

FieldInTypeAlwaysDescription
accountIdbodystringAccountID / ExternalID / Error are server-managed publish results, set only by the publish path (never by a client update): the account a post was published…
channelbodystringChannel is the network this post targets: x, facebook, instagram, linkedin, tiktok, youtube or threads.
contentbodystringContent is the post's text, bounded at 8192 characters.
createdAtbodyintegerCreatedAt is when the post was created, as a unix timestamp in seconds.
errorbodystringError is why the last publish attempt failed, verbatim and bounded.
externalIdbodystringExternalID is the id the network returned for the published post, which is what reconciles this row against the post on the network.
idbodystringID is the post's identifier, minted on create and the id every later call addresses it by.
mediabodystring[]Media is the post's attached media as a list of URLs (images today; the composer's URL field now, an S3 picker later, populate it).
scheduleAtbodyintegerScheduleAt is when the post is due, as a unix timestamp in SECONDS. 0 means unscheduled.
statusbodystringStatus is the post's lifecycle state: draft, scheduled, published or failed.
updatedAtbodyintegerUpdatedAt is when the post row last changed, as a unix timestamp in seconds.

Failure carries the platform error shape — see Errors.

Examples

hanzo social posts create

Social API · All Hanzo APIs · Interactive reference

How is this guide?

On this page