Skip to main content
POST
/
preferences
/
publish
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

const publishPreferencesResponse = await client.workspacePreferences.publish();

console.log(publishPreferencesResponse.page_id);
{
  "page_id": "page_default",
  "published_at": "2024-01-15T10:30:00.000Z",
  "published_by": "user_123",
  "published_version": 1,
  "preview_url": "https://example.com"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200 - application/json

Result of publishing the workspace's preferences page.

page_id
string
required

Id of the published page snapshot.

published_at
string
required

ISO-8601 timestamp of the publish.

published_version
number
required

Monotonic published version (epoch milliseconds).

published_by
string | null

Id of the publisher.

preview_url
string | null

Draft-mode hosted preferences page URL for previewing.