Vercel SDK
The @vercel/sdk
is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to install it and authenticate with a Vercel access token.
The @vercel/sdk
is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API. Learn how to install it and authenticate with a Vercel access token.
Production API
Allows creation of an access group project
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
The ID of the project.
prj_ndlgr43fadlPyCtREAqxxdyFK
The project role that will be added to this Access Group.
ADMIN
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.createAccessGroupProject({
accessGroupIdOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
});
// Handle the result
console.log(result);
}
run();
{
"teamId": "…",
"accessGroupId": "…",
"projectId": "…",
"role": "ADMIN",
"createdAt": "…",
"updatedAt": "…"
}
Allows to create an access group
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
^[A-z0-9_ -]+$
The name of the access group
My access group
List of members to add to the access group.
[
"usr_1a2b3c4d5e6f7g8h9i0j",
"usr_2b3c4d5e6f7g8h9i0j1k"
]
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.createAccessGroup({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "My access group",
projects: [
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
],
membersToAdd: [
"usr_1a2b3c4d5e6f7g8h9i0j",
"usr_2b3c4d5e6f7g8h9i0j1k",
],
},
});
// Handle the result
console.log(result);
}
run();
{
"membersCount": 1,
"projectsCount": 1,
"name": "my-access-group",
"createdAt": 1588720733602,
"teamId": "team_123a6c5209bc3778245d011443644c8d27dc2c50",
"updatedAt": 1588720733602,
"accessGroupId": "ag_123a6c5209bc3778245d011443644c8d27dc2c50",
"teamRoles": [
"DEVELOPER",
"BILLING"
],
"teamPermissions": [
"CreateProject"
]
}
Allows deletion of an access group project
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.accessGroups.deleteAccessGroupProject({
accessGroupIdOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
}
run();
Allows to delete an access group
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await vercel.accessGroups.deleteAccessGroup({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
}
run();
List access groups
Filter access groups by project.
prj_pavWOn1iLObbx3RowVvzmPrTWyTf
Search for access groups by name.
example
Number of members to include in the response.
20
Number of projects to include in the response.
20
Limit how many access group should be returned.
20
Continuation cursor to retrieve the next page of results.
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.listAccessGroups({
projectId: "prj_pavWOn1iLObbx3RowVvzmPrTWyTf",
search: "example",
membersLimit: 20,
projectsLimit: 20,
limit: 20,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
{}
List members of an access group
The ID or name of the Access Group.
ag_pavWOn1iLObbXLRiwVvzmPrTWyTf
Limit how many access group members should be returned.
20
Continuation cursor to retrieve the next page of results.
Search project members by their name, username, and email.
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.listAccessGroupMembers({
idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
limit: 20,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
{
"members": [
{
"avatar": "…",
"email": "…",
"uid": "…",
"username": "…",
"name": "…",
"createdAt": "…",
"teamRole": "OWNER"
}
],
"pagination": {
"count": 1,
"next": null
}
}
List projects of an access group
The ID or name of the Access Group.
ag_pavWOn1iLObbXLRiwVvzmPrTWyTf
Limit how many access group projects should be returned.
20
Continuation cursor to retrieve the next page of results.
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.listAccessGroupProjects({
idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
limit: 20,
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
{
"projects": [
{
"projectId": "…",
"role": "ADMIN",
"createdAt": "…",
"updatedAt": "…",
"project": {
"name": "…",
"framework": null,
"latestDeploymentId": "…"
}
}
],
"pagination": {
"count": 1,
"next": null
}
}
Allows to read an access group
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.readAccessGroup({
idOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
{
"entitlements": [
"v0"
],
"isDsyncManaged": true,
"name": "my-access-group",
"createdAt": 1588720733602,
"teamId": "team_123a6c5209bc3778245d011443644c8d27dc2c50",
"updatedAt": 1588720733602,
"accessGroupId": "ag_123a6c5209bc3778245d011443644c8d27dc2c50",
"membersCount": 5,
"projectsCount": 2,
"teamRoles": [
"DEVELOPER",
"BILLING"
],
"teamPermissions": [
"CreateProject"
]
}
Allows reading an access group project
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.readAccessGroupProject({
accessGroupIdOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
{
"teamId": "…",
"accessGroupId": "…",
"projectId": "…",
"role": "ADMIN",
"createdAt": "…",
"updatedAt": "…"
}
Allows to update an access group metadata
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
^[A-z0-9_ -]+$
The name of the access group
My access group
List of members to add to the access group.
[
"usr_1a2b3c4d5e6f7g8h9i0j",
"usr_2b3c4d5e6f7g8h9i0j1k"
]
List of members to remove from the access group.
[
"usr_1a2b3c4d5e6f7g8h9i0j",
"usr_2b3c4d5e6f7g8h9i0j1k"
]
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.updateAccessGroup({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
name: "My access group",
projects: [
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
],
membersToAdd: [
"usr_1a2b3c4d5e6f7g8h9i0j",
"usr_2b3c4d5e6f7g8h9i0j1k",
],
membersToRemove: [
"usr_1a2b3c4d5e6f7g8h9i0j",
"usr_2b3c4d5e6f7g8h9i0j1k",
],
},
});
// Handle the result
console.log(result);
}
run();
{
"entitlements": [
"v0"
],
"name": "my-access-group",
"createdAt": 1588720733602,
"teamId": "team_123a6c5209bc3778245d011443644c8d27dc2c50",
"updatedAt": 1588720733602,
"accessGroupId": "ag_123a6c5209bc3778245d011443644c8d27dc2c50",
"membersCount": 5,
"projectsCount": 2,
"teamRoles": [
"DEVELOPER",
"BILLING"
],
"teamPermissions": [
"CreateProject"
]
}
Allows update of an access group project
The Team identifier to perform the request on behalf of.
team_1a2b3c4d5e6f7g8h9i0j1k2l
The Team slug to perform the request on behalf of.
my-team-url-slug
The project role that will be added to this Access Group.
ADMIN
You do not have permission to access this resource.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.accessGroups.updateAccessGroupProject({
accessGroupIdOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
role: "ADMIN",
},
});
// Handle the result
console.log(result);
}
run();
{
"teamId": "…",
"accessGroupId": "…",
"projectId": "…",
"role": "ADMIN",
"createdAt": "…",
"updatedAt": "…"
}
idOrName Required | ag_1a2b3c4d5e6f7g8h9i0j |
Accept | */* |
teamId | |
slug | |