A project's previews, newest first.
GET
/api/v1/projects/{project}/previews
const url = 'https://example.com/api/v1/projects/example/previews';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/projects/example/previewsParameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”project
required
string
Project name
Query Parameters
Section titled “Query Parameters”all
boolean
Include closed previews.
Responses
Section titled “Responses”Media typeapplication/json
Array<object>
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"}