> ## Documentation Index
> Fetch the complete documentation index at: https://okl-ink.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle Publish

> Toggle the published state of an okl.ink page.

# Toggle Publish

Toggles whether a page is publicly visible at its `/:slug` route or restricted to private drafts. Requires `pages:write` scope.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with `pages:write` scope.
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  The project ID.
</ParamField>

### Response

<ResponseField name="published" type="boolean">
  The new publication state (`true` or `false`).
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://okl.ink/api/v1/pages/cly1019283749/publish \
    -H "Authorization: Bearer YOUR_API_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "published": true
  }
  ```
</ResponseExample>
