# Threads

Source: https://docs.autessa.com/docs/tools/threads

> Tool types for drafting, publishing, syncing, and measuring Threads posts through a Threads connector.

# Threads

Draft Threads posts — up to 500 characters with an optional image — into a reviewable AutessaDB table, publish approved drafts through Threads' container flow, sync the account's existing posts, and read per-post engagement.

Every tool on this page requires a Threads connector (see
[Connectors](/docs/guide/connectors.md)); pass its ID as `connectorId`. Posts
live as rows in an AutessaDB table the connector provisions: drafts start at
`status = DRAFT`, and publishing runs Threads' container flow (create the
media container, wait for processing, then publish) before flipping the row
to `PUBLISHED` with the `threads_post_id` stored. The sync tool imports
posts published outside Autessa so the table stays the single picture of
the account.

## Create a draft **TOOL** `THREADS_CREATE_DRAFT`

Inserts a new draft row with `status = DRAFT` — nothing is posted to
Threads yet. `postContent` is capped at 500 characters, and the optional
`mediaUrl` image is stored on the row and only sent to Threads at publish
time. Returns the new `recordId` (plus a `characterCount`) for use with the
update, publish, and stats tools.

### Example

```json title="Tool config"
{
  "toolType": "THREADS_CREATE_DRAFT",
  "connectorId": "V1StGXR8Z5",
  "postContent": "@@{POST_CONTENT}",
  "mediaUrl": "@@{IMAGE_URL}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `postContent` (string) — Max 500 characters
- `mediaUrl` (string · optional) — Optional - URL of image to attach

## Update a draft **TOOL** `THREADS_UPDATE_DRAFT`

Edits an existing draft row in place; `postContent` (still max 500
characters) and `mediaUrl` are both optional and only the provided fields
change. Only rows still in `DRAFT` status can be updated — anything else
fails with `NOT_A_DRAFT`, since a post already on Threads cannot be edited
from here.

### Example

```json title="Tool config"
{
  "toolType": "THREADS_UPDATE_DRAFT",
  "connectorId": "V1StGXR8Z5",
  "recordId": 42,
  "postContent": "@@{REVISED_POST}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `recordId` (integer) — AutessaDB record ID of the draft to update
- `postContent` (string · optional) — New content (optional - only updates if provided, max 500 chars)
- `mediaUrl` (string · optional) — New image URL (optional - only updates if provided)

## Publish a post **TOOL** `THREADS_PUBLISH_POST`

Reads the draft row and runs Threads' two-step publish: it creates a media
container, polls every 5 seconds (up to 60 seconds — `TIMEOUT` after that,
`CONTAINER_ERROR` if Threads rejects the media) until the container is
ready, then publishes it. The row must still be in `DRAFT` status —
republishing fails with `ALREADY_PUBLISHED`. On success the row is updated
to `status = PUBLISHED` with the `threads_post_id` stored, and the response
includes a direct `postUrl`.

### Example

```json title="Tool config"
{
  "toolType": "THREADS_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**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `recordId` (integer) — AutessaDB record ID of the draft to publish

## Get post stats **TOOL** `THREADS_GET_POST_STATS`

Looks up the `threads_post_id` on a published row and fetches live insights
from the Threads API: views, likes, replies, reposts, and quotes. When
views are available the tool also computes `totalEngagements` and an
`engagementRate` percentage, and it returns a direct `postUrl` to the post.
Only works for rows in `PUBLISHED` status.

### Example

```json title="Tool config"
{
  "toolType": "THREADS_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**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `recordId` (integer) — AutessaDB record ID to get threads_post_id from

## Get all posts **TOOL** `THREADS_GET_ALL_POSTS`

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

### Example

```json title="Tool config"
{
  "toolType": "THREADS_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**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `status` (string · optional) — Optional - filter by status: DRAFT, PUBLISHED, SCHEDULED
- `pageSize` (integer · optional) — Optional - max posts to retrieve (default 50, max 100)

## Get post by ID **TOOL** `THREADS_GET_POST_BY_ID`

Fetches a single row from the posts table by its AutessaDB `rowId`,
returning the post's content, status, media URL, and stored
`threads_post_id`. Use it to inspect one specific draft or published post
without paging through the full list.

### Example

```json title="Tool config"
{
  "toolType": "THREADS_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**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `rowId` (integer) — Required - the AutessaDB row ID of the post to fetch

## Sync posts **TOOL** `THREADS_SYNC_POSTS`

Imports the connected account's recent posts (up to 50 per sync) from the
Threads 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`. The summary reports `syncedCount`, `newPostsCount`, and
`skippedCount`.

### Example

```json title="Tool config"
{
  "toolType": "THREADS_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**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `forceRefresh` (boolean · optional) — Optional: bypass daily cache if true

## Related

- [Tool Types overview](/docs/tools.md)
- [Tools guide](/docs/guide/agentic/tools.md)
- [Connectors guide](/docs/guide/connectors.md)
- [Twitter / X tool types](/docs/tools/twitter.md)
- [Instagram tool types](/docs/tools/instagram.md)
- [Bluesky tool types](/docs/tools/bluesky.md)

