URL: /code/apps/sites-and-content/publish-content · Id: `page:/code/apps/sites-and-content/publish-content`

# Content.publish

> Puts approved Content live on your Site and every Interface once it passes the checks for its kind.

POST https://api.sb/&#123;your-domain&#125;/content/&#123;content&#125;/publish

Puts approved [Content](https://startupbuilder.dev/business/nouns/content) live on your [Site](https://startupbuilder.dev/business/nouns/site) and every [Interface](https://startupbuilder.dev/business/nouns/interface) once it passes the checks for its kind.

- **Action class:** `publish`
- **Approval:** Publishes on its own
- **Emits:** `Content.published`
- **Venues:** Bing, Google Search Console
- **Price:** Free

```text title="Run it · Ask"
Publish the rent-tracking guide.
```

```ts title="Run it · SDK"
import { $ } from 'startup-builder'

const result = await $.try.Content.publish({ content: 'https://api.sb/leaseline.app/content/content_Gd3rN8tW1k' })
```

```json title="Run it · Response"
{
  "api": "https://api.sb/leaseline.app",
  "content": {
    "$id": "https://api.sb/leaseline.app/content/content_Gd3rN8tW1k",
    "$type": "Content",
    "status": "published",
    "url": "https://leaseline.app/guides/track-rent-40-units"
  },
  "action": {
    "operation": "Content.publish",
    "mode": "try",
    "status": "done"
  }
}
```

Its Inputs, Outputs, Effects and guards quote [the hub’s `Content.publish`](https://startupbuilder.dev/business/nouns/content/publish); this page adds what each Venue honors, its limits and a worked call. It is one of the [Verbs](https://startupbuilder.dev/business/nouns/verb) of [Sites and content](/code/apps/sites-and-content#verbs).

## Inputs
| Name | Type | Default | Meaning |
| --- | --- | --- | --- |
| `content` | `Content` | Required | The draft to publish. |

## Outputs
| Field | Type | What `null` means |
| --- | --- | --- |
| `content` | `Content` | Never null: the published Content. |

## Effects
**Action class**

`publish`: an approval rule on `publish` can make it wait for your OK

**Modes**

- `try`: Runs every check and returns what would go out, as it would go out; nothing is sent, posted or spent.
- `send`: Returns a pending Action at once; `Content.published` fires when it is done.
- `do`: Waits for the Action to finish and returns the record.

**Idempotency**

Only with a key: the same `Idempotency-Key` and input return the first Action, and the same key with other input returns `409`.

**Saved or shared**

Agents read it as Markdown; people read it in each locale the Site serves.

**Emits**

`Content.published` with `{ content }`

**Performed by**

[Content lead](https://startupbuilder.dev/agents/marketing/content-lead)

**Price**

Free on your own account: the platform charges nothing for the call.

**Standing approval**

It goes out on its own, inside the Limits of your standing approval: a [`Mandate`](https://startupbuilder.dev/business/nouns/mandate) you grant once with [`Mandate.authorize`](/code/integrations/calls/authorize). One approval rule makes it wait for your OK.

## On each Venue
| Venue | Also sends | Formats |
| --- | --- | --- |
| [Bing](/code/integrations/bing-webmaster#limits) | `url` as `urlList[]`, `ostname` as `host` | Responsive search ad |
| [Google Search Console](/code/integrations/google-search-console#limits) | None. | None. |

Each Venue’s caps, review and rate limits are on its integration page, linked from its row. A field marked Not sent is one that Venue has no place for; the call never fails on it.

## What try does
| Account | What try does |
| --- | --- |
| [Bing Webmaster](/code/integrations/bing-webmaster#try) | Returns the URLs IndexNow would receive and the key file it would check; nothing is pushed. |
| [Google Search Console](/code/integrations/google-search-console#try) | Reads run for real, because a read changes nothing in Search Console; `try` stores no rows and submits no sitemap. |

## Refuses when
| Guard | Refuses | Error |
| --- | --- | --- |
| `content-evals` | Refuses Content that fails the Eval suite for its kind. | `refused` |

Through a connected account it can also meet [the shared account refusals](/code/refusals#accounts).

## When it waits
Returns in one response; nothing waits.

## Example
In `send` mode the call returns its pending Action at once, and `Content.published` delivers the result.

**Ask**

```text
Publish the rent-tracking guide.
```

**API**

```bash
curl -X POST "https://api.sb/leaseline.app/content/content_Gd3rN8tW1k/publish?mode=send" \
  -H "Authorization: Bearer $SB_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**CLI**

```bash
npx startup-builder do Content.publish --send --data '{}'
```

`--send` returns the pending Action at once.

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "mode": "send",
    "code": "return await $.Content.publish({})"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const result = await $.send.Content.publish({
  content: 'https://api.sb/leaseline.app/content/content_Gd3rN8tW1k',
})
```


```json title="Response, in send mode"
{
  "mode": "send",
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_Sd3kQ9vT2w",
    "operation": "Content.publish",
    "status": "pending",
    "reason": "running"
  }
}
```

To retry, send the same `Idempotency-Key`: the retry returns the first answer for $0. A new key reads again.

## Used by
- **Agent tasks:** [Answer page per question](/capabilities/make-content/answer-pages) · [Monthly search content](/capabilities/make-content/monthly-search-content)
- **Jobs:** [Convert visitors](/capabilities/convert-visitors) · [Get indexed](/capabilities/get-indexed) · [Publish and post](/capabilities/publish-and-post)
- **Integrations:** [Bing Webmaster](/code/integrations/bing-webmaster) · [Google Search Console](/code/integrations/google-search-console)

## Related
[`Content.draft`](/code/apps/sites-and-content/draft) · [`Page.publish`](/code/apps/sites-and-content/publish-page) · [`Site.publish`](/code/apps/sites-and-content/publish-site) · [`Page.create`](/code/apps/sites-and-content/create-page) · [`Page.update`](/code/apps/sites-and-content/update-page) · [`Content.create`](/code/apps/sites-and-content/create-content) · [`Content.update`](/code/apps/sites-and-content/update-content) · [`Domain.connect`](/code/apps/sites-and-content/connect)