Deployments
List Deployment Configurations
Returns a list of deployment configurations.
Query Parameters
Control what fields are being returned in the object.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
What metadata to return in the response.
How to sort the returned items. sort is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV.
Select items in collection by given conditions.
Filter by items that contain the given search query in one of their fields.
Cursor for use in pagination. Often used in combination with limit.
Responses
Unique identifier for the deployment configuration.
The deployment provider. One of vercel or netlify.
Provider-specific credentials (e.g. API token). Stored encrypted.
Provider-specific configuration options.
IDs of webhooks registered with the provider for this config.
Secret used to verify webhook payloads from the provider.
Timestamp of the last provider sync.
When this deployment config was created.
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
import { createDirectus, rest, readDeployments } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readDeployments());
{
"data": [
{
"id": "8cbb43fe-4cdf-4991-8352-c461779cec02",
"provider": "vercel",
"credentials": {
"token": "abc123"
},
"options": {
"team_id": "team_abc123"
},
"webhook_ids": []
}
],
"meta": {}
}Create Deployment Configuration
Create a new deployment provider configuration.
Query Parameters
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
The deployment provider. One of vercel or netlify.
Provider-specific credentials (e.g. API token).
Provider-specific configuration options.
Responses
Unique identifier for the deployment configuration.
The deployment provider. One of vercel or netlify.
IDs of webhooks registered with the provider for this config.
Secret used to verify webhook payloads from the provider.
Timestamp of the last provider sync.
When this deployment config was created.
import { createDirectus, rest, createDeployment } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
createDeployment({ provider: 'vercel', credentials: { token: 'abc123' } })
);
{
"data": {
"id": "8cbb43fe-4cdf-4991-8352-c461779cec02",
"provider": "vercel",
"credentials": {
"token": "abc123"
},
"options": {
"team_id": "team_abc123"
},
"webhook_ids": []
}
}Retrieve Deployment Configuration
Retrieve a deployment configuration by provider name.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Control what fields are being returned in the object.
What metadata to return in the response.
Responses
Unique identifier for the deployment configuration.
The deployment provider. One of vercel or netlify.
IDs of webhooks registered with the provider for this config.
Secret used to verify webhook payloads from the provider.
Timestamp of the last provider sync.
When this deployment config was created.
import { createDirectus, rest, readDeployment } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readDeployment('vercel'));
{
"data": {
"id": "8cbb43fe-4cdf-4991-8352-c461779cec02",
"provider": "vercel",
"credentials": {
"token": "abc123"
},
"options": {
"team_id": "team_abc123"
},
"webhook_ids": []
}
}Delete Deployment Configuration
Delete a deployment provider configuration by provider name.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Responses
import { createDirectus, rest, deleteDeployment } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
await client.request(deleteDeployment('vercel'));
Update Deployment Configuration
Update an existing deployment provider configuration.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Control what fields are being returned in the object.
What metadata to return in the response.
Request Body
Updated provider-specific credentials.
Updated provider-specific configuration options.
Responses
Unique identifier for the deployment configuration.
The deployment provider. One of vercel or netlify.
IDs of webhooks registered with the provider for this config.
Secret used to verify webhook payloads from the provider.
Timestamp of the last provider sync.
When this deployment config was created.
import { createDirectus, rest, updateDeployment } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
updateDeployment('vercel', { credentials: { token: 'new_token' } })
);
{
"data": {
"id": "8cbb43fe-4cdf-4991-8352-c461779cec02",
"provider": "vercel",
"credentials": {
"token": "abc123"
},
"options": {
"team_id": "team_abc123"
},
"webhook_ids": []
}
}Get Deployment Dashboard
Retrieve dashboard stats for all selected projects of a deployment provider. Includes latest run status per project. Defaults to the last 24 hours.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Time range for statistics. Accepts a duration string (e.g. 24h, 7d, 30m). Defaults to 24h.
Responses
Dashboard stats keyed by project, including latest deployment status and run history.
import { createDirectus, rest, readDeploymentDashboard } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readDeploymentDashboard('vercel', { range: '24h' }));
{
"data": {}
}List Deployment Projects
List all projects available from the deployment provider, merged with locally tracked project data.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Responses
Internal project UUID (null if not yet tracked).
Project ID from the deployment provider.
Project name from the provider.
Production URL for the project.
Framework detected by the provider.
Whether the project has a Git source and can trigger deployments.
Whether this project is currently tracked in Directus.
import { createDirectus, rest, readDeploymentProjects } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(readDeploymentProjects('vercel'));
{
"data": [
{
"external_id": "prj_abc123",
"name": "my-directus-app",
"url": "https://my-directus-app.vercel.app",
"framework": "nextjs",
"deployable": true,
"selected": false
}
]
}Update Selected Deployment Projects
Add or remove projects from the tracked set for this deployment provider. Automatically syncs webhooks with the updated selection.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Request Body
Projects to add to the tracked set.
Project ID from the provider.
Project name.
Internal project UUIDs to remove from the tracked set.
Responses
import { createDirectus, rest, updateDeploymentProjects } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
updateDeploymentProjects('vercel', {
create: [{ external_id: 'prj_abc123', name: 'my-app' }],
delete: ['8cbb43fe-4cdf-4991-8352-c461779cec02'],
})
);
{
"data": [
{}
]
}Retrieve Deployment Project
Retrieve details of a single tracked deployment project, including latest deployment info fetched from the provider.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Unique identifier of the tracked project.
Responses
import { createDirectus, rest, readDeploymentProject } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
readDeploymentProject('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02')
);
{
"data": {
"id": "8cbb43fe-4cdf-4991-8352-c461779cec02",
"external_id": "prj_abc123",
"name": "my-directus-app",
"url": "https://my-directus-app.vercel.app",
"framework": "nextjs",
"deployable": true,
"latest_deployment": {
"status": "ready"
}
}
}Trigger Deployment
Trigger a new deployment for a tracked project.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Unique identifier of the tracked project.
Request Body
When true, trigger a preview deployment instead of production.
When true, clears the provider's build cache before deploying.
Responses
Provider-side deployment identifier.
import { createDirectus, rest, triggerDeployment } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
triggerDeployment('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02')
);
{
"data": {
"deployment_id": "dpl_abc123",
"status": "building",
"url": "https://my-directus-app.vercel.app"
}
}List Deployment Runs
List deployment runs for a tracked project, sorted by most recent first. Defaults to the 10 most recent runs.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Unique identifier of the tracked project.
A limit on the number of objects that are returned.
How many items to skip when fetching data.
What metadata to return in the response.
Responses
Deployment target (e.g. production, preview).
User who triggered the deployment (if triggered from Directus).
Returns the total item count of the collection you're querying.
Returns the item count of the collection you're querying, taking the current filter/search parameters into account.
import { createDirectus, rest, readDeploymentRuns } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
readDeploymentRuns('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02')
);
{
"data": [
{
"external_id": "dpl_abc123",
"status": "ready",
"target": "production",
"url": "https://my-directus-app.vercel.app",
"user_created": {}
}
],
"meta": {}
}Get Deployment Run Statistics
Retrieve aggregated statistics for deployment runs of a tracked project within a time range (defaults to last 7 days).
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Unique identifier of the tracked project.
Time range for statistics. Accepts a duration string (e.g. 7d, 24h, 30m). Defaults to 7d.
Responses
Aggregated run statistics for the given time range.
import { createDirectus, rest, readDeploymentRunStats } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
readDeploymentRunStats('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02', { range: '7d' })
);
{
"data": {}
}Retrieve Deployment Run
Retrieve details and logs for a single deployment run. Supports incremental log polling via the `since` parameter.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Unique identifier of the deployment run.
ISO 8601 timestamp. When provided, only log entries after this time are returned (for incremental polling).
Responses
import { createDirectus, rest, readDeploymentRun } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
readDeploymentRun('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02')
);
{
"data": {
"status": "building",
"logs": [
{}
]
}
}Cancel Deployment Run
Cancel an in-progress deployment run.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Unique identifier of the deployment run.
Responses
Cancellation result from the provider.
import { createDirectus, rest, cancelDeployment } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(rest());
const result = await client.request(
cancelDeployment('vercel', '8cbb43fe-4cdf-4991-8352-c461779cec02')
);
{
"data": {}
}Receive Deployment Webhook
Public endpoint that receives webhook events from a deployment provider (e.g. Vercel, Netlify). Payloads are verified using a provider-specific signature before being processed. This endpoint does not require authentication - it is called by the deployment provider.
Query Parameters
The deployment provider name (e.g. vercel, netlify).
Optional token used by providers that pass secrets as query parameters instead of request headers.
Request Body
Raw webhook payload from the provider. Format is provider-specific.
Responses
// Not supported in Directus SDK