---
title: "Publish To Platform"
method: POST
path: "/api/v1/blog-drafts/{blog_id}/publish-to-platform"
---

# Publish To Platform

`POST /api/v1/blog-drafts/{blog_id}/publish-to-platform`

## Request

- Base URL: `https://api.seoproai.co`
- URL: `https://api.seoproai.co/api/v1/blog-drafts/{blog_id}/publish-to-platform`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://dajosjnaalanhqksxrpe.supabase.co/auth/v1/authorize`, token URL `https://dajosjnaalanhqksxrpe.supabase.co/auth/v1/token`)

Publishes a blog post to the configured platform (HubSpot, WordPress, Webflow).
When ``publish_as_draft`` is True (see ``CMS_DRAFT_SUPPORTED_PLATFORMS`` for
the supported integrations),
the post will be created as a CMS draft instead of being immediately published.

Can be called in two ways:
1. As a FastAPI endpoint with blog_id in path
2. Directly from code with blog_id, platform, platform_config, and db parameters

Returns a dictionary with the result of the publish operation.

## Path parameters

- `blog_id` integer, required

## Query parameters

- `platform` string, nullable
- `db` unknown
- `website` unknown
- `publish_as_draft` boolean

## Headers

- `X-User-Id` string, nullable
- `X-Organization-Id` string, nullable
- `Authorization` string, nullable

## Request body

- object, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/seoproai/apis/seopro-ai.md) · [All operations](https://skmtc.dev/seoproai/apis/seopro-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/seoproai/apis/seopro-ai/revisions/5b4b6391ddc9?raw)
