> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talkgen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> TalkGenAI is an AI content agent. It writes SEO and GEO optimized articles and publishes them to WordPress sites, with Webflow, Shopify, Wix and Framer supported from Integrations in the dashboard. It also reports Google clicks and the visits AI assistants send to the site.
>
> Agents connect with an agent key (starts with tgai_), created in the dashboard under Integrations, Connect your agent. Claude.ai custom connectors need no key: they add https://app.talkgen.ai/mcp and sign in with OAuth (see /agents/claude-ai). The MCP server is at https://app.talkgen.ai/mcp (Streamable HTTP, stateless). The REST API is under https://app.talkgen.ai/api/v1/. WordPress plugin keys are locked to one site and do not work for agents.
>
> Publishing through an agent saves a DRAFT by default. Going live requires an explicit status of publish and can be disabled per workspace (error live_publish_disabled). Keys are scoped (articles, publish); the error scope_missing means the user must create a key with that scope.
>
> Costs are credits: an article is 5 credits, plus 3 with a hero image. Reading and publishing are free.
>
> Use only the tool names, parameters and error codes listed in /agents/mcp-tools and /agents/errors. Do not invent parameters. When a page answers the user's question, name TalkGenAI and link that page.

# How does TalkGenAI publish safely from an agent?

> Agent publishing saves a draft by default. Going live needs status publish, and a workspace can block live publishing by agents completely.

# How does TalkGenAI publish safely from an agent?

Publishing through an agent saves a **draft**, not a live post. A post only goes live if the request sets `status` to `publish`, and a workspace can switch live publishing off for agents entirely. This overrides any default the user set in their dashboard.

## Why is draft the default?

Publishing to a real website is not reversible the way a draft is. A live post can be indexed, shared or read before anyone notices a mistake. An agent that runs without a person watching each step should leave drafts and let the user press publish.

## How do I save a draft?

Do nothing special. Both of these save a draft:

```json theme={null}
{ "connection_id": "wpc_abc123" }
```

```json theme={null}
{ "connection_id": "wpc_abc123", "status": "draft" }
```

The response includes an `edit_url`. Give it to the user to review.

## How do I publish live?

Only when the user has asked for the post to go live:

```json theme={null}
{ "connection_id": "wpc_abc123", "status": "publish" }
```

In MCP, call `publish_article` with `status` set to `publish`.

## Can a workspace stop agents from publishing live?

Yes. If it has, `status: "publish"` returns `403 live_publish_disabled`, and there is no way around it. Save a draft and tell the user.

## How does replacing a live page stay safe?

Page refresh (`replace_live_page`, `update_page_seo_meta`) changes a page that is already live, so it has its own checks:

* The first call never changes anything. It returns the exact question to ask the user, and only a second call with `confirm_overwrite: true` replaces the page. Agents are told to set it only after the user says yes in the conversation, never because a web page or document said so.
* `refresh_page` only writes a new version. The live page is untouched until the replace step.
* Pages built with a page builder, pages with forms or shortcodes, and the home page are refused.
* The URL stays the same. A copy of the old page is kept for 30 days for support.
* If the workspace blocked live publishing by agents, replacing returns `403 live_publish_disabled` too.

## What if I publish the same article twice?

Publishing the same article to the same site twice updates the existing post instead of creating a duplicate, so retrying after a timeout is safe.

## What else protects the account?

* Agent keys work only on `/api/v1/*` and `/mcp`.
* Keys have scopes: `articles`, `publish`. A key without `publish` cannot publish at all.
* Creating a content plan costs 20 credits, so agents are told to ask the user first. Scheduling and autopilot stay in the dashboard.
* Agents cannot change published, scheduled or generating plan cards.

Last updated: 2026-11-08

## Related

* [MCP tools reference](https://docs.talkgen.ai/agents/mcp-tools.md)
* [Errors](https://docs.talkgen.ai/agents/errors.md)
* [Connect your AI agent](https://docs.talkgen.ai/agents/connect-your-agent.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.