/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Update Preview Status

Update Preview Status

Set the status of a pull-request preview record.

PATCH/v1/projects/{projectId}/previews/{previewId}Try it
Session token

Set a preview record's status — for example to mark it expired once the pull request closes.

Note

Any workspace member, with a session JWT. API keys are not accepted. Any plan.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID (e.g., 3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c).
previewId:stringpathRequired
The preview record ID (e.g., prv_abc123).

Request Body

NameDescription
status:stringbodyRequired
deployed, failed or expired.

Response

Returns { "success": true }. The update only applies to a record of this project. A previewId that does not exist, or belongs to another project, changes nothing and still returns 200. Setting expired also deletes that preview's search index.

Error Responses

Statuserror.codeWhen
400validation_errorstatus is missing or not one of the three values; each problem is in details.issues — see Create Preview
401unauthorizedNo session JWT, an invalid or expired one, or an API key
401session_revokedThe session has been signed out
403forbiddenYou are not a member of the project's workspace
404not_foundThe project does not exist or is deleted
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X PATCH https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/previews/prv_abc123 \
-H "Authorization: Bearer $SYNTEXT_JWT" \
-H "Content-Type: application/json" \
-d '{ "status": "expired" }'
Responseapplication/json
200OK
{
"success": true
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext