Skip to main content
POST
/
pipelines
/
{id}
/
stages
Create pipeline stage
curl --request POST \
  --url https://api.sevalla.com/v3/pipelines/{id}/stages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "display_name": "Staging",
  "insert_before": 2,
  "branch": "staging"
}
'
{
  "id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
  "pipeline_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
  "display_name": "Production",
  "type": "standard",
  "order": 1,
  "branch": "main",
  "auto_create_app": false,
  "delete_stale_apps": false,
  "stale_app_days": 5,
  "created_at": "2025-01-30T00:00:00.000Z",
  "updated_at": "2025-01-30T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string<uuid>
required

Pipeline identifier

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

Body

application/json
display_name
string
required

Human-readable name for the new stage

Required string length: 1 - 255
Example:

"Staging"

insert_before
integer
required

Position to insert the stage at. Existing stages at this position and above are shifted up.

Required range: 0 <= x <= 50
Example:

2

branch
string | null

Git branch to associate with this stage. Used in branch-type pipelines.

Example:

"staging"

Response

Default Response

id
string<uuid>
required

Unique identifier for the pipeline stage

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

pipeline_id
string<uuid>
required

Identifier of the pipeline this stage belongs to

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

display_name
string
required

Human-readable name for the stage shown in the dashboard

Example:

"Production"

type
enum<string>
required

Stage type. standard - regular deployment stage. prod - production stage. preview - ephemeral preview environment stage for pull request previews.

Available options:
preview,
standard,
prod
Example:

"standard"

order
integer
required

Position of the stage in the pipeline, starting from 0. Lower numbers appear first.

Required range: 0 <= x <= 50
Example:

1

branch
string | null
required

Git branch associated with this stage. Used to filter deployments by branch.

Example:

"main"

auto_create_app
boolean
required

Whether to automatically create a preview app when a pull request is opened. Only applies to preview stages.

Example:

false

delete_stale_apps
boolean
required

Whether to automatically delete preview apps that have not been deployed for longer than the stale app threshold. Only applies to preview stages.

Example:

false

stale_app_days
integer
required

Number of days after the last deployment before a preview app is considered stale and eligible for automatic deletion. Only applies when delete_stale_apps is enabled.

Required range: 1 <= x <= 365
Example:

5

created_at
string<date-time>
required

Timestamp when the stage was created, in ISO 8601 format

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2025-01-30T00:00:00.000Z"

updated_at
string<date-time>
required

Timestamp when the stage was last modified, in ISO 8601 format

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2025-01-30T00:00:00.000Z"