Skip to main content

Instagram

Draft Instagram posts — single images or carousels — into a reviewable AutessaDB table, publish approved drafts to the connected account, sync existing posts, and read per-post engagement.

Every tool on this page requires an Instagram connector (see Connectors); pass its ID as connectorId. Posts live as rows in an AutessaDB table the connector provisions: drafts start at status = DRAFT, and publishing runs Instagram's container flow (create the media container, wait for processing, then publish) before flipping the row to PUBLISHED with the Instagram post ID stored. Image URLs must be publicly accessible — Instagram fetches the media from the URL, not from Autessa.

Create a draft TOOLINSTAGRAM_CREATE_DRAFT​

Inserts a new draft row with status = DRAFT — nothing is posted to Instagram yet. caption is capped at 2,200 characters, and mediaUrls is a comma-separated list of image URLs: one URL publishes as a single image, two to five publish as a carousel. Returns the new recordId for the update, publish, and stats tools.

Example​

Tool config
{
"toolType": "INSTAGRAM_CREATE_DRAFT",
"connectorId": "V1StGXR8Z5",
"caption": "@@{CAPTION}",
"mediaUrls": "https://example.com/photo-1.jpg,https://example.com/photo-2.jpg"
}
This tool type requires a connected external account. Pass the connector's ID as connectorId in the tool configuration.

Configuration fields

  • Name
    connectorId
    Type
    string (ID)
    Description
    Required string (ID) value. References a connector by ID.
  • Name
    caption
    Type
    string
    Description
    Max 2200 characters
  • Name
    mediaUrls
    Type
    string
    Description
    Comma-separated URLs of images (max 5)

Update a draft TOOLINSTAGRAM_UPDATE_DRAFT​

Edits an existing draft row in place; caption and mediaUrls are both optional and only the provided fields change. This edits the AutessaDB row only — Instagram does not allow editing a post's media after publishing, so get the draft right before you publish it.

Example​

Tool config
{
"toolType": "INSTAGRAM_UPDATE_DRAFT",
"connectorId": "V1StGXR8Z5",
"recordId": 42,
"caption": "@@{REVISED_CAPTION}"
}
This tool type requires a connected external account. Pass the connector's ID as connectorId in the tool configuration.

Configuration fields

  • Name
    connectorId
    Type
    string (ID)
    Description
    Required string (ID) value. References a connector by ID.
  • Name
    recordId
    Type
    integer
    Description
    Required integer value.
  • Name
    caption
    Type
    string · optional
    Description
    Optional - only updates if provided
  • Name
    mediaUrls
    Type
    string · optional
    Description
    Optional - only updates if provided

Publish a post TOOLINSTAGRAM_PUBLISH_POST​

Reads the draft row and runs Instagram's two-step publish: it creates a media container (single image or carousel), polls until Instagram finishes processing the media, then publishes the container. The row must still be in DRAFT status — republishing fails with ALREADY_PUBLISHED. On success the row is updated to status = PUBLISHED with the Instagram post ID stored. Expect this call to take longer than most tools while Instagram processes the media.

Example​

Tool config
{
"toolType": "INSTAGRAM_PUBLISH_POST",
"connectorId": "V1StGXR8Z5",
"recordId": 42
}
This tool type requires a connected external account. Pass the connector's ID as connectorId in the tool configuration.

Configuration fields

  • Name
    connectorId
    Type
    string (ID)
    Description
    Required string (ID) value. References a connector by ID.
  • Name
    recordId
    Type
    integer
    Description
    Required integer value.

Get post stats TOOLINSTAGRAM_GET_POST_STATS​

Looks up the Instagram post ID on a published row and fetches live engagement metrics for that post from the Instagram API. Only works for rows that have been published (or synced) and therefore carry an Instagram post ID.

Example​

Tool config
{
"toolType": "INSTAGRAM_GET_POST_STATS",
"connectorId": "V1StGXR8Z5",
"recordId": 42
}
This tool type requires a connected external account. Pass the connector's ID as connectorId in the tool configuration.

Configuration fields

  • Name
    connectorId
    Type
    string (ID)
    Description
    Required string (ID) value. References a connector by ID.
  • Name
    recordId
    Type
    integer
    Description
    Required integer value.

Get all posts TOOLINSTAGRAM_GET_ALL_POSTS​

Lists rows from the connector's posts table — drafts and published posts together by default, or filtered with status (DRAFT, PUBLISHED). pageSize defaults to 50 and caps at 100. Reads the AutessaDB table, so results include synced posts as well as agent-created drafts.

Example​

Tool config
{
"toolType": "INSTAGRAM_GET_ALL_POSTS",
"connectorId": "V1StGXR8Z5",
"status": "DRAFT",
"pageSize": 50
}
This tool type requires a connected external account. Pass the connector's ID as connectorId in the tool configuration.

Configuration fields

  • Name
    connectorId
    Type
    string (ID)
    Description
    Required string (ID) value. References a connector by ID.
  • Name
    status
    Type
    string · optional
    Description
    Optional filter: DRAFT, PUBLISHED
  • Name
    pageSize
    Type
    integer · optional
    Description
    Optional, default 50, max 100

Get post by ID TOOLINSTAGRAM_GET_POST_BY_ID​

Fetches a single row from the posts table by its AutessaDB rowId, returning the caption, media URLs, status, and stored Instagram post ID. Use it to inspect one specific draft or published post without paging through the full list.

Example​

Tool config
{
"toolType": "INSTAGRAM_GET_POST_BY_ID",
"connectorId": "V1StGXR8Z5",
"rowId": 42
}
This tool type requires a connected external account. Pass the connector's ID as connectorId in the tool configuration.

Configuration fields

  • Name
    connectorId
    Type
    string (ID)
    Description
    Required string (ID) value. References a connector by ID.
  • Name
    rowId
    Type
    integer
    Description
    Required integer value.

Sync posts TOOLINSTAGRAM_SYNC_POSTS​

Imports the connected account's existing posts from the Instagram API into the AutessaDB table as PUBLISHED rows, skipping posts that are already present. Results are cached for 24 hours — a second sync inside that window returns the cached summary unless forceRefresh is true.

Example​

Tool config
{
"toolType": "INSTAGRAM_SYNC_POSTS",
"connectorId": "V1StGXR8Z5",
"forceRefresh": false
}
This tool type requires a connected external account. Pass the connector's ID as connectorId in the tool configuration.

Configuration fields

  • Name
    connectorId
    Type
    string (ID)
    Description
    Required string (ID) value. References a connector by ID.
  • Name
    forceRefresh
    Type
    boolean · optional
    Description
    Optional: bypass daily cache if true