# Review what publishing changes

**GET** `/api/workflows/{id}/publish-review`

Shows what publishing the draft would put live, compared with the last version a person published.

Needs [an API token](https://docs.gorunner.io/api/authentication#scopes) with the **Read** permission for workflows (`workflow:read`).

## Parameters

### Path

- `id` · Required · UUID: The workflow’s ID.

## Read it

`diff` lists the changes. `callouts` names each step that holds or reads a secret, a connection or an address, and where it sends it: names only, never a value. `outline` is the tree that would go live, with every setting emptied.

It is the review on Keel’s publish card, worked out the same way. Versions Keel published on its own are passed over. `firstPublish` is `true` when no person has published yet.

## Responses

- 200 OK

  The review.

- 400 `VALIDATION_ERROR`

  `id` isn’t a UUID.

- 403 `FORBIDDEN`

  The token lacks the **Read** permission for workflows.

- 404 `NOT_FOUND`

  No workflow with this ID in the token’s workspace.

- 500 `INTERNAL_ERROR`

  The draft or a version couldn’t be read. Try again.

Any call can also answer: [`401 UNAUTHORIZED`](https://docs.gorunner.io/errors#UNAUTHORIZED) · [`401 TOKEN_ENDED`](https://docs.gorunner.io/errors#TOKEN_ENDED) · [`403 TOKEN_SURFACE_OFF`](https://docs.gorunner.io/errors#TOKEN_SURFACE_OFF) · [`403 FEATURE_OFF`](https://docs.gorunner.io/errors#FEATURE_OFF) · [`403 EMBED_NOT_ALLOWED`](https://docs.gorunner.io/errors#EMBED_NOT_ALLOWED) · [`403 EMBED_NOT_AVAILABLE`](https://docs.gorunner.io/errors#EMBED_NOT_AVAILABLE) · [`403 ACCOUNT_SUSPENDED`](https://docs.gorunner.io/errors#ACCOUNT_SUSPENDED) · [`429 RATE_LIMITED`](https://docs.gorunner.io/errors#RATE_LIMITED) · [`503 BUSY`](https://docs.gorunner.io/errors#BUSY) · [`503 PAUSED`](https://docs.gorunner.io/errors#PAUSED) · [`503 SERVICE_UNAVAILABLE`](https://docs.gorunner.io/errors#SERVICE_UNAVAILABLE). See [Errors](https://docs.gorunner.io/api/errors#by-status).

Request

**curl**

```bash
GORUNNER="https://api.gorunner.io"
GORUNNER_TOKEN="grt_…"  # needs Read for workflows
WORKFLOW_ID="your-workflow-id"

URL="$GORUNNER/api/workflows/$WORKFLOW_ID/"
URL="${URL}publish-review"
curl "$URL" \
  -H "Authorization: Bearer $GORUNNER_TOKEN"
```

**JavaScript**

```js
const GORUNNER = "https://api.gorunner.io";
const TOKEN = process.env.GORUNNER_TOKEN;
const WORKFLOW_ID = process.env.WORKFLOW_ID;

const res = await fetch(
  `${GORUNNER}/api/workflows/${WORKFLOW_ID}/` +
    `publish-review`,
  {
    headers: { Authorization: `Bearer ${TOKEN}` },
  },
);
const { data } = await res.json();
```

**Python**

```python
import os, requests

GORUNNER = "https://api.gorunner.io"
TOKEN = os.environ["GORUNNER_TOKEN"]
WORKFLOW_ID = os.environ["WORKFLOW_ID"]

res = requests.get(
    f"{GORUNNER}/api/workflows/{WORKFLOW_ID}/"
    f"publish-review",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]
```

Response · 200 OK, shortened

```json
{
  "data": {
    "rev": 8,
    "baseVersionId": "f20f671a-2c8e-4b9d-a7f1-6e3b0d5c9a12",
    "baseVersion": 3,
    "firstPublish": false,
    "diff": [
      {
        "kind": "add",
        "text": "Add step “Post to Slack”"
      }
    ],
    "callouts": [
      {
        "kind": "connection",
        "step": "Post to Slack",
        "text": "Post to Slack will sign in with the connection “Slack (Acme)”"
      }
    ],
    "outline": {}
  }
}
```

**Every field**

It takes no body.

### Response · 200 OK

- `data` · object: What publishing would put live (GET /api/workflows/{id}/publish-review).
  - `rev` · integer: The draft revision the review describes; a publish click names it.
  - `baseVersionId` · UUID: The last version a person published; absent on a first publish.
  - `baseVersion` · integer: That version’s number.
  - `firstPublish` · boolean: Nothing was published by a person before.
  - `diff` · array of objects
    - `kind` · string
    - `text` · string
  - `callouts` · array of objects
    - `kind` · string: address | connection | secret
    - `step` · string
    - `text` · string
  - `outline` · object: The definition that goes live, every config emptied.

Related: [Publish a workflow](https://docs.gorunner.io/api/publish/publish-workflow) · [What Keel can do](https://docs.gorunner.io/build/keel)

Source: https://docs.gorunner.io/api/publish/get-publish-review
