Post to Facebook and Instagram
Post and schedule the posts the owner approved on the brand's Facebook Page and Instagram account.
Posts go to the Facebook Page the owner picked in Pendium (Integrations > Facebook & Instagram) and to the Instagram professional account linked to that Page. Use these tools to see what's connected, post or schedule the posts the owner approved, and review or cancel posts that haven't gone out.
When to use
After the owner approves a post or a week of posts. A post is public under the business's name, so never post text the owner hasn't approved. One approval can cover a batch: send all of it in one schedule_social_posts call.
Typical sequence
get_social_accountsto see the Page and whether an Instagram account is linked.- Draft the posts and get the owner's ok.
schedule_social_postswith every approved post. OmitscheduledForto post now.list_scheduled_social_postsandcancel_scheduled_social_postto review or drop one later.
Errors
code | What it means |
|---|---|
NOT_CONNECTED | Facebook and Instagram aren't connected for this brand. Send the owner the connectUrl. |
NO_PAGE_SELECTED | Connected, but no Facebook Page is picked yet. Send the owner the connectUrl. |
NO_INSTAGRAM_ACCOUNT | The Page has no Instagram professional account linked. Post to Facebook only. |
INVALID_POST | One post can't go out as given (an Instagram post without an image, a caption that's too long, a time more than 75 days out). Nothing in the call was scheduled. |
NOT_FOUND | No scheduled post with that id for this brand. |
Tools
get_social_accounts
Read where posts can go.
Authentication: Required.
Type: Read-only.
| Parameter | Type | Required | Description |
|---|---|---|---|
syntheticId | integer | Yes | The agent whose social accounts to read. |
Returns connected, the selectedPage (pageId, name), its linked instagram account (igUserId, username, or null), the pages the connected account manages, and a connectUrl when not connected.
schedule_social_posts
Post now or at set times. Validated as a batch: if one post is invalid, nothing is scheduled.
Authentication: Required.
Type: Write, non-destructive. Public: posts appear under the business's name.
| Parameter | Type | Required | Description |
|---|---|---|---|
syntheticId | integer | Yes | The agent whose accounts to post to. |
posts | array (1 to 14) | Yes | The approved posts. Each has platform (facebook or instagram), caption (up to 2,200 characters on Instagram, 5,000 on Facebook), an optional imageUrl (a public https image; required for Instagram, one image per post) and an optional scheduledFor (ISO 8601 with an offset, up to 75 days out; omit to post now). |
Returns posts[] with each post's id, platform, scheduledFor and status.
list_scheduled_social_posts
The posts that haven't gone out yet, and how recent ones went. Posts go out in the background, so check recent after a post's time before telling the owner it's live.
Authentication: Required.
Type: Read-only.
| Parameter | Type | Required | Description |
|---|---|---|---|
syntheticId | integer | Yes | The agent whose scheduled posts to list. |
Returns:
posts[]: the posts waiting to go out, soonest first, withid,platform,caption,imageUrlandscheduledFor.recent[]: posts from the last 14 days that left the queue, newest first, withid,platform,caption,scheduledFor,status(publishing,publishedorfailed),url(the live post, when published) anderror(when it failed).
A post fails without posting when the connection expired, the selected Page changed after it was approved, or the account that scheduled it became read-only or lost access to the brand.
cancel_scheduled_social_post
Cancel one post before it goes out.
Authentication: Required.
Type: Write, non-destructive.
| Parameter | Type | Required | Description |
|---|---|---|---|
syntheticId | integer | Yes | The agent the post belongs to. |
id | string | Yes | The scheduled post's id. |
Returns status: cancelled, or already_done when the post already went out or was cancelled before.