Search Documentation

Search for a documentation page...

Publish API

REST API endpoints for triggering and monitoring store deployments.

Trigger a production deployment of your store programmatically — the API equivalent of the admin Publish button. Only stores with platform-managed deployments can use these endpoints.

Trigger Publish

POST /api/v1/publish

Starts a production build and deployment of the store's main branch. Returns 202 immediately — poll GET /api/v1/publish/{deploymentId} to track progress.

This endpoint requires the store API key (sk-...). OAuth tokens are not accepted and will receive a 403.

curl -X POST \
-H "Authorization: Bearer sk_your_api_key" \
https://your-store.yns.store/api/v1/publish

Response (202)

{
"deploymentId": "dpl_abc123",
"deploymentUrl": "store-abc123.vercel.app",
"inspectorUrl": "https://vercel.com/..."
}
FieldTypeDescription
deploymentIdstringDeployment identifier (use to poll status)
deploymentUrlstring | nullPreview URL for the deployment
inspectorUrlstring | nullVercel inspector URL for build details

Errors

StatusDescription
400Store does not have a platform-managed deployment
403Publishing requires the store API key (OAuth tokens are rejected)
404Store not found

Get Publish Status

GET /api/v1/publish/:deploymentIdOrUrl

Returns the current status of a deployment started via POST /api/v1/publish. Only deployments belonging to the authenticated store are visible.

Path Parameters

ParameterTypeDescription
deploymentIdOrUrlstringDeployment ID (dpl_...) or URL from the publish response
curl -H "Authorization: Bearer sk_your_api_key" \
https://your-store.yns.store/api/v1/publish/dpl_abc123

Response (200)

{
"id": "dpl_abc123",
"url": "store-abc123.vercel.app",
"readyState": "BUILDING"
}
FieldTypeDescription
idstringDeployment identifier
urlstring | nullDeployment URL
readyStatestringCurrent state of the deployment

Ready States

StateDescription
QUEUEDDeployment is queued and waiting to start
BUILDINGBuild is in progress
INITIALIZINGBuild finished, deployment is initializing
READYDeployment is live (terminal)
ERRORBuild or deployment failed (terminal)
CANCELEDDeployment was canceled (terminal)

Poll this endpoint until readyState reaches a terminal state (READY, ERROR, or CANCELED).

Errors

StatusDescription
400Store does not have a platform-managed deployment
404Deployment not found or does not belong to this store