Skip to content
GitHub

Give a preview more time.

POST
/api/v1/projects/{project}/previews/{environment}/extend
curl --request POST \
--url https://example.com/api/v1/projects/example/previews/example/extend \
--header 'Content-Type: application/json' \
--data '{ "hours": 1, "keep": true }'
project
required
string

Project name

environment
required
string

The preview’s environment

Media typeapplication/json
object
hours
required

Hours added to the lifetime (at most 30 days from now in total).

integer format: int32
keep

Keep the preview past its expiry until someone destroys it.

boolean
Examplegenerated
{
"hours": 1,
"keep": true
}
Media typeapplication/json
object
environment
required

The preview’s environment (pr<n>-<epoch>).

string
repository
required
string
pullRequest
required
integer format: int64
epoch
required
integer format: int64
headRepository
required
string
branch
required
string
commit
required
string
trusted
required

False for a fork’s preview: it gets no secrets.

boolean
state
required

active or closed.

string
autoDelete
required
boolean
expiresAt
required
string
remainingSeconds
required

Seconds until it expires (0 once it has).

integer format: int64
createdAt
required
string
closedAt
string | null
closeReason

closed, expired, manual or deleted.

string | null
Examplegenerated
{
"environment": "example",
"repository": "example",
"pullRequest": 1,
"epoch": 1,
"headRepository": "example",
"branch": "example",
"commit": "example",
"trusted": true,
"state": "example",
"autoDelete": true,
"expiresAt": "example",
"remainingSeconds": 1,
"createdAt": "example",
"closedAt": "example",
"closeReason": "example"
}
Media typeapplication/json

Problem Details body.

object
code
required

Stable machine-readable code, e.g. forbidden.

string
title
required

Short human readable title.

string
status
required

HTTP status.

integer format: int32
detail

Details, if safe to expose.

string | null
Example
{
"code": "forbidden"
}