API Reference List Previews
List Previews
List a project's pull-request preview deployments.
Session token
Returns the project's pull-request previews — one record per pull request, newest first, up to 20.
Note
Any workspace member, with a session JWT. API keys are not accepted. Any plan.
Records are created by the GitHub webhooks when a pull request is opened, synchronized or reopened, and by Create Preview. When the pull request's build finishes, its record moves to deployed (with the URL the preview is served at) or failed.
Path Parameters
NameDescription
projectIdThe project ID (e.g.,
3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c).Response
NameDescription
dataPreview records, newest first. At most 20 are returned and there is no pagination.
Show 13 child attributesarray
idPreview record ID.
projectIdThe project.
prNumberPull request number. A project has one record per pull request.
prTitlePull request title.
branchThe pull request's head branch.
baseBranchThe branch the pull request targets.
null for records created before this field existed.commitShaThe head commit being previewed.
previewUrlWhere the preview is served. Records the GitHub integration creates use
https://<branch>--<subdomain>.syntext.dev; when that first label would be longer than 63 characters, the branch part is shortened and ends in a short code (for example …-page-m-e202f7--testing-docs.syntext.dev).statusbuilding, deployed, failed or expired.author{ name, login, avatarUrl } of the pull request's author, or null when unknown. login is the GitHub login. name is the display name of the workspace member who linked that GitHub account (matched case-insensitively, members of this project's workspace only — the same rule as build attribution); it falls back to the login when the author hasn't linked GitHub or isn't a member.expiresAtWhen the preview expires, if set.
createdAtISO 8601 timestamp.
updatedAtISO 8601 timestamp.
Error Responses
| Status | error.code | When |
|---|---|---|
| 401 | unauthorized | No session JWT, an invalid or expired one, or an API key |
| 401 | session_revoked | The session has been signed out |
| 403 | forbidden | You are not a member of the project's workspace |
| 404 | not_found | The project does not exist or is deleted |
Was this page helpful? Yes No
Previous
Next
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews \
-H "Authorization: Bearer $SYNTEXT_JWT"
// A browser has no environment variables: set these to your values.
const SYNTEXT_JWT = '<SYNTEXT_JWT>';
const response = await fetch('https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews', {
method: 'GET',
headers: {
'Authorization': `Bearer ${SYNTEXT_JWT}`,
},
});
const data = await response.json();
console.log(response.status, data);
import os
import requests
url = "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews"
headers = {
"Authorization": f"Bearer {os.environ['SYNTEXT_JWT']}",
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SYNTEXT_JWT"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("SYNTEXT_JWT")}"
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SYNTEXT_JWT'),
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews"))
.header("Authorization", "Bearer " + System.getenv("SYNTEXT_JWT"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer " + Environment.GetEnvironmentVariable("SYNTEXT_JWT"));
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200OK
{
"data": [
{
"id": "prv_abc123",
"projectId": "3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c",
"prNumber": 42,
"prTitle": "Document the new endpoints",
"branch": "feature/new-endpoints",
"baseBranch": "main",
"commitSha": "f6e5d4c3b2a1f6e5d4c3b2a1f6e5d4c3b2a1f6e5",
"previewUrl": "https://feature-new-endpoints--api-docs.syntext.dev",
"status": "deployed",
"author": {
"name": "Ada Lovelace",
"login": "ada",
"avatarUrl": "https://avatars.githubusercontent.com/u/1234567"
},
"expiresAt": null,
"createdAt": "2026-11-07T15:30:00Z",
"updatedAt": "2026-11-07T15:31:10Z"
}
]
}