---
search:
  tags:
    - Pipelines
    - POST
seo:
  description: >-
    Adds a stage to a… Reference for the POST
    /project/{project_id}/environment/{environment_id}/pipelines/{pipeline_id}/stages
    endpoint in the Platform API.
sidebar:
  label: Create a pipeline stage
  badge: POST
title: Create a pipeline stage
type: openapi-operation
---
Adds a stage to a pipeline. Add its components with the stage component endpoints.

`POST /project/{project_id}/environment/{environment_id}/pipelines/{pipeline_id}/stages`

**Request body** (`application/json`, required)

- `name` (string, required)
- `description` (string)
- `execution_order` (integer, required)
- `on_failure` (pipeline_stage_failure_policy) — Describes how the pipeline should behave after a stage failure.

Request body example:

```json
{
  "name": "string",
  "description": "string",
  "execution_order": 1,
  "on_failure": "STOP_PIPELINE"
}
```

**Responses**

- `200` — Pipeline stage created successfully
- `default` — Error

Response example, 200:

```json
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "name": "string",
  "description": "string",
  "execution_order": 0,
  "on_failure": "STOP_PIPELINE",
  "components": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "stage_id": "f38d2b9c-0a0a-4eea-91a8-e974413bb670",
      "component_id": "41afafe5-2a48-424a-baef-34c2ad44ef7b",
      "component_kind": "Kjob",
      "is_required": true,
      "timeout_seconds": 0,
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
```
