> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nedzo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish or unpublish a workflow

> Check a workflow and make its steps live, or stop it from starting new runs.

<Note>
  These endpoints are for the VIP plan only. Other plans get a `403`. See [Plan access](/api-reference/introduction#plan-access).
</Note>

## Publish

`POST /v1/workflows/{id}/publish`

Check the workflow and make the current steps live. Each publish saves a new [version](/api-reference/workflows/versions). The workflow must be on to start runs.

If the check finds problems, nothing is published and we answer `400` with every problem in `errors`. Each `field` names the step as `nodes.<stepId>.<field>`. A problem with the whole workflow, like a missing trigger, uses `nodes`:

```json theme={null}
{
  "type": "https://api.nedzo.ai/errors/validation-error",
  "title": "Validation Error",
  "status": 400,
  "detail": "The workflow has steps that are not ready. Fix the steps listed in errors.",
  "errors": [
    { "field": "nodes.crm.config.url", "message": "Webhook URL is required" }
  ]
}
```

If the workflow has a schedule trigger and we could not set up the schedule, the workflow is still published. The answer then has a `scheduleError` that says so. Publish again to try again.

## Unpublish

`POST /v1/workflows/{id}/unpublish`

Stop the workflow from starting new runs. Its steps stay as they are, and you can publish again later.

## Path Parameters

<ParamField path="id" type="string" required>
  The workflow's id.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.nedzo.ai/v1/workflows/123e4567-e89b-12d3-a456-426614174000/publish" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>

Both answer with the workflow, the same as [Get a workflow](/api-reference/workflows/get).

## Errors

| Status | When |
| - | - |
| `400` | Publish: the workflow failed the check, or it has a step that turns DND off. `errors` lists each problem. |
| `402` | The account has no plan, or its subscription is not active. |
| `403` | Your plan is not VIP, workflows are not on your plan, or the workspace is locked. |
| `404` | No workflow has this id, or it is not in this key's scope. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.