> For the complete documentation index, see [llms.txt](https://help.blotato.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.blotato.com/agent-workflows/agent-workflows/publish.md).

# Publish and verify a post

Select the account, validate the destination, submit a post, retain its ID, and verify the final result without duplicate writes.

Scope: external assistants using MCP or REST, including n8n and Make HTTP requests. Publishing requires paid access, a connected social account, and the user's authorization for the content and destination. For website actions, use [Create posts](/web-app-getting-started/posts.md).

Prompt for your assistant:

> Publish this post to my selected Blotato account. First list my accounts and confirm the destination from my request. Check the platform requirements, submit the post, and return its final status and public URL.

## Using MCP

The following text-only X example illustrates the complete path. Replace example IDs and text with the customer's requested destination and approved content. Other platforms have different requirements.

1. Call `blotato_list_accounts` with `{"platform":"twitter"}`. The result is an account array, not REST's `items` wrapper:

```json
[
  {
    "id": "98432",
    "platform": "twitter",
    "fullname": "Example account",
    "username": "example",
    "subaccounts": [],
    "requiredFields": {}
  }
]
```

2. Match the requested account. An empty list confirms authentication but requires connecting an account in [Accounts](https://my.blotato.com/accounts). Multiple matching destinations require clarification before a write.
3. Call `blotato_create_post`:

```json
{
  "accountId": "98432",
  "platform": "twitter",
  "text": "Approved post text.",
  "mediaUrls": []
}
```

4. Read the tool result, including `isError`, `status`, and any error text. If processing continues, retain `postSubmissionId` and call `blotato_get_post_status` at least 10 seconds later:

```json
{
  "postSubmissionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

5. Follow the result table below. The create tool waits internally for up to 20 seconds. It might return a completed result without another status request. Do not submit the same post again to check progress.

### Adapt the destination

1. Call `blotato_list_accounts` to find `accountId` and any Page or Slack channel IDs.
2. Read the destination's [platform guide](/platform-publishing/platforms.md). For Pinterest, call `blotato_list_pinterest_boards` to get `boardId`. For Slack, pass the requested channel's `id` from the account's `subaccounts` as `channelId`.
3. Supply public media URLs, or complete the [local upload](/agent-workflows/agent-workflows/upload.md).
4. Call `blotato_create_post` with the account, platform, content, and required platform fields.
5. If the returned status is `in-progress`, call `blotato_get_post_status` with the returned `postSubmissionId`, waiting at least 10 seconds between checks.
6. Return `published` and the supplied `publicUrl`, or explain `failed` and its `errorMessage`.

The create tool waits internally for up to 20 seconds. Another create call starts another submission. Continue unfinished work with the status tool.

## Using REST

1. Fetch `GET /v2/users/me/accounts` and any required subaccounts or Pinterest boards.
2. Send `POST /v2/posts` using the [Publish Post schema](/rest-api-reference/publish-post.md).
3. Save `postSubmissionId` from the response.
4. Poll `GET /v2/posts/:postSubmissionId` according to the [completion rules](/api-and-mcp-concepts/async-jobs-and-polling.md).

Set `post.content.platform` and `post.target.targetType` to the same platform. Each create request has one account and destination.

### Complete REST example

1. Send `GET https://backend.blotato.com/v2/users/me/accounts?platform=twitter` with the `blotato-api-key` header. Select the matching `items[].id` as `accountId`.
2. Send this body to `POST https://backend.blotato.com/v2/posts` with the same auth header and `Content-Type: application/json`:

```json
{
  "post": {
    "accountId": "98432",
    "content": {
      "platform": "twitter",
      "text": "Approved post text.",
      "mediaUrls": []
    },
    "target": { "targetType": "twitter" }
  }
}
```

3. Save the accepted response's `postSubmissionId`:

```json
{
  "postSubmissionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

4. Send `GET https://backend.blotato.com/v2/posts/a1b2c3d4-e5f6-7890-abcd-ef1234567890` with the auth header. Use the ID from step 3, not the example ID. Wait at least 10 seconds between status requests.

## Completion and recovery

The status endpoint returns the same state vocabulary used by the MCP status tool:

```json
{
  "postSubmissionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "published",
  "publicUrl": "https://x.com/example/status/123456"
}
```

| Result                            | Agent action                                                                                                                |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `published`                       | Report success and the returned `publicUrl` when supplied. Do not construct a guessed URL.                                  |
| `failed`                          | Stop. Read `errorMessage`, correct the cause, and obtain authorization for any new submission outside the original request. |
| `in-progress`                     | Poll the saved ID with a waiting limit. Report the ID and unresolved state if the limit is reached.                         |
| `scheduled`                       | Report the returned `scheduledTime`. Do not describe it as published.                                                       |
| No response or an uncertain write | Inspect the [Logs](https://my.blotato.com/logs) and existing work before creating again.                                    |

For media, complete [upload and validation](/agent-workflows/agent-workflows/upload.md) before creating the post. For Instagram, Facebook, TikTok, Pinterest, YouTube, LinkedIn, or Slack, use the [platform-specific request](/platform-publishing/platforms.md), including required media and destination fields.

## Cross-post

1. Select the accounts requested by the user.
2. Adapt the media and target fields for each platform.
3. Create a separate submission for each destination.
4. Track each submission ID and report each outcome separately.

A success on one platform does not establish success on another. For publishing later, use [Scheduling](/agent-workflows/agent-workflows/schedule.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.blotato.com/agent-workflows/agent-workflows/publish.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
