PendiumDocs

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

  1. get_social_accounts to see the Page and whether an Instagram account is linked.
  2. Draft the posts and get the owner's ok.
  3. schedule_social_posts with every approved post. Omit scheduledFor to post now.
  4. list_scheduled_social_posts and cancel_scheduled_social_post to review or drop one later.

Errors

codeWhat it means
NOT_CONNECTEDFacebook and Instagram aren't connected for this brand. Send the owner the connectUrl.
NO_PAGE_SELECTEDConnected, but no Facebook Page is picked yet. Send the owner the connectUrl.
NO_INSTAGRAM_ACCOUNTThe Page has no Instagram professional account linked. Post to Facebook only.
INVALID_POSTOne 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_FOUNDNo scheduled post with that id for this brand.

Tools

get_social_accounts

Read where posts can go.

Authentication: Required.

Type: Read-only.

ParameterTypeRequiredDescription
syntheticIdintegerYesThe 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.

ParameterTypeRequiredDescription
syntheticIdintegerYesThe agent whose accounts to post to.
postsarray (1 to 14)YesThe 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.

ParameterTypeRequiredDescription
syntheticIdintegerYesThe agent whose scheduled posts to list.

Returns:

  • posts[]: the posts waiting to go out, soonest first, with id, platform, caption, imageUrl and scheduledFor.
  • recent[]: posts from the last 14 days that left the queue, newest first, with id, platform, caption, scheduledFor, status (publishing, published or failed), url (the live post, when published) and error (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.

ParameterTypeRequiredDescription
syntheticIdintegerYesThe agent the post belongs to.
idstringYesThe scheduled post's id.

Returns status: cancelled, or already_done when the post already went out or was cancelled before.

On this page