# `POST /v1/workflows`: Create a draft workflow

Creates a draft in the key's environment, checked like a save in the dashboard: known steps and options, step dependencies, minimum age, outcome overrides, score thresholds, status rules and document rules. Read GET /v1/workflows/catalog first for what can be built. A draft does not run verifications until it is published (POST /v1/workflows/{id}/publish). The response has the workflow with price_per_verification_chf and warnings: hints on a valid definition that is probably not what was meant (for example an age estimate without an ID fallback). Needs the workflows:write scope (a key issued through Connect with secuveri: the workflows:write setup right). At most 30 changes per minute per organization.

Body:
- `name` (string, required)
- `description` (string)
- `environment` (string): Optional; must be the key's environment. One of `sandbox`, `production`.
- `minimum_age` (integer, nullable): Needs identity-document.
- `ip_countries` (object, nullable)
  - `mode` (string) One of `allow`, `block`.
  - `countries` (array of string)
- `location_countries` (object, nullable): Location check: the countries the device's location must (allow) or must not (block) be in. Needs location-check.
  - `mode` (string) One of `allow`, `block`.
  - `countries` (array of string)
- `video_hours` (object, nullable): Video identification office hours; null: calls at any time. Needs video-identification.
  - `time_zone` (string): IANA time zone, such as Europe/Zurich.
  - `days` (object): mon to sun: up to three non-overlapping {from, to} times as HH:MM.
  - `closed_dates` (array of string)
- `four_eyes` (boolean)
- `outcome_overrides` (object)
- `score_thresholds` (object)
- `status_rules` (array of object)
- `steps` (array of string, required): Step ids from the catalog, in the order the person sees them.
- `step_configs` (object): Step id to {option id: boolean}, only for options that differ from their default.
- `document_rules` (array of object)

Responses:
- 201: The draft.
- 400: Invalid definition: message lists every problem, errors has them one by one.
- 401: Missing, unknown or expired API key.
- 403: The key lacks workflows:write, names another environment than its own, or was issued through Connect with secuveri without the workflows:write setup right.
- 429: More than 30 workflow changes in a minute.
