Give a preview more time.
POST
/api/v1/projects/{project}/previews/{environment}/extend
const url = 'https://example.com/api/v1/projects/example/previews/example/extend';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"hours":1,"keep":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/projects/example/previews/example/extend \ --header 'Content-Type: application/json' \ --data '{ "hours": 1, "keep": true }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”project
required
string
Project name
environment
required
string
The preview’s environment
Request Bodyrequired
Section titled “Request Bodyrequired”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}Responses
Section titled “Responses”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"}