Projects
July 24, 2026 ยท View on GitHub
Overview
Available Operations
- getProjects - Retrieve a list of projects
- getProjectTrace - Get a project trace by request ID
- createProject - Create a new project
- getProjectToken - Generate a project OIDC token
- createTraceSession - Create a trace session token for a deployment
- getProject - Find a project by id or name
- updateProject - Update an existing project
- deleteProject - Delete a Project
- uploadProjectAvatar - Upload a project avatar
- getProjectDomains - Retrieve project domains by project by id or name
- getProjectDomain - Get a project domain
- updateProjectDomain - Update a project domain
- removeProjectDomain - Remove a domain from a project
- addProjectDomain - Add a domain to a project
- moveProjectDomain - Move a project domain
- verifyProjectDomain - Verify project domain
- filterProjectEnvs - Retrieve the environment variables of a project by id or name
- createProjectEnv - Create one or more environment variables
- getProjectEnv - Retrieve the decrypted value of an environment variable of a project by id
- removeProjectEnv - Remove an environment variable
- editProjectEnv - Edit an environment variable
- batchRemoveProjectEnv - Batch remove environment variables
- createProjectTransferRequest - Create project transfer request
- acceptProjectTransferRequest - Accept project transfer request
- updateProjectProtectionBypass - Update Protection Bypass for Automation
- requestRollback - Point production traffic to a previous production deployment by ID
- updateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription - Updates the description for a rollback
- updateMicrofrontends - Update the microfrontends settings
- requestPromote - Point production traffic to a given deployment
- listPromoteAliases - Gets a list of aliases with status for the current promote
- pauseProject - Pause a project
- unpauseProject - Unpause a project
getProjects
Allows to retrieve the list of projects of the authenticated user or team. The list will be paginated and the provided query parameters allow filtering the returned projects.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.getProjects({
gitForkProtection: "1",
repoUrl: "https://github.com/vercel/next.js",
elasticConcurrencyEnabled: "1",
staticIpsEnabled: "1",
buildMachineTypes: "default,enhanced",
buildQueueConfiguration: "SKIP_NAMESPACE_QUEUE",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsGetProjects } from "@vercel/sdk/funcs/projectsGetProjects.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProjects(vercel, {
gitForkProtection: "1",
repoUrl: "https://github.com/vercel/next.js",
elasticConcurrencyEnabled: "1",
staticIpsEnabled: "1",
buildMachineTypes: "default,enhanced",
buildQueueConfiguration: "SKIP_NAMESPACE_QUEUE",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsGetProjects failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.GetProjectsRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.GetProjectsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
getProjectTrace
Returns the OTEL trace for a given Vercel CLI request.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.getProjectTrace({
projectId: "prj_123",
requestId: "cli-req-abc",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsGetProjectTrace } from "@vercel/sdk/funcs/projectsGetProjectTrace.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProjectTrace(vercel, {
projectId: "prj_123",
requestId: "cli-req-abc",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsGetProjectTrace failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.GetProjectTraceRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.GetProjectTraceResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
createProject
Allows to create a new project with the provided configuration. It only requires the project name but more configuration can be provided to override the defaults.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.createProject({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "a-project-name",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsCreateProject } from "@vercel/sdk/funcs/projectsCreateProject.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsCreateProject(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "a-project-name",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsCreateProject failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.CreateProjectRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.CreateProjectResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
getProjectToken
Generates an OIDC token for the project and returns it.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.getProjectToken({
idOrName: "my-project, <prj_id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
source: "vercel-cli:pull",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsGetProjectToken } from "@vercel/sdk/funcs/projectsGetProjectToken.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProjectToken(vercel, {
idOrName: "my-project, <prj_id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
source: "vercel-cli:pull",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsGetProjectToken failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.GetProjectTokenRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.GetProjectTokenResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
createTraceSession
Mints a short-lived HS256 JWT scoped to a deployment hostname. The Vercel CLI presents this JWT to the Vercel proxy on requests it wants traced.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.createTraceSession({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsCreateTraceSession } from "@vercel/sdk/funcs/projectsCreateTraceSession.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsCreateTraceSession(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsCreateTraceSession failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.CreateTraceSessionRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.CreateTraceSessionResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
getProject
Get the information for a specific project by passing either the project id or name in the URL.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.getProject({
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsGetProject } from "@vercel/sdk/funcs/projectsGetProject.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProject(vercel, {
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsGetProject failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.GetProjectRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.GetProjectResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
updateProject
Update the fields of a project using either its name or id.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.updateProject({
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "a-project-name",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsUpdateProject } from "@vercel/sdk/funcs/projectsUpdateProject.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsUpdateProject(vercel, {
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "a-project-name",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsUpdateProject failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.UpdateProjectRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.UpdateProjectResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
deleteProject
Delete a specific project by passing either the project id or name in the URL.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.projects.deleteProject({
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsDeleteProject } from "@vercel/sdk/funcs/projectsDeleteProject.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsDeleteProject(vercel, {
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("projectsDeleteProject failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.DeleteProjectRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
uploadProjectAvatar
Upload an image as the avatar of the project identified by idOrName. The request body is the raw bytes of a JPG, PNG, or SVG image; the Content-Type header must declare which. SVG payloads are sanitized and optimized server-side before storage. The final SHA-1 of the stored bytes becomes the project's avatar value. The actual upload pipeline (validation, sanitization, S3 write, conditional updateProject, and event emission) lives in the shared @api/project-avatar-upload helper so it can be reused by background workers.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.uploadProjectAvatar({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsUploadProjectAvatar } from "@vercel/sdk/funcs/projectsUploadProjectAvatar.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsUploadProjectAvatar(vercel, {
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsUploadProjectAvatar failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.UploadProjectAvatarRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.UploadProjectAvatarResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
getProjectDomains
Retrieve the domains associated with a given project by passing either the project id or name in the URL.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.getProjectDomains({
idOrName: "<value>",
customEnvironmentId: "env_123abc4567",
redirect: "example.com",
limit: 20,
since: 1609499532000,
until: 1612264332000,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsGetProjectDomains } from "@vercel/sdk/funcs/projectsGetProjectDomains.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProjectDomains(vercel, {
idOrName: "<value>",
customEnvironmentId: "env_123abc4567",
redirect: "example.com",
limit: 20,
since: 1609499532000,
until: 1612264332000,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsGetProjectDomains failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.GetProjectDomainsRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.GetProjectDomainsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
getProjectDomain
Get project domain by project id/name and domain name.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.getProjectDomain({
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsGetProjectDomain } from "@vercel/sdk/funcs/projectsGetProjectDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProjectDomain(vercel, {
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsGetProjectDomain failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.GetProjectDomainRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.GetProjectDomainResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
updateProjectDomain
Update a project domain's configuration, including the name, git branch and redirect of the domain.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.updateProjectDomain({
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
gitBranch: null,
redirect: "foobar.com",
redirectStatusCode: 307,
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsUpdateProjectDomain } from "@vercel/sdk/funcs/projectsUpdateProjectDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsUpdateProjectDomain(vercel, {
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
gitBranch: null,
redirect: "foobar.com",
redirectStatusCode: 307,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsUpdateProjectDomain failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.UpdateProjectDomainRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.UpdateProjectDomainResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
removeProjectDomain
Remove a domain from a project by passing the domain name and by specifying the project by either passing the project id or name in the URL.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.removeProjectDomain({
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsRemoveProjectDomain } from "@vercel/sdk/funcs/projectsRemoveProjectDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsRemoveProjectDomain(vercel, {
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsRemoveProjectDomain failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.RemoveProjectDomainRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.RemoveProjectDomainResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
addProjectDomain
Add a domain to the project by passing its domain name and by specifying the project by either passing the project id or name in the URL. If the domain is not yet verified to be used on this project, the request will return verified = false, and the domain will need to be verified according to the verification challenge via POST /projects/:idOrName/domains/:domain/verify. If the domain already exists on the project, the request will fail with a 400 status code.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.addProjectDomain({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "www.example.com",
gitBranch: null,
redirect: "foobar.com",
redirectStatusCode: 307,
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsAddProjectDomain } from "@vercel/sdk/funcs/projectsAddProjectDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsAddProjectDomain(vercel, {
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "www.example.com",
gitBranch: null,
redirect: "foobar.com",
redirectStatusCode: 307,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsAddProjectDomain failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.AddProjectDomainRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.AddProjectDomainResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
moveProjectDomain
Move one project's domain to another project. Also allows the move of all redirects pointed to that domain in the same project.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.moveProjectDomain({
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
projectId: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
gitBranch: null,
redirect: "foobar.com",
redirectStatusCode: 307,
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsMoveProjectDomain } from "@vercel/sdk/funcs/projectsMoveProjectDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsMoveProjectDomain(vercel, {
idOrName: "<value>",
domain: "www.example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
projectId: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
gitBranch: null,
redirect: "foobar.com",
redirectStatusCode: 307,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsMoveProjectDomain failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.MoveProjectDomainRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.MoveProjectDomainResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
verifyProjectDomain
Attempts to verify a project domain with verified = false by checking the correctness of the project domain's verification challenge.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.verifyProjectDomain({
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsVerifyProjectDomain } from "@vercel/sdk/funcs/projectsVerifyProjectDomain.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsVerifyProjectDomain(vercel, {
idOrName: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
domain: "example.com",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsVerifyProjectDomain failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.VerifyProjectDomainRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.VerifyProjectDomainResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
filterProjectEnvs
Retrieve the environment variables for a given project by passing either the project id or name in the URL.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.filterProjectEnvs({
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
gitBranch: "feature-1",
decrypt: "true",
source: "vercel-cli:pull",
customEnvironmentId: "env_123abc4567",
customEnvironmentSlug: "my-custom-env",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsFilterProjectEnvs } from "@vercel/sdk/funcs/projectsFilterProjectEnvs.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsFilterProjectEnvs(vercel, {
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
gitBranch: "feature-1",
decrypt: "true",
source: "vercel-cli:pull",
customEnvironmentId: "env_123abc4567",
customEnvironmentSlug: "my-custom-env",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsFilterProjectEnvs failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.FilterProjectEnvsRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.FilterProjectEnvsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
createProjectEnv
Create one or more environment variables for a project by passing its key, value, type and target and by specifying the project by either passing the project id or name in the URL. If you include upsert=true as a query parameter, a new environment variable will not be created if it already exists but, the existing variable's value will be updated.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.createProjectEnv({
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
upsert: "true",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
key: "API_URL",
value: "https://api.vercel.com",
type: "plain",
target: [
"preview",
],
gitBranch: "feature-1",
comment: "database connection string for production",
customEnvironmentIds: [
"env_1234567890",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsCreateProjectEnv } from "@vercel/sdk/funcs/projectsCreateProjectEnv.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsCreateProjectEnv(vercel, {
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
upsert: "true",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
key: "API_URL",
value: "https://api.vercel.com",
type: "plain",
target: [
"preview",
],
gitBranch: "feature-1",
comment: "database connection string for production",
customEnvironmentIds: [
"env_1234567890",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsCreateProjectEnv failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.CreateProjectEnvRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.CreateProjectEnvResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
getProjectEnv
Retrieve the environment variable for a given project.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.getProjectEnv({
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
id: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsGetProjectEnv } from "@vercel/sdk/funcs/projectsGetProjectEnv.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsGetProjectEnv(vercel, {
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
id: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsGetProjectEnv failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.GetProjectEnvRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.GetProjectEnvResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
removeProjectEnv
Delete a specific environment variable for a given project by passing the environment variable identifier and either passing the project id or name in the URL.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.removeProjectEnv({
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
id: "XMbOEya1gUUO1ir4",
customEnvironmentId: "env_123abc4567",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsRemoveProjectEnv } from "@vercel/sdk/funcs/projectsRemoveProjectEnv.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsRemoveProjectEnv(vercel, {
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
id: "XMbOEya1gUUO1ir4",
customEnvironmentId: "env_123abc4567",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsRemoveProjectEnv failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.RemoveProjectEnvRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.RemoveProjectEnvResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
editProjectEnv
Edit a specific environment variable for a given project by passing the environment variable identifier and either passing the project id or name in the URL.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.editProjectEnv({
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
id: "XMbOEya1gUUO1ir4",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
key: "GITHUB_APP_ID",
target: [
"preview",
],
gitBranch: "feature-1",
type: "plain",
value: "bkWIjbnxcvo78",
customEnvironmentIds: [
"env_1234567890",
],
comment: "database connection string for production",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsEditProjectEnv } from "@vercel/sdk/funcs/projectsEditProjectEnv.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsEditProjectEnv(vercel, {
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
id: "XMbOEya1gUUO1ir4",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
key: "GITHUB_APP_ID",
target: [
"preview",
],
gitBranch: "feature-1",
type: "plain",
value: "bkWIjbnxcvo78",
customEnvironmentIds: [
"env_1234567890",
],
comment: "database connection string for production",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsEditProjectEnv failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.EditProjectEnvRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.EditProjectEnvResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
batchRemoveProjectEnv
Delete multiple environment variables for a given project in a single batch operation.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.batchRemoveProjectEnv({
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsBatchRemoveProjectEnv } from "@vercel/sdk/funcs/projectsBatchRemoveProjectEnv.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsBatchRemoveProjectEnv(vercel, {
idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsBatchRemoveProjectEnv failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.BatchRemoveProjectEnvRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.BatchRemoveProjectEnvResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
createProjectTransferRequest
Initiates a project transfer request from one team to another.
Returns a code that remains valid for 24 hours and can be used to accept the transfer request by another team using the PUT /projects/transfer-request/:code endpoint.
Users can also accept the project transfer request using the claim URL: https://vercel.com/claim-deployment?code=<code>&returnUrl=<returnUrl>.
The code parameter specifies the project transfer request code generated using this endpoint.
The returnUrl parameter redirects users to a specific page of the application if the claim URL is invalid or expired.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.createProjectTransferRequest({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsCreateProjectTransferRequest } from "@vercel/sdk/funcs/projectsCreateProjectTransferRequest.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsCreateProjectTransferRequest(vercel, {
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsCreateProjectTransferRequest failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.CreateProjectTransferRequestRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.CreateProjectTransferRequestResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
acceptProjectTransferRequest
Accept a project transfer request initated by another team.
The code is generated using the POST /projects/:idOrName/transfer-request endpoint.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.acceptProjectTransferRequest({
code: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
newProjectName: "a-project-name",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsAcceptProjectTransferRequest } from "@vercel/sdk/funcs/projectsAcceptProjectTransferRequest.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsAcceptProjectTransferRequest(vercel, {
code: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
newProjectName: "a-project-name",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsAcceptProjectTransferRequest failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.AcceptProjectTransferRequestRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.AcceptProjectTransferRequestResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
updateProjectProtectionBypass
Update the deployment protection automation bypass for a project
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.updateProjectProtectionBypass({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsUpdateProjectProtectionBypass } from "@vercel/sdk/funcs/projectsUpdateProjectProtectionBypass.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsUpdateProjectProtectionBypass(vercel, {
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsUpdateProjectProtectionBypass failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.UpdateProjectProtectionBypassRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.UpdateProjectProtectionBypassResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
requestRollback
Allows users to rollback to a deployment.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.projects.requestRollback({
projectId: "<id>",
deploymentId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsRequestRollback } from "@vercel/sdk/funcs/projectsRequestRollback.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsRequestRollback(vercel, {
projectId: "<id>",
deploymentId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("projectsRequestRollback failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.RequestRollbackRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
updateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription
Updates the reason for a rollback, without changing the rollback status itself.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel();
async function run() {
await vercel.projects.updateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription({
projectId: "<id>",
deploymentId: "<id>",
});
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsUpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription } from "@vercel/sdk/funcs/projectsUpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore();
async function run() {
const res = await projectsUpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription(vercel, {
projectId: "<id>",
deploymentId: "<id>",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("projectsUpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescription failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.UpdateProjectsByProjectIdRollbackByDeploymentIdUpdateDescriptionRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
updateMicrofrontends
Update the microfrontends settings for a project.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.updateMicrofrontends({
projectId: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
microfrontendsGroupId: "mfe_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
enabled: true,
isDefaultApp: true,
defaultRoute: "/home",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsUpdateMicrofrontends } from "@vercel/sdk/funcs/projectsUpdateMicrofrontends.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsUpdateMicrofrontends(vercel, {
projectId: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
microfrontendsGroupId: "mfe_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
enabled: true,
isDefaultApp: true,
defaultRoute: "/home",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsUpdateMicrofrontends failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.UpdateMicrofrontendsRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.UpdateMicrofrontendsResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
requestPromote
Allows users to promote a deployment to production. Note: This does NOT rebuild the deployment. If you need that, then call create-deployments endpoint.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.projects.requestPromote({
projectId: "<id>",
deploymentId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsRequestPromote } from "@vercel/sdk/funcs/projectsRequestPromote.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsRequestPromote(vercel, {
projectId: "<id>",
deploymentId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("projectsRequestPromote failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.RequestPromoteRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
listPromoteAliases
Get a list of aliases related to the last promote request with their mapping status
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projects.listPromoteAliases({
projectId: "<id>",
limit: 20,
since: 1609499532000,
until: 1612264332000,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsListPromoteAliases } from "@vercel/sdk/funcs/projectsListPromoteAliases.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsListPromoteAliases(vercel, {
projectId: "<id>",
limit: 20,
since: 1609499532000,
until: 1612264332000,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("projectsListPromoteAliases failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.ListPromoteAliasesRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.ListPromoteAliasesResponseBody>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
pauseProject
Pause a project by passing its project id in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project disables auto assigning custom production domains and blocks the active Production Deployment then the request will return with 200 status code.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.projects.pauseProject({
projectId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsPauseProject } from "@vercel/sdk/funcs/projectsPauseProject.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsPauseProject(vercel, {
projectId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("projectsPauseProject failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.PauseProjectRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |
unpauseProject
Unpause a project by passing its project id in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project enables auto assigning custom production domains and unblocks the active Production Deployment then the request will return with 200 status code.
Example Usage
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.projects.unpauseProject({
projectId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
}
run();
Standalone function
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectsUnpauseProject } from "@vercel/sdk/funcs/projectsUnpauseProject.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await projectsUnpauseProject(vercel, {
projectId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("projectsUnpauseProject failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | models.UnpauseProjectRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| models.SDKError | 4XX, 5XX | */* |