Skip to content

Prepare or replace an unpublished article image ​

Returns 202 after acquiring the preparation lock; follow item-level events or GET the post until image_preparing is false. Use key=prepare to prepare/retry all image slots without publishing. Otherwise supply the existing slot key, source, and expected_version from ai.image_version. Razuna selections require asset_id. Generated alternatives respect the image budget. Existing unpublished Ghost drafts receive explicit replacements; published posts are protected. Retries reuse uploaded images and pending bytes. Progress uses item-level socket events.

Request preparation ​

Send a POST request to /product/sites/{siteId}/content-posts/{postId}/images/{key} on the appropriate server. Check the API overview for base URL guidance and the server information in the interactive reference. Replace path placeholders with identifiers from the intended account or site; a similarly named record in another workspace is not interchangeable.

The declared request parameters are:

  • siteId (path, required): Use the type and constraints shown in the parameter reference.
  • postId (path, required): Use the type and constraints shown in the parameter reference.
  • key (path, required): Use the type and constraints shown in the parameter reference.

This operation defines an optional request body. Documented media types: application/json. Review required fields, nested objects, and allowed values in the request schema. Keep identifiers and field types intact when replacing example data with your own values.

Authentication and scope ​

The specification lists these security alternatives: BearerAuth, AccessToken. Read any operation-specific restrictions as well: browser-session, account-role, and signed-user requirements may impose additional conditions. See authentication before choosing a credential.

Keep credentials in the appropriate private configuration and remove secrets from shared logs. Confirm the target resource belongs to the intended workflow before issuing a request. Authentication alone should not be treated as confirmation that a supplied account, site, or customer identifier is correct.

Response handling ​

The documented responses for Prepare or replace an unpublished article image are:

  • 200: Updated content post
  • 202: Preparation started: {post, preparing: true}; the post contains masked image progress, never credentials or pending bytes
  • 400: Invalid input, unavailable provider, or preparation failure; retry after resolving the error
  • 401: Authentication required
  • 403: Team admin access required for connection changes

Exercise this operation with controlled test data before enabling it in an automated workflow. Validate the request against the schema and inspect the response before updating local state. Do not assume that a successful response means background processing has finished; follow any documented status or follow-up operation when the action queues additional work.

If a connection fails after submission, investigate the current server state before repeating an action whose outcome is uncertain. When requesting support, retain the method, route, response status, and sanitized error message. The interactive reference below provides the detailed schemas and examples for this specific operation.

Prepare or replace an unpublished article image​

POST
/product/sites/{siteId}/content-posts/{postId}/images/{key}

Returns 202 after acquiring the preparation lock; follow item-level events or GET the post until image_preparing is false. Use key=prepare to prepare/retry all image slots without publishing. Otherwise supply the existing slot key, source, and expected_version from ai.image_version. Razuna selections require asset_id. Generated alternatives respect the image budget. Existing unpublished Ghost drafts receive explicit replacements; published posts are protected. Retries reuse uploaded images and pending bytes. Progress uses item-level socket events.

Authorizations​

BearerAuth

JWT token from login

Type
HTTP (bearer)
or
AccessToken

Personal access token. Value: Token <your-token>

Type
API Key (header: Authorization)

Parameters​

Path Parameters

siteId*
Type
string
Required
postId*
Type
string
Required
key*
Type
string
Required

Request Body​

application/json
JSON
{
  
"source": "string",
  
"asset_id": "string",
  
"expected_version": 0
}

Responses​

Updated content post

application/json
JSON
{
  
"post": "string"
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI