Skip to content
Docs

Cancel a deployment

PATCHhttps://api.vercel.com/v12/deployments/{id}/cancel
Cancels a deployment that is currently in progress, stopping the build before it completes. Use this to recover quickly from accidental deploys, wrong-branch pushes, or builds with known errors — without waiting for them to finish. Returns 400 if the deployment is no longer cancelable (already READY, ERROR, or CANCELED). Returns the updated deployment object with readyState: 'CANCELED' on success.
https://api.vercel.com/v12/deployments/{id}/cancel
const response = await fetch('https://api.vercel.com/v12/deployments/id/cancel?teamId=string&slug=string', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"aliasAssignedAt": "123",
"alwaysRefuseToBuild": "false",
"build": {
"env": []
},
"buildArtifactUrls": [],
"builds": [
{
"use": "string",
"src": "string",
"config": "value"
}
],
"env": [],
"resourceConfig": {
"buildMachine": {
"purchaseType": "basic",
"defaultPurchaseType": "basic",
"machineSelectionType": "elastic",
"selectionSource": "elastic-algorithm",
"cores": "123",
"memory": "123"
}
},
"inspectorUrl": "https://example.com",
"isInConcurrentBuildsQueue": "false",
"isInSystemBuildsQueue": "false",
"projectSettings": {
"nodeVersion": "10.x",
"buildCommand": "string",
"devCommand": "string",
"framework": "actix-web",
"commandForIgnoringBuildStep": "string",
"installCommand": "string",
"outputDirectory": "string",
"speedInsights": {
"id": "icfg_1234567890",
"enabledAt": "123",
"disabledAt": "123",
"canceledAt": "123",
"hasData": "false",
"dataReceivedAt": "123",
"paidAt": "123"
},
"webAnalytics": {
"id": "icfg_1234567890",
"disabledAt": "123",
"canceledAt": "123",
"enabledAt": "123",
"hasData": "true"
}
},
"integrations": {
"status": "error",
"startedAt": "123",
"claimedAt": "123",
"completedAt": "123",
"skippedAt": "123",
"skippedBy": "string"
},
"images": {
"sizes": [],
"qualities": [],
"domains": [],
"remotePatterns": [
{
"protocol": "http",
"hostname": "Example Name",
"port": "string",
"pathname": "Example Name",
"search": "string"
}
],
"localPatterns": [
{
"pathname": "Example Name",
"search": "string"
}
],
"minimumCacheTTL": "123",
"formats": [],
"dangerouslyAllowSVG": "false",
"contentSecurityPolicy": "https://example.com",
"contentDispositionType": "attachment"
},
"alias": [],
"aliasAssigned": "true",
"bootedAt": "123",
"buildingAt": "123",
"buildContainerFinishedAt": "123",
"buildSkipped": "false",
"creator": {
"uid": "96SnxkFiMyVKsK3pnoHfx3Hz",
"type": "app",
"username": "john-doe",
"avatar": "string"
},
"initReadyAt": "123",
"isFirstBranchDeployment": "false",
"lambdas": [
{
"id": "icfg_1234567890",
"readyState": "BUILDING",
"createdAt": "123",
"entrypoint": "string",
"readyStateAt": "123",
"output": [
{
"path": "string",
"functionName": "Example Name"
}
]
}
],
"public": "false",
"ready": "123",
"status": "BLOCKED",
"team": {
"id": "icfg_1234567890",
"name": "Example Name",
"slug": "string",
"avatar": "string"
},
"userAliases": [],
"previewCommentsEnabled": "false",
"ttyBuildLogs": "false",
"customEnvironment": {
"id": "icfg_1234567890",
"slug": "string",
"type": "development",
"description": "string",
"branchMatcher": {
"type": "endsWith",
"pattern": "string"
},
"domains": [
{
"name": "Example Name",
"apexName": "Example Name",
"projectId": "example_id",
"redirect": "string",
"redirectStatusCode": "301",
"gitBranch": "string",
"customEnvironmentId": "example_id",
"updatedAt": "123",
"createdAt": "123",
"verified": "false",
"verification": [
{
"type": "string",
"domain": "string",
"value": "string",
"reason": "Customer requested refund"
}
]
}
],
"currentDeploymentAliases": [],
"createdAt": "123",
"updatedAt": "123"
},
"oomReport": "out-of-memory",
"readyStateReason": "Customer requested refund",
"id": "dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ",
"target": "null",
"readyState": "READY",
"aliasError": {
"code": "string",
"message": "string"
},
"aliasWarning": {
"code": "string",
"message": "string",
"link": "string",
"action": "string"
},
"errorCode": "string",
"errorMessage": "string",
"createdAt": "1540257589405",
"name": "my-project",
"type": "LAMBDAS",
"aliasFinal": "string",
"autoAssignCustomDomains": "false",
"automaticAliases": [],
"buildErrorAt": "123",
"checksState": "completed",
"checksConclusion": "canceled",
"deletedAt": "1540257589405",
"defaultRoute": "string",
"canceledAt": "123",
"errorLink": "string",
"errorStep": "string",
"passiveRegions": [],
"gitSource": {
"type": "github",
"repoId": "example_id",
"ref": "string",
"sha": "string",
"prId": "123"
},
"manualProvisioning": {
"state": "COMPLETE",
"completedAt": "123"
},
"meta": "value",
"originCacheRegion": "string",
"nodeVersion": "10.x",
"project": {
"id": "icfg_1234567890",
"name": "Example Name",
"framework": "string"
},
"prebuilt": "false",
"readySubstate": "PROMOTED",
"regions": [],
"softDeletedByRetention": "true",
"source": "cli",
"undeletedAt": "1540257589405",
"url": "my-instant-deployment-3ij3cxz9qr.now.sh",
"userConfiguredDeploymentId": "abc123",
"version": "2",
"oidcTokenClaims": {
"iss": "string",
"sub": "string",
"scope": "string",
"aud": "string",
"owner": "string",
"owner_id": "example_id",
"project": "string",
"project_id": "example_id",
"environment": "string",
"custom_environment_id": "example_id",
"mfe_group_ids": [],
"plan": "string"
},
"projectId": "example_id",
"plan": "enterprise",
"connectBuildsEnabled": "false",
"connectConfigurationId": "example_id",
"createdIn": "string",
"crons": [
{
"schedule": "string",
"path": "string"
}
],
"atproto": {
"enabled": "false"
},
"functions": "value",
"isInstantStatic": "false",
"monorepoManager": "string",
"ownerId": "example_id",
"passiveConnectConfigurationId": "example_id",
"routes": [
{
"src": "string",
"dest": "string",
"headers": "value",
"methods": [],
"continue": "false",
"override": "false",
"caseSensitive": "false",
"check": "false",
"important": "false",
"status": "123",
"has": [
{
"type": "host",
"value": "string"
}
],
"missing": [
{
"type": "host",
"value": "string"
}
],
"mitigate": {
"action": "challenge"
},
"transforms": [
{
"type": "request.headers",
"op": "append",
"target": {
"key": "string"
},
"args": "string",
"env": []
}
],
"env": [],
"locale": {
"redirect": "value",
"cookie": "string"
},
"source": "string",
"destination": "string",
"statusCode": "123",
"middlewarePath": "example_id",
"middlewareRawSrc": [],
"middleware": "123",
"respectOriginCacheControl": "false"
}
],
"services": [
{
"schema": "experimentalServices",
"name": "Example Name",
"type": "cron",
"trigger": "queue",
"group": "string",
"workspace": "string",
"entrypoint": "string",
"framework": "string",
"builder": {
"use": "string",
"src": "string",
"config": {
"bunVersion": "string",
"maxLambdaSize": "string",
"includeFiles": "string",
"excludeFiles": "string",
"bundle": "false",
"ldsflags": "string",
"helpers": "false",
"rust": "string",
"debug": "false",
"zeroConfig": "false",
"import": "value",
"functions": "value",
"projectSettings": {
"framework": "string",
"devCommand": "string",
"installCommand": "string",
"buildCommand": "string",
"outputDirectory": "string",
"rootDirectory": "string",
"nodeVersion": "string",
"monorepoManager": "string",
"createdAt": "123",
"autoExposeSystemEnvs": "false",
"sourceFilesOutsideRootDirectory": "false",
"directoryListing": "false",
"gitForkProtection": "false",
"commandForIgnoringBuildStep": "string"
},
"outputDirectory": "string",
"installCommand": "string",
"buildCommand": "string",
"devCommand": "string",
"framework": "string",
"nodeVersion": "string",
"middleware": "false",
"middlewareRuntime": "nodejs",
"middlewareMatcher": "example_id",
"serviceName": "Example Name"
}
},
"runtime": "string",
"buildCommand": "string",
"installCommand": "string",
"preDeployCommand": "string",
"routePrefix": "string",
"routePrefixSource": "configured",
"subdomain": "string",
"schedule": "string",
"handlerFunction": "string",
"topics": [],
"env": "value"
}
],
"gitRepo": {
"namespace": "Example Name",
"projectId": "123",
"type": "gitlab",
"url": "https://example.com",
"path": "string",
"defaultBranch": "string",
"name": "Example Name",
"private": "false",
"ownerType": "team"
},
"flags": {
"definitions": "value"
},
"microfrontends": {
"isDefaultApp": "false",
"defaultAppProjectName": "Example Name",
"defaultRoute": "string",
"groupIds": []
},
"platform": {
"source": {
"name": "Example Name"
},
"origin": {
"type": "id",
"value": "string"
},
"creator": {
"name": "Example Name",
"avatar": "string"
},
"meta": "value"
},
"config": {
"version": "123",
"functionType": "fluid",
"functionMemoryType": "performance",
"functionTimeout": "123",
"secureComputePrimaryRegion": "string",
"secureComputeFallbackRegion": "string",
"isUsingActiveCPU": "false",
"resourceConfig": {
"buildQueue": {
"configuration": "SKIP_NAMESPACE_QUEUE"
},
"elasticConcurrency": "PROJECT_SETTING",
"buildMachine": {
"purchaseType": "basic"
}
}
},
"checks": {
"deployment-alias": {
"state": "failed",
"startedAt": "123",
"completedAt": "123"
}
},
"seatBlock": {
"blockCode": "COMMIT_AUTHOR_REQUIRED",
"userId": "example_id",
"isVerified": "false",
"gitUserId": "example_id",
"gitProvider": "bitbucket"
},
"attribution": {
"commitMeta": {
"email": "user@example.com",
"name": "Example Name",
"isVerified": "false"
},
"gitUser": {
"id": "icfg_1234567890",
"login": "string",
"type": "string",
"provider": "example_id"
},
"vercelUser": {
"id": "icfg_1234567890",
"username": "string",
"teamRoles": []
}
}
}
AuthorizationbearerToken

Default authentication mechanism

idstringRequired
The unique identifier of the deployment.
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Returns the updated deployment object with `readyState` set to `CANCELED`. The build has been stopped and this action is irreversible.
aliasAssignedAtobjectOptional2 variants
alwaysRefuseToBuildbooleanOptional
buildobjectRequired
buildArtifactUrlsarrayOptional
buildsarrayOptional
envarrayRequired
resourceConfigobjectOptional
inspectorUrlstringRequired
isInConcurrentBuildsQueuebooleanRequired
isInSystemBuildsQueuebooleanRequired
projectSettingsobjectRequired
integrationsobjectOptional
imagesobjectOptional
aliasarrayOptional
A list of all the aliases (default aliases, staging aliases and production aliases) that were assigned upon deployment creation
aliasAssignedbooleanRequired
A boolean that will be true when the aliases from the alias property were assigned successfully
bootedAtnumberRequired
buildingAtnumberRequired
buildContainerFinishedAtnumberOptional
Since April 2025 it necessary for On-Demand Concurrency Minutes calculation
buildSkippedbooleanRequired
creatorobjectRequired
Information about the deployment creator
initReadyAtnumberOptional
isFirstBranchDeploymentbooleanOptional
lambdasarrayOptional
publicbooleanRequired
A boolean representing if the deployment is public or not. By default this is false
readynumberOptional
statusstringRequired
teamobjectOptional
The team that owns the deployment if any
userAliasesarrayOptional
An array of domains that were provided by the user when creating the Deployment.
previewCommentsEnabledbooleanOptional
Whether or not preview comments are enabled for the deployment
ttyBuildLogsbooleanOptional
customEnvironmentobjectOptional2 variants
oomReportstringOptional
readyStateReasonstringOptional
idstringRequired
A string holding the unique ID of the deployment
targetstringOptional
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. null value indicates the "preview" deployment.
readyStatestringRequired
The state of the deployment depending on the process of deploying, or if it is ready or in an error state
aliasErrorobjectOptional
An object that will contain a code and a message when the aliasing fails, otherwise the value will be null
aliasWarningobjectOptional
errorCodestringOptional
errorMessagestringOptional
createdAtnumberRequired
A number containing the date when the deployment was created in milliseconds
namestringRequired
The name of the project associated with the deployment at the time that the deployment was created
typestringRequired
aliasFinalstringOptional
autoAssignCustomDomainsbooleanOptional
applies to custom domains only, defaults to true
automaticAliasesarrayOptional
buildErrorAtnumberOptional
checksStatestringOptional
checksConclusionstringOptional
deletedAtnumberOptional
A number containing the date when the deployment was deleted at milliseconds
defaultRoutestringOptional
Computed field that is only available for deployments with a microfrontend configuration.
canceledAtnumberOptional
errorStepstringOptional
passiveRegionsarrayOptional
Since November 2023 this field defines a set of regions that we will deploy the lambda to passively Lambdas will be deployed to these regions but only invoked if all of the primary regions are marked as out of service
gitSourceobjectOptional19 variants
manualProvisioningobjectOptional
Present when deployment was created with manual provisioning enabled, either explicitly or via the experimental BYOC git flow. The deployment stays in INITIALIZING until /continue is called.
metaobjectRequired
originCacheRegionstringOptional
nodeVersionstringOptional
If set it overrides the projectSettings.nodeVersion for this deployment.
projectobjectOptional
The public project information associated with the deployment.
prebuiltbooleanOptional
readySubstatestringOptional
Substate of deployment when readyState is 'READY' Tracks whether or not deployment has seen production traffic: - STAGED: never seen production traffic - ROLLING: in the process of having production traffic gradually transitioned. - PROMOTED: has seen production traffic
regionsarrayRequired
The regions the deployment exists in
softDeletedByRetentionbooleanOptional
flag to indicate if the deployment was deleted by retention policy
sourcestringOptional
Where was the deployment created from. Best-effort guess for metrics only — not authoritative; do not gate behavior on it.
undeletedAtnumberOptional
A number containing the date when the deployment was undeleted at milliseconds
urlstringRequired
A string with the unique URL of the deployment
userConfiguredDeploymentIdstringOptional
Since January 2025 User-configured deployment ID for skew protection with pre-built deployments. This is set when users configure a custom deploymentId in their next.config.js file. This allows Next.js to use skew protection even when deployments are pre-built outside of Vercel's build system.
versionnumberRequired
The platform version that was used to create the deployment.
oidcTokenClaimsobjectOptional
projectIdstringRequired
planstringRequired
connectBuildsEnabledbooleanOptional
connectConfigurationIdstringOptional
createdInstringRequired
cronsarrayOptional
atprotoobjectOptional2 variants
functionsobjectOptional
isInstantStaticbooleanOptional
Whether this deployment completed through the instant static fast path.
monorepoManagerstringOptional
ownerIdstringRequired
passiveConnectConfigurationIdstringOptional
Since November 2023 this field defines a Secure Compute network that will only be used to deploy passive lambdas to (as in passiveRegions)
routesarrayRequired
servicesarrayOptional
Services detected during build from vercel.json experimentalServices or auto-detected from project structure. Used to inject service URLs as environment variables at runtime.
gitRepoobjectOptional5 variants
flagsobjectOptional
Flags defined in the Build Output API, used by this deployment. Primarily used by the Toolbar to know about the used flags.
microfrontendsobjectOptional2 variants
platformobjectOptional
Metadata about the source platform that triggered the deployment. Allows us to map a deployment back to a platform (e.g. the chat that created it)
configobjectOptional
Since February 2025 the configuration must include snapshot data at the time of deployment creation to capture properties for the /deployments/:id/config endpoint utilized for displaying Deployment Configuration on the frontend This is optional because older deployments may not have this data captured
checksobjectOptional
seatBlockobjectOptional
NSNB Blocked metadata
attributionobjectOptional
Attribution metadata for the deployment, linking commit author to git and Vercel users. Only populated when the enable-deployment-attribution flag is enabled.
400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error