deployments
Create a new deployment
Endpoints
- access-groups
- artifacts
- checks
- projects
- deployments
- domains
- dns
- logDrains
- edge-config
- user
- marketplace
- integrations
- authentication
- projectMembers
- environment
- security
- teams
- webhooks
- aliases
- certs
deployments
Create a new deployment
Create a new deployment with all the required and intended data. If the deployment is not a git deployment, all files must be provided with the request, either referenced or inlined. Additionally, a deployment id can be specified to redeploy a previous deployment.
POST
/
v13
/
deployments
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.deployments.createDeployment({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
deploymentId: "dpl_2qn7PZrx89yxY34vEZPD31Y9XVj6",
files: [
{
file: "folder/file.js",
},
{
file: "folder/file.js",
},
],
gitMetadata: {
remoteUrl: "https://github.com/vercel/next.js",
commitAuthorName: "kyliau",
commitMessage: "add method to measure Interaction to Next Paint (INP) (#36490)",
commitRef: "main",
commitSha: "dc36199b2234c6586ebe05ec94078a895c707e29",
dirty: true,
},
gitSource: {
ref: "main",
repoId: 123456789,
sha: "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
type: "github",
},
meta: {
"foo": "bar",
},
name: "my-instant-deployment",
project: "my-deployment-project",
projectSettings: {
buildCommand: "next build",
installCommand: "pnpm install",
},
target: "production",
},
});
// Handle the result
console.log(result);
}
run();
{
"aliasAssignedAt": 123,
"alwaysRefuseToBuild": true,
"build": {
"env": [
"<string>"
]
},
"buildArtifactUrls": [
"<string>"
],
"builds": [
{
"use": "<string>",
"src": "<string>",
"config": {}
}
],
"env": [
"<string>"
],
"inspectorUrl": "<string>",
"isInConcurrentBuildsQueue": true,
"isInSystemBuildsQueue": true,
"projectSettings": {
"buildCommand": "<string>",
"commandForIgnoringBuildStep": "<string>",
"devCommand": "<string>",
"framework": "blitzjs",
"installCommand": "<string>",
"outputDirectory": "<string>",
"speedInsights": {
"id": "<string>",
"enabledAt": 123,
"disabledAt": 123,
"canceledAt": 123,
"hasData": true,
"paidAt": 123
},
"webAnalytics": {
"id": "<string>",
"disabledAt": 123,
"canceledAt": 123,
"enabledAt": 123,
"hasData": true
}
},
"readyStateReason": "<string>",
"integrations": {
"status": "error",
"startedAt": 123,
"completedAt": 123,
"skippedAt": 123,
"skippedBy": "<string>"
},
"images": {
"sizes": [
123
],
"qualities": [
123
],
"domains": [
"<string>"
],
"remotePatterns": [
{
"protocol": "http",
"hostname": "<string>",
"port": "<string>",
"pathname": "<string>",
"search": "<string>"
}
],
"localPatterns": [
{
"pathname": "<string>",
"search": "<string>"
}
],
"minimumCacheTTL": 123,
"formats": [
"image/avif"
],
"dangerouslyAllowSVG": true,
"contentSecurityPolicy": "<string>",
"contentDispositionType": "inline"
},
"alias": [
"<string>"
],
"aliasAssigned": true,
"bootedAt": 123,
"buildingAt": 123,
"buildContainerFinishedAt": 123,
"buildSkipped": true,
"creator": {
"uid": "<string>",
"username": "<string>",
"avatar": "<string>"
},
"initReadyAt": 123,
"isFirstBranchDeployment": true,
"lambdas": [
{
"id": "<string>",
"createdAt": 123,
"entrypoint": "<string>",
"readyState": "BUILDING",
"readyStateAt": 123,
"output": [
{
"path": "<string>",
"functionName": "<string>"
}
]
}
],
"public": true,
"ready": 123,
"status": "CANCELED",
"team": {
"name": "<string>",
"id": "<string>",
"slug": "<string>",
"avatar": "<string>"
},
"userAliases": [
"<string>"
],
"previewCommentsEnabled": true,
"ttyBuildLogs": true,
"customEnvironment": {
"id": "<string>",
"slug": "<string>",
"type": "production",
"description": "<string>",
"branchMatcher": {
"type": "startsWith",
"pattern": "<string>"
},
"domains": [
{
"name": "<string>",
"apexName": "<string>",
"projectId": "<string>",
"redirect": "<string>",
"redirectStatusCode": 307,
"gitBranch": "<string>",
"customEnvironmentId": "<string>",
"updatedAt": 123,
"createdAt": 123,
"verified": true,
"verification": [
{
"type": "<string>",
"domain": "<string>",
"value": "<string>",
"reason": "<string>"
}
]
}
],
"currentDeploymentAliases": [
"<string>"
],
"createdAt": 123,
"updatedAt": 123
},
"type": "LAMBDAS",
"name": "<string>",
"createdAt": 123,
"deletedAt": 123,
"id": "<string>",
"version": 2,
"autoAssignCustomDomains": true,
"gitSource": {
"type": "github",
"repoId": "<string>",
"ref": "<string>",
"sha": "<string>",
"prId": 123
},
"meta": {},
"project": {
"id": "<string>",
"name": "<string>",
"framework": "<string>"
},
"readyState": "CANCELED",
"source": "cli",
"target": "production",
"passiveRegions": [
"<string>"
],
"regions": [
"<string>"
],
"errorMessage": "<string>",
"aliasWarning": {
"code": "<string>",
"message": "<string>",
"link": "<string>",
"action": "<string>"
},
"aliasError": {
"code": "<string>",
"message": "<string>"
},
"aliasFinal": "<string>",
"automaticAliases": [
"<string>"
],
"buildErrorAt": 123,
"checksState": "registered",
"checksConclusion": "succeeded",
"defaultRoute": "<string>",
"canceledAt": 123,
"errorCode": "<string>",
"errorLink": "<string>",
"errorStep": "<string>",
"originCacheRegion": "<string>",
"readySubstate": "STAGED",
"softDeletedByRetention": true,
"undeletedAt": 123,
"url": "<string>",
"oidcTokenClaims": {
"iss": "<string>",
"sub": "<string>",
"scope": "<string>",
"aud": "<string>",
"owner": "<string>",
"owner_id": "<string>",
"project": "<string>",
"project_id": "<string>",
"environment": "<string>"
},
"plan": "pro",
"projectId": "<string>",
"ownerId": "<string>",
"microfrontends": {
"isDefaultApp": true,
"defaultRoute": "<string>",
"groupIds": [
"<string>"
]
},
"monorepoManager": "<string>",
"config": {
"version": 123,
"functionType": "fluid",
"functionMemoryType": "standard",
"functionTimeout": 123,
"secureComputePrimaryRegion": "<string>",
"secureComputeFallbackRegion": "<string>"
},
"functions": {},
"routes": [
{
"src": "<string>",
"dest": "<string>",
"headers": {},
"methods": [
"<string>"
],
"continue": true,
"override": true,
"caseSensitive": true,
"check": true,
"important": true,
"status": 123,
"has": [
{
"type": "host",
"value": "<string>"
}
],
"missing": [
{
"type": "host",
"value": "<string>"
}
],
"locale": {
"redirect": {},
"cookie": "<string>"
},
"middlewarePath": "<string>",
"middlewareRawSrc": [
"<string>"
],
"middleware": 123
}
],
"crons": [
{
"schedule": "<string>",
"path": "<string>"
}
],
"connectBuildsEnabled": true,
"connectConfigurationId": "<string>",
"createdIn": "<string>",
"passiveConnectConfigurationId": "<string>",
"gitRepo": {
"namespace": "<string>",
"projectId": 123,
"type": "gitlab",
"url": "<string>",
"path": "<string>",
"defaultBranch": "<string>",
"name": "<string>",
"private": true,
"ownerType": "team"
},
"flags": {
"definitions": {}
}
}
Authorizations
Default authentication mechanism
Query Parameters
Forces a new deployment even if there is a previous similar deployment
Available options:
0
, 1
Allows to skip framework detection so the API would not fail to ask for confirmation
Available options:
0
, 1
The Team identifier to perform the request on behalf of.
Example:
"team_1a2b3c4d5e6f7g8h9i0j1k2l"
The Team slug to perform the request on behalf of.
Example:
"my-team-url-slug"
Body
application/json
Response
200
application/json
The successfully created deployment
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.deployments.createDeployment({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
deploymentId: "dpl_2qn7PZrx89yxY34vEZPD31Y9XVj6",
files: [
{
file: "folder/file.js",
},
{
file: "folder/file.js",
},
],
gitMetadata: {
remoteUrl: "https://github.com/vercel/next.js",
commitAuthorName: "kyliau",
commitMessage: "add method to measure Interaction to Next Paint (INP) (#36490)",
commitRef: "main",
commitSha: "dc36199b2234c6586ebe05ec94078a895c707e29",
dirty: true,
},
gitSource: {
ref: "main",
repoId: 123456789,
sha: "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
type: "github",
},
meta: {
"foo": "bar",
},
name: "my-instant-deployment",
project: "my-deployment-project",
projectSettings: {
buildCommand: "next build",
installCommand: "pnpm install",
},
target: "production",
},
});
// Handle the result
console.log(result);
}
run();
{
"aliasAssignedAt": 123,
"alwaysRefuseToBuild": true,
"build": {
"env": [
"<string>"
]
},
"buildArtifactUrls": [
"<string>"
],
"builds": [
{
"use": "<string>",
"src": "<string>",
"config": {}
}
],
"env": [
"<string>"
],
"inspectorUrl": "<string>",
"isInConcurrentBuildsQueue": true,
"isInSystemBuildsQueue": true,
"projectSettings": {
"buildCommand": "<string>",
"commandForIgnoringBuildStep": "<string>",
"devCommand": "<string>",
"framework": "blitzjs",
"installCommand": "<string>",
"outputDirectory": "<string>",
"speedInsights": {
"id": "<string>",
"enabledAt": 123,
"disabledAt": 123,
"canceledAt": 123,
"hasData": true,
"paidAt": 123
},
"webAnalytics": {
"id": "<string>",
"disabledAt": 123,
"canceledAt": 123,
"enabledAt": 123,
"hasData": true
}
},
"readyStateReason": "<string>",
"integrations": {
"status": "error",
"startedAt": 123,
"completedAt": 123,
"skippedAt": 123,
"skippedBy": "<string>"
},
"images": {
"sizes": [
123
],
"qualities": [
123
],
"domains": [
"<string>"
],
"remotePatterns": [
{
"protocol": "http",
"hostname": "<string>",
"port": "<string>",
"pathname": "<string>",
"search": "<string>"
}
],
"localPatterns": [
{
"pathname": "<string>",
"search": "<string>"
}
],
"minimumCacheTTL": 123,
"formats": [
"image/avif"
],
"dangerouslyAllowSVG": true,
"contentSecurityPolicy": "<string>",
"contentDispositionType": "inline"
},
"alias": [
"<string>"
],
"aliasAssigned": true,
"bootedAt": 123,
"buildingAt": 123,
"buildContainerFinishedAt": 123,
"buildSkipped": true,
"creator": {
"uid": "<string>",
"username": "<string>",
"avatar": "<string>"
},
"initReadyAt": 123,
"isFirstBranchDeployment": true,
"lambdas": [
{
"id": "<string>",
"createdAt": 123,
"entrypoint": "<string>",
"readyState": "BUILDING",
"readyStateAt": 123,
"output": [
{
"path": "<string>",
"functionName": "<string>"
}
]
}
],
"public": true,
"ready": 123,
"status": "CANCELED",
"team": {
"name": "<string>",
"id": "<string>",
"slug": "<string>",
"avatar": "<string>"
},
"userAliases": [
"<string>"
],
"previewCommentsEnabled": true,
"ttyBuildLogs": true,
"customEnvironment": {
"id": "<string>",
"slug": "<string>",
"type": "production",
"description": "<string>",
"branchMatcher": {
"type": "startsWith",
"pattern": "<string>"
},
"domains": [
{
"name": "<string>",
"apexName": "<string>",
"projectId": "<string>",
"redirect": "<string>",
"redirectStatusCode": 307,
"gitBranch": "<string>",
"customEnvironmentId": "<string>",
"updatedAt": 123,
"createdAt": 123,
"verified": true,
"verification": [
{
"type": "<string>",
"domain": "<string>",
"value": "<string>",
"reason": "<string>"
}
]
}
],
"currentDeploymentAliases": [
"<string>"
],
"createdAt": 123,
"updatedAt": 123
},
"type": "LAMBDAS",
"name": "<string>",
"createdAt": 123,
"deletedAt": 123,
"id": "<string>",
"version": 2,
"autoAssignCustomDomains": true,
"gitSource": {
"type": "github",
"repoId": "<string>",
"ref": "<string>",
"sha": "<string>",
"prId": 123
},
"meta": {},
"project": {
"id": "<string>",
"name": "<string>",
"framework": "<string>"
},
"readyState": "CANCELED",
"source": "cli",
"target": "production",
"passiveRegions": [
"<string>"
],
"regions": [
"<string>"
],
"errorMessage": "<string>",
"aliasWarning": {
"code": "<string>",
"message": "<string>",
"link": "<string>",
"action": "<string>"
},
"aliasError": {
"code": "<string>",
"message": "<string>"
},
"aliasFinal": "<string>",
"automaticAliases": [
"<string>"
],
"buildErrorAt": 123,
"checksState": "registered",
"checksConclusion": "succeeded",
"defaultRoute": "<string>",
"canceledAt": 123,
"errorCode": "<string>",
"errorLink": "<string>",
"errorStep": "<string>",
"originCacheRegion": "<string>",
"readySubstate": "STAGED",
"softDeletedByRetention": true,
"undeletedAt": 123,
"url": "<string>",
"oidcTokenClaims": {
"iss": "<string>",
"sub": "<string>",
"scope": "<string>",
"aud": "<string>",
"owner": "<string>",
"owner_id": "<string>",
"project": "<string>",
"project_id": "<string>",
"environment": "<string>"
},
"plan": "pro",
"projectId": "<string>",
"ownerId": "<string>",
"microfrontends": {
"isDefaultApp": true,
"defaultRoute": "<string>",
"groupIds": [
"<string>"
]
},
"monorepoManager": "<string>",
"config": {
"version": 123,
"functionType": "fluid",
"functionMemoryType": "standard",
"functionTimeout": 123,
"secureComputePrimaryRegion": "<string>",
"secureComputeFallbackRegion": "<string>"
},
"functions": {},
"routes": [
{
"src": "<string>",
"dest": "<string>",
"headers": {},
"methods": [
"<string>"
],
"continue": true,
"override": true,
"caseSensitive": true,
"check": true,
"important": true,
"status": 123,
"has": [
{
"type": "host",
"value": "<string>"
}
],
"missing": [
{
"type": "host",
"value": "<string>"
}
],
"locale": {
"redirect": {},
"cookie": "<string>"
},
"middlewarePath": "<string>",
"middlewareRawSrc": [
"<string>"
],
"middleware": 123
}
],
"crons": [
{
"schedule": "<string>",
"path": "<string>"
}
],
"connectBuildsEnabled": true,
"connectConfigurationId": "<string>",
"createdIn": "<string>",
"passiveConnectConfigurationId": "<string>",
"gitRepo": {
"namespace": "<string>",
"projectId": 123,
"type": "gitlab",
"url": "<string>",
"path": "<string>",
"defaultBranch": "<string>",
"name": "<string>",
"private": true,
"ownerType": "team"
},
"flags": {
"definitions": {}
}
}