Skip to content
Press.js Press.js Press.js Docs

Deploy & Alias Workflow

Create and manage deploys, then point an alias to a specific version for staged rollouts.

Request: POST /v1/deploys

Terminal window
curl -X POST "$PRESS_CLOUD_API/v1/deploys" \
-H "Authorization: Bearer $PRESS_CLOUD_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "my-document",
"name": "My Document"
}'

Response: 201 Created

{
"deploy": {
"id": "dpl_abc123",
"accountId": "acct_xyz",
"slug": "my-document",
"name": "My Document",
"createdAt": 1745800000000
}
}

Next: After creation, upload artifacts via an upload session. The deploy is an empty shell until a version is committed.

Error handling: A 409 with deploy_slug_conflict means the slug is already in use. Choose a different slug.

Request: PATCH /v1/deploys/{deployId}

Terminal window
curl -X PATCH "$PRESS_CLOUD_API/v1/deploys/dpl_abc123" \
-H "Authorization: Bearer $PRESS_CLOUD_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Renamed Document"
}'

Response: 200 OK

{
"deploy": {
"id": "dpl_abc123",
"accountId": "acct_xyz",
"slug": "my-document",
"name": "My Renamed Document",
"createdAt": 1745800000000
}
}

Error handling: 404 if the deploy does not exist. 409 if the requested slug is already taken.

Request: GET /v1/deploys

Terminal window
curl -H "Authorization: Bearer $PRESS_CLOUD_TOKEN" \
"$PRESS_CLOUD_API/v1/deploys"

Response: 200 OK

{
"items": [
{
"id": "dpl_abc123",
"slug": "my-document",
"name": "My Document",
"createdAt": 1745800000000
}
]
}

Paginate with the cursor query parameter (see Cursor Pagination).

Aliases (preview, production) let you route render jobs to specific versions without updating every caller.

Request: PUT /v1/deploys/{deployId}/aliases/{alias}

Terminal window
curl -X PUT "$PRESS_CLOUD_API/v1/deploys/dpl_abc123/aliases/production" \
-H "Authorization: Bearer $PRESS_CLOUD_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"deployVersionId": "dv_456"
}'

The deployVersionId can be a concrete version ID or the virtual pointer latest.

Response: 200 OK

{
"deployId": "dpl_abc123",
"alias": "production",
"deployVersionId": "dv_456",
"updatedAt": 1745800100000
}

Next: Create a render job against this alias.

Error handling: 404 if the deploy or version does not exist. The alias is updated atomically — in-flight render jobs continue using the version they were created against.