# Validate Workflow

Check the workflow's draft the way publishing will: errors block publishing (an incomplete schedule, a broken graph), warnings do not (a step not set up yet, a Map step reading an input key no input answers). Nothing changes.

`POST https://connect.mindcloud.co/v2/workflows/:workflowId/validate`

Permissions: `workflow:view`.

## Parameters

### Path

- `workflowId` (string, required): The workflow's id.

### Headers

- `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. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

## Example request

```bash
curl --request POST \
  --url 'https://connect.mindcloud.co/v2/workflows/Wq3kZ8pLx2Nb/validate' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

## Response fields

- `valid` (boolean): True when nothing blocks publishing. Warnings may remain.
- `revision` (string): The revision of the draft that was checked.
- `issues` (array of objects): Every problem found, errors first.
  - `severity` (string): error blocks publishing; warning does not.
    Allowed values:
      - `error`
      - `warning`
  - `code` (string): What is wrong, UPPER_SNAKE (SCHEDULE_INCOMPLETE, STEP_NOT_CONFIGURED, MISSING_GRAPH_REFERENCE, ...).
  - `message` (string): What is wrong, for a person.
  - `stepId` (string): The step or trigger it is about. Null for the workflow as a whole.
  - `path` (string): Where that step sits in Get Workflow Definition, as a JSON Pointer (/steps/1/body/0). Null for the workflow as a whole.
