# Create a workflow
**POST /api/workflows/workflow**
**Spaces method and path for this operation:**
post /s/{space_id}/api/workflows/workflow
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
Create a new workflow from a YAML definition. The YAML is validated and parsed before the workflow is saved. An optional custom ID can be provided.
[Required authorization] Route required privileges: workflowsManagement:create.
## Servers
- https://localhost:5601: https://localhost:5601 ()
## Authentication methods
- Api key auth
- Basic auth
## Parameters
### Headers
- **kbn-xsrf** (string)
A required header to protect against CSRF attacks
### Body: application/json (object)
- **id** (string)
- **yaml** (string)
## Responses
### 200
Indicates a successful response
[Powered by Bump.sh](https://bump.sh)