microCMS

PATCH /api/v1/contents/{endpoint}/{content_id}/status

By using the PATCH API, you can change the publication status of content via the API.

Request Header

X-MICROCMS-API-KEY

This is the authentication key required for PATCH API requests.
Please enable the "Change content publication status" permission with the default rights of the Management API and include it in the request header when sending.

cautionCaution

If the X-MICROCMS-API-KEY is identifiable, it may allow unauthorized manipulation of content by third parties. Please handle it with care. For more details, please refer to "API Key (API Authentication and Authorization Management)".

Content-Type

Specifies the format of the data to be sent.
Since microCMS only handles data in JSON format, please specify application/json.

Request Body

To change the publication status, pass PUBLISH or DRAFT as a string in an array. PUBLISH can change the content to a published state. DRAFT can change the content to a draft state.

// To set to "Published"
{"status": ["PUBLISH"]}

// To set to "Draft"
{"status": ["DRAFT"]}
informationInformation

Currently, the available status changes are limited. Details are as follows.

■ Supported Changes

  • "Published" → "Draft"
  • "Draft" → "Published"
  • "Published and Draft" → "Published" (discard draft)


■ Unsupported Changes

  • "Published" → "Published and Draft"
  • "Published" → "Unpublished"
  • "Published and Draft" → "Published" (publish the draft content)
  • "Unpublished" → "Published"
  • "Unpublished" → "Draft"

Response

If the content is created successfully, a 200 response will be returned.