# Publish Analytics Page

Publish the draft: it becomes a new numbered version and what viewers see. Until then, people the page is shared with keep seeing the last published version.

`POST https://connect.mindcloud.co/v2/analytics/pages/:pageId/publish`

Permissions: `analytics:page:edit`.

## Parameters

### Path

- `pageId` (string, required): The page id, from List Analytics Pages.

### Headers

- `If-Match` (string, required): Required. The revision you last read: the `revision` from its read (Get Workflow Definition for a workflow, Get Analytics Page Definition for an Analytics page, Get Analytics Data Source Table for a fixed source's table), or `meta.revision` from your last change to it. The `ETag` header of either answer is the same value, ready to send back. The change applies only if nobody changed it since: otherwise it answers 412 with the current revision in `error.details.revision`. Send it as a strong entity tag (`"r_..."`): a weak one (`W/"..."`) never matches and answers 412. Without it the request answers 428.
- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Body

- `confirmationReceipt` (string): The receipt a 409 ANALYTICS_EMBED_CONFIRMATION_REQUIRED answered, to confirm the change to published embeds.
  Only after a 409 ANALYTICS_EMBED_CONFIRMATION_REQUIRED for the same request: the confirmationReceipt from its error.details, confirming the change to the published embeds it lists.

## Example request

```bash
curl --request POST \
  --url 'https://connect.mindcloud.co/v2/analytics/pages/Pq7Lm2Xc9RtA/publish' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "confirmationReceipt": "eyJmaW5nZXJwcmludCI6IjhkNGMifQ"
}'
```

## Response fields

- `id` (string): The version id.
- `version` (number): The version number, counting up from 1.
- `name` (string): Its name, or null.
- `notes` (string): Its notes, or null.
- `isPublished` (boolean): Whether it is the version viewers see.
- `createdBy` (string): The userId of who published it, from List Members, or null.
- `createdByName` (string): Who published it, or null.
- `createdOn` (date): When it was made.
- `publishedOn` (date): When it was last made the version viewers see, or null.
