Reference
7 min read
patch/v12/deployments/{id}/cancel

This endpoint allows you to cancel a deployment which is currently building, by supplying its id in the URL.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v12/deployments/dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd/cancel?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "patch"
6
})
Path Params
Query Params
Path ParameterDescription

id

string

required
The unique identifier of the deployment.
Example:dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd
  • aliasarrayRequired
    A list of all the aliases (default aliases, staging aliases and production aliases) that were assigned upon deployment creation

    Example: []

  • aliasAssignedbooleanRequired
    A boolean that will be true when the aliases from the alias property were assigned successfully

    Example: true

  • aliasAssignedAtOne of the following objects or null
  • One of
  • aliasErrorobject or null
    An object that will contain a code and a message when the aliasing fails, otherwise the value will be null
  • Properties
  • aliasFinalstring or null
  • aliasWarningobject or null
  • Properties
  • autoAssignCustomDomainsboolean
  • automaticAliasesarray
  • bootedAtnumberRequired
  • buildobjectRequired
  • Properties
  • buildErrorAtnumber
  • buildingAtnumberRequired
  • buildsarray
  • canceledAtnumber
  • checksConclusionstring
    One of: succeeded | failed | skipped | canceled
  • checksStatestring
    One of: registered | running | completed
  • connectBuildsEnabledboolean
    The flag saying if Vercel Connect configuration is used for builds
  • connectConfigurationIdstring
    The ID of Vercel Connect configuration used for this deployment
  • createdAtnumberRequired
    A number containing the date when the deployment was created in milliseconds

    Example: 1540257589405

  • createdInstringRequired
    The region where the deployment was first created

    Example: sfo1

  • creatorobjectRequired
    Information about the deployment creator
  • Properties
  • cronsarray
    The cron jobs associated with this deployment. Note that preview deployments are also allowed to have this property, but only production deployments create cron jobs. If a preview deployment is promoted to production, only then they'll take effect.

    Example: [{"schedule":"* * * * *","path":"/api/cron"}]

  • Properties
  • envarrayRequired
    The keys of the environment variables that were assigned during runtime

    Example: ["MY_SECRET"]

  • errorCodestring
  • errorLinkstring
  • errorMessagestring or null
  • errorStepstring
  • functionsobject or null
    An object used to configure your Serverless Functions

    Example: {"api/test.js":{"memory":3008}}

  • gitRepoOne of the following objects or null
  • One of
  • gitSourceOne of the following objects
  • One of
  • idstringRequired
    A string holding the unique ID of the deployment

    Example: dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ

  • inspectorUrlstring or nullRequired
    Vercel URL to inspect the deployment.

    Example: https://vercel.com/acme/nextjs/J1hXN00qjUeoYfpEEf7dnDtpSiVq

  • isInConcurrentBuildsQueuebooleanRequired
    Is the deployment currently queued waiting for a Concurrent Build Slot to be available
  • lambdasarray
  • Properties
  • metaobjectRequired
    An object containing the deployment's metadata

    Example: {"foo":"bar"}

  • monorepoManagerstring or null
    An monorepo manager that was used for the deployment

    Example: turbo

  • namestringRequired
    The name of the project associated with the deployment at the time that the deployment was created

    Example: my-project

  • ownerIdstringRequired
    The unique ID of the user or team the deployment belongs to

    Example: ZspSRT4ljIEEmMHgoDwKWDei

  • passiveConnectConfigurationIdstring
    The connect configuration ID used to deploy passive lambdas into for secure compute enabled deployments.
  • passiveRegionsarray
  • planstringRequired
    One of: pro | enterprise | hobby
    The pricing plan the deployment was made under

    Example: pro

  • previewCommentsEnabledboolean
    Whether or not preview comments are enabled for the deployment
  • projectobject
    The public project information associated with the deployment.
  • Properties
  • projectIdstringRequired
    The ID of the project the deployment is associated with

    Example: prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB

  • publicbooleanRequired
    A boolean representing if the deployment is public or not. By default this is false
  • readyStatestringRequired
    One of: INITIALIZING | BUILDING | READY | ERROR | QUEUED | CANCELED
    The state of the deployment depending on the process of deploying, or if it is ready or in an error state

    Example: READY

  • readySubstatestring
    One of: STAGED | PROMOTED
    The substate of the deployment when the state is "READY"

    Example: STAGED

  • regionsarrayRequired
    The regions the deployment exists in

    Example: ["sfo1"]

  • routesarray or nullRequired
    A list of routes objects used to rewrite paths to point towards other internal or external paths

    Example: [{"src":"/docs","dest":"https://docs.example.com"}]

  • One of:

  • Properties
  • Properties
  • Properties
  • sourcestring
    One of: api-trigger-git-deploy | cli | clone/repo | git | import | import/repo
    Where was the deployment created from

    Example: cli

  • targetstring or null
    One of: staging | production
    If defined, either staging if a staging alias in the format <project>.<team>.now.sh was assigned upon creation, or production if the aliases from alias were assigned
  • teamobject
    The team that owns the deployment if any
  • Properties
  • typestringRequired
    One of: LAMBDAS
  • urlstringRequired
    A string with the unique URL of the deployment

    Example: my-instant-deployment-3ij3cxz9qr.now.sh

  • userAliasesarray
    An array of domains that were provided by the user when creating the Deployment.

    Example: ["sub1.example.com","sub2.example.com"]

  • versionnumberRequired
    One of: 2
    The platform version that was used to create the deployment.

    Example: 2

CodeDescription
200
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
post/v13/deployments

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.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v13/deployments?forceNew=0&skipAutoDetectionConfirmation=0&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"body": {
3
"name": "my-instant-deployment",
4
"deploymentId": "SOME_STRING_VALUE",
5
"files": [
6
{
7
"InlinedFile": {
8
"data": "SOME_STRING_VALUE",
9
"encoding": "base64",
10
"file": "folder/file.js"
11
}
12
}
13
],
14
"gitMetadata": {
15
"remoteUrl": "https://github.com/vercel/next.js",
16
"commitAuthorName": "kyliau",
17
"commitMessage": "add method to measure Interaction to Next Paint (INP) (#36490)",
18
"commitRef": "main",
19
"commitSha": "dc36199b2234c6586ebe05ec94078a895c707e29",
20
"dirty": true
21
},
22
"gitSource": {
23
"ref": "SOME_STRING_VALUE",
24
"repoId": "",
25
"sha": "SOME_STRING_VALUE",
26
"type": "github"
27
},
28
"meta": "{foo:bar}",
29
"monorepoManager": "SOME_STRING_VALUE",
30
"project": "my-deployment-project",
31
"projectSettings": {
32
"buildCommand": "SOME_STRING_VALUE",
33
"commandForIgnoringBuildStep": "SOME_STRING_VALUE",
34
"devCommand": "SOME_STRING_VALUE",
35
"framework": "blitzjs",
36
"installCommand": "SOME_STRING_VALUE",
37
"nodeVersion": "20.x",
38
"outputDirectory": "SOME_STRING_VALUE",
39
"rootDirectory": "SOME_STRING_VALUE",
40
"serverlessFunctionRegion": "SOME_STRING_VALUE",
41
"skipGitConnectDuringLink": true,
42
"sourceFilesOutsideRootDirectory": true
43
},
44
"target": "staging",
45
"withLatestCommit": true
46
},
47
"headers": {
48
"Authorization": "Bearer <TOKEN>"
49
},
50
"method": "post"
51
})
Query Params
Body Params
Query ParameterDescription

forceNew

string of the following

Forces a new deployment even if there is a previous similar deployment
Allowed values:01

skipAutoDetectionConfirmation

string of the following

Allows to skip framework detection so the API would not fail to ask for confirmation
Allowed values:01

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.

The successfully created deployment

  • aliasarrayRequired
    A list of all the aliases (default aliases, staging aliases and production aliases) that were assigned upon deployment creation

    Example: []

  • aliasAssignedbooleanRequired
    A boolean that will be true when the aliases from the alias property were assigned successfully

    Example: true

  • aliasAssignedAtOne of the following objects or null
  • One of
  • aliasErrorobject or null
    An object that will contain a code and a message when the aliasing fails, otherwise the value will be null
  • Properties
  • aliasFinalstring or null
  • aliasWarningobject or null
  • Properties
  • autoAssignCustomDomainsboolean
  • automaticAliasesarray
  • bootedAtnumberRequired
  • buildobjectRequired
  • Properties
  • buildErrorAtnumber
  • buildingAtnumberRequired
  • buildsarray
  • canceledAtnumber
  • checksConclusionstring
    One of: succeeded | failed | skipped | canceled
  • checksStatestring
    One of: registered | running | completed
  • connectBuildsEnabledboolean
    The flag saying if Vercel Connect configuration is used for builds
  • connectConfigurationIdstring
    The ID of Vercel Connect configuration used for this deployment
  • createdAtnumberRequired
    A number containing the date when the deployment was created in milliseconds

    Example: 1540257589405

  • createdInstringRequired
    The region where the deployment was first created

    Example: sfo1

  • creatorobjectRequired
    Information about the deployment creator
  • Properties
  • cronsarray
    The cron jobs associated with this deployment. Note that preview deployments are also allowed to have this property, but only production deployments create cron jobs. If a preview deployment is promoted to production, only then they'll take effect.

    Example: [{"schedule":"* * * * *","path":"/api/cron"}]

  • Properties
  • envarrayRequired
    The keys of the environment variables that were assigned during runtime

    Example: ["MY_SECRET"]

  • errorCodestring
  • errorLinkstring
  • errorMessagestring or null
  • errorStepstring
  • functionsobject or null
    An object used to configure your Serverless Functions

    Example: {"api/test.js":{"memory":3008}}

  • gitRepoOne of the following objects or null
  • One of
  • gitSourceOne of the following objects
  • One of
  • idstringRequired
    A string holding the unique ID of the deployment

    Example: dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ

  • inspectorUrlstring or nullRequired
    Vercel URL to inspect the deployment.

    Example: https://vercel.com/acme/nextjs/J1hXN00qjUeoYfpEEf7dnDtpSiVq

  • isInConcurrentBuildsQueuebooleanRequired
    Is the deployment currently queued waiting for a Concurrent Build Slot to be available
  • lambdasarray
  • Properties
  • metaobjectRequired
    An object containing the deployment's metadata

    Example: {"foo":"bar"}

  • monorepoManagerstring or null
    An monorepo manager that was used for the deployment

    Example: turbo

  • namestringRequired
    The name of the project associated with the deployment at the time that the deployment was created

    Example: my-project

  • ownerIdstringRequired
    The unique ID of the user or team the deployment belongs to

    Example: ZspSRT4ljIEEmMHgoDwKWDei

  • passiveConnectConfigurationIdstring
    The connect configuration ID used to deploy passive lambdas into for secure compute enabled deployments.
  • passiveRegionsarray
  • planstringRequired
    One of: pro | enterprise | hobby
    The pricing plan the deployment was made under

    Example: pro

  • previewCommentsEnabledboolean
    Whether or not preview comments are enabled for the deployment
  • projectobject
    The public project information associated with the deployment.
  • Properties
  • projectIdstringRequired
    The ID of the project the deployment is associated with

    Example: prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB

  • publicbooleanRequired
    A boolean representing if the deployment is public or not. By default this is false
  • readyStatestringRequired
    One of: CANCELED | ERROR | QUEUED | BUILDING | INITIALIZING | READY
    The state of the deployment depending on the process of deploying, or if it is ready or in an error state

    Example: READY

  • readySubstatestring
    One of: STAGED | PROMOTED
    The substate of the deployment when the state is "READY"

    Example: STAGED

  • regionsarrayRequired
    The regions the deployment exists in

    Example: ["sfo1"]

  • routesarray or nullRequired
    A list of routes objects used to rewrite paths to point towards other internal or external paths

    Example: [{"src":"/docs","dest":"https://docs.example.com"}]

  • One of:

  • Properties
  • Properties
  • Properties
  • sourcestring
    One of: cli | git | import | import/repo | clone/repo | api-trigger-git-deploy
    Where was the deployment created from

    Example: cli

  • targetstring or null
    One of: staging | production
    If defined, either staging if a staging alias in the format <project>.<team>.now.sh was assigned upon creation, or production if the aliases from alias were assigned
  • teamobject
    The team that owns the deployment if any
  • Properties
  • typestringRequired
    One of: LAMBDAS
  • urlstringRequired
    A string with the unique URL of the deployment

    Example: my-instant-deployment-3ij3cxz9qr.now.sh

  • userAliasesarray
    An array of domains that were provided by the user when creating the Deployment.

    Example: ["sub1.example.com","sub2.example.com"]

  • versionnumberRequired
    One of: 2
    The platform version that was used to create the deployment.

    Example: 2

CodeDescription
200The successfully created deployment
400
  • One of the provided values in the request body is invalid.

  • One of the provided values in the request query is invalid.

401
402
  • The account was soft-blocked for an unhandled reason.

  • The account is missing a payment so payment method must be updated

  • Deploying to Serverless Functions to multiple regions requires a plan update

403You do not have permission to access this resource.
404
409The deployment project is being transferred
delete/v13/deployments/{id}

This API allows you to delete a deployment, either by supplying its id in the URL or the url of the deployment as a query parameter. You can obtain the ID, for example, by listing all deployments.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v13/deployments/dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE&url=https://files-orcin-xi.vercel.app/", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "delete"
6
})
Path Params
Query Params
Path ParameterDescription

id

string

required
The ID of the deployment to be deleted
Example:dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd
  • statestringRequired
    One of: DELETED
    A constant with the final state of the deployment.
  • uidstringRequired
    The removed deployment ID.

    Example: dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd

CodeDescription
200The deployment was successfully deleted
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404The deployment was not found
get/v13/deployments/{idOrUrl}

Retrieves information for a deployment either by supplying its ID (id property) or Hostname (url property). Additional details will be included when the authenticated user or team is an owner of the deployment.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v13/deployments/dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE&withGitRepoInfo=true", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Path Params
Query Params
Path ParameterDescription

idOrUrl

string

required
The unique identifier or hostname of the deployment.
Example:dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ
  • One of the following objects
  • One of
CodeDescription
200
  • The deployment including only public information

  • The deployment including both public and private information

400One of the provided values in the request query is invalid.
403You do not have permission to access this resource.
404The deployment was not found
get/v2/deployments/{idOrUrl}/events

Get the build logs of a deployment by deployment ID and build ID. It can work as an infinite stream of logs or as a JSON endpoint depending on the input parameters.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/deployments/dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd/events?builds=1&delimiter=1&direction=backward&follow=1&limit=100&name=bld_cotnkcr76&since=1540095775941&slug=SOME_STRING_VALUE&statusCode=5xx&teamId=SOME_STRING_VALUE&until=1540106318643", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Path Params
Query Params
Path ParameterDescription

idOrUrl

string

required
The unique identifier or hostname of the deployment.
Example:dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd
  • array
  • Array
CodeDescription
200
  • A stream of jsonlines where each line is a deployment log item.

  • Array of deployment logs for the provided query.

400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404The deployment was not found
get/v7/deployments/{id}/files/{fileId}

Allows to retrieve the content of a file by supplying the file identifier and the deployment unique identifier. The response body will contain a JSON response containing the contents of the file encoded as base64.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v7/deployments/SOME_STRING_VALUE/files/SOME_STRING_VALUE?path=SOME_STRING_VALUE&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Path Params
Query Params
Path ParameterDescription

fileId

string

required
The unique file identifier

id

string

required
The unique deployment identifier
None
CodeDescription
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
  • File not found

  • Deployment not found

410Invalid API version.
get/v6/deployments

List deployments under the authenticated user or team. If a deployment hasn't finished uploading (is incomplete), the url property will have a value of null.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v6/deployments?app=docs&from=1612948664566&limit=10&projectId=QmXGTs7mvAMMC7WW5ebrM33qKG32QK3h4vmQMjmY&rollbackCandidate=true&since=1540095775941&slug=SOME_STRING_VALUE&state=BUILDING,READY&target=production&teamId=SOME_STRING_VALUE&to=1612948664566&until=1540095775951&users=kr1PsOIzqEL5Xg6M4VZcZosf,K4amb7K9dAt5R2vBJWF32bmY", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Query Params
Query ParameterDescription

app

string

Name of the deployment.
Example:docs

from

number

deprecated
Gets the deployment created after this Date timestamp. (default: current time)
Example:1612948664566

limit

number

Maximum number of deployments to list from a request.
Example:10

projectId

string

Filter deployments from the given projectId.
Example:QmXGTs7mvAMMC7WW5ebrM33qKG32QK3h4vmQMjmY

rollbackCandidate

boolean

Filter deployments based on their rollback candidacy

since

number

Get Deployments created after this JavaScript timestamp.
Example:1540095775941

slug

string

The Team slug to perform the request on behalf of.

state

string

Filter deployments based on their state (BUILDING, ERROR, INITIALIZING, QUEUED, READY, CANCELED)
Example:BUILDING,READY

target

string of the following

Filter deployments based on the environment.
Example:production
Allowed values:productionpreview

teamId

string

The Team identifier to perform the request on behalf of.

to

number

deprecated
Gets the deployment created before this Date timestamp. (default: current time)
Example:1612948664566

until

number

Get Deployments created before this JavaScript timestamp.
Example:1540095775951

users

string

Filter out deployments based on users who have created the deployment.
Example:kr1PsOIzqEL5Xg6M4VZcZosf,K4amb7K9dAt5R2vBJWF32bmY
  • deploymentsarrayRequired
  • Properties
  • paginationRequired
CodeDescription
200
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
422
get/v6/deployments/{id}/files

Allows to retrieve the file structure of a deployment by supplying the deployment unique identifier.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v6/deployments/SOME_STRING_VALUE/files?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Path Params
Query Params
Path ParameterDescription

id

string

required
The unique deployment identifier
  • array
  • Array
CodeDescription
200Retrieved the file tree successfully
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
  • File tree not found

  • Deployment not found

post/v2/files

Before you create a deployment you need to upload the required files for that deployment. To do it, you need to first upload each file to this endpoint. Once that's completed, you can create a new deployment with the uploaded files. The file content must be placed inside the body of the request. In the case of a successful response you'll receive a status code 200 with an empty body.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/files?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>",
4
"Content-Length": "SOME_NUMBER_VALUE",
5
"x-now-digest": "SOME_STRING_VALUE",
6
"x-now-size": "SOME_NUMBER_VALUE",
7
"x-vercel-digest": "SOME_STRING_VALUE"
8
},
9
"method": "post"
10
})
Query Params
Header Params
Query ParameterDescription

slug

string

The Team slug to perform the request on behalf of.

teamId

string

The Team identifier to perform the request on behalf of.
  • One of the following objects
  • One of
CodeDescription
200
  • File already uploaded

  • File successfully uploaded

400
  • One of the provided values in the headers is invalid

  • Digest is not valid

  • File size is not valid

401
403You do not have permission to access this resource.
Last updated on April 27, 2024