API reference
Deployments
Trigger Netlify deploys for an app, list past deploys, and check deploy status. Requires deploy scope.
#The Deployment object
| Field | Type | Description |
|---|---|---|
| id | string | dep_xxx |
| appId | string | |
| provider | "netlify" | Currently only Netlify is supported. |
| siteName | string | The Netlify site name (subdomain). |
| url | string | Live URL on success. |
| status | "queued"|"building"|"uploading"|"live"|"failed" | |
| logsUrl | string | null | Netlify logs URL. |
| createdAt | ISO 8601 | |
| completedAt | ISO 8601 | null |
#Create a deployment
POST/v1/deployments
| Field | Type | Description |
|---|---|---|
| appIdrequired | string | App to deploy. |
| siteName | string | Reuse an existing site by name. Creates a new one if omitted. |
| provider | "netlify" | Defaults to "netlify". |
const deploy = await client.deployments.create({
appId: 'app_abc',
});
console.log('queued:', deploy.id);
// Poll or subscribe to webhook
const final = await client.deployments.waitFor(deploy.id);
console.log('live at', final.url);#Get a deployment
GET/v1/deployments/:id
#List deployments for an app
GET/v1/apps/:appId/deployments
#Deploy events via webhooks
Subscribe to deployment.queued, deployment.building, deployment.live, and deployment.failed for push delivery.
See Event types.
#Where to go next
PromptFloe developer docs