Get a deployment by ID or URL
GET
https://api.vercel.com/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.Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.deployments.getDeployment({ idOrUrl: "dpl_89qyp1cskzkLrVicDaZoDbjyHuDJ", withGitRepoInfo: "true", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
{ "alias": [], "aliasAssigned": "false", "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"}AuthorizationbearerToken
Default authentication mechanism
When
true, the response includes the gitSource object with the commit SHA, branch name, and connected repository metadata. Defaults to false.200Returns a reduced view of the deployment with public information only. Private fields are omitted when the requester is not the deployment owner.
Returns the deployment object for the authenticated owner, including private fields such as environment variables, build log URLs, and internal metadata.
Returns the reduced deployment view for anonymous (`vcn_`) callers. Pool-team details are withheld.
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.The state of the deployment depending on the process of deploying, or if it is ready or in an error state
An object that will contain a
code and a message when the aliasing fails, otherwise the value will be null400One of the provided values in the request query is invalid.
403You do not have permission to access this resource.
404The deployment was not found
410Error
429Error