(teams)
- getTeamMembers - List team members
- inviteUserToTeam - Invite a user
- requestAccessToTeam - Request access to a team
- getTeamAccessRequest - Get access request status
- joinTeam - Join a team
- updateTeamMember - Update a Team Member
- removeTeamMember - Remove a Team Member
- getTeam - Get a Team
- patchTeam - Update a Team
- getTeams - List all teams
- createTeam - Create a Team
- deleteTeam - Delete a Team
- deleteTeamInviteCode - Delete a Team invite code
Get a paginated list of team members for the provided team.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.getTeamMembers({
limit: 20,
since: 1540095775951,
until: 1540095775951,
role: "OWNER",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsGetTeamMembers } from "@vercel/sdk/funcs/teamsGetTeamMembers.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 teamsGetTeamMembers(vercel, {
limit: 20,
since: 1540095775951,
until: 1540095775951,
role: "OWNER",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetTeamMembersRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetTeamMembersResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Invite a user to join the team specified in the URL. The authenticated user needs to be an OWNER
in order to successfully invoke this endpoint. The user can be specified with an email or an ID. If both email and ID are provided, ID will take priority.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.inviteUserToTeam({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
uid: "kr1PsOIzqEL5Xg6M4VZcZosf",
email: "[email protected]",
role: "VIEWER",
projects: [
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
],
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsInviteUserToTeam } from "@vercel/sdk/funcs/teamsInviteUserToTeam.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 teamsInviteUserToTeam(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
uid: "kr1PsOIzqEL5Xg6M4VZcZosf",
email: "[email protected]",
role: "VIEWER",
projects: [
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.InviteUserToTeamRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.InviteUserToTeamResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Request access to a team as a member. An owner has to approve the request. Only 10 users can request access to a team at the same time.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.requestAccessToTeam({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
joinedFrom: {
origin: "github",
commitId: "f498d25d8bd654b578716203be73084b31130cd7",
repoId: "67753070",
repoPath: "jane-doe/example",
gitUserId: 103053343,
gitUserLogin: "jane-doe",
},
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsRequestAccessToTeam } from "@vercel/sdk/funcs/teamsRequestAccessToTeam.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 teamsRequestAccessToTeam(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
joinedFrom: {
origin: "github",
commitId: "f498d25d8bd654b578716203be73084b31130cd7",
repoId: "67753070",
repoPath: "jane-doe/example",
gitUserId: 103053343,
gitUserLogin: "jane-doe",
},
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.RequestAccessToTeamRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.RequestAccessToTeamResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Check the status of a join request. It'll respond with a 404 if the request has been declined. If no userId
path segment was provided, this endpoint will instead return the status of the authenticated user.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.getTeamAccessRequest({
userId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsGetTeamAccessRequest } from "@vercel/sdk/funcs/teamsGetTeamAccessRequest.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 teamsGetTeamAccessRequest(vercel, {
userId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetTeamAccessRequestRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetTeamAccessRequestResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Join a team with a provided invite code or team ID.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.joinTeam({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
inviteCode: "fisdh38aejkeivn34nslfore9vjtn4ls",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsJoinTeam } from "@vercel/sdk/funcs/teamsJoinTeam.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 teamsJoinTeam(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
inviteCode: "fisdh38aejkeivn34nslfore9vjtn4ls",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.JoinTeamRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.JoinTeamResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Update the membership of a Team Member on the Team specified by teamId
, such as changing the role of the member, or confirming a request to join the Team for an unconfirmed member. The authenticated user must be an OWNER
of the Team.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.updateTeamMember({
uid: "ndfasllgPyCtREAqxxdyFKb",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
confirmed: true,
role: "[\"MEMBER\",\"VIEWER\"]",
projects: [
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
],
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsUpdateTeamMember } from "@vercel/sdk/funcs/teamsUpdateTeamMember.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 teamsUpdateTeamMember(vercel, {
uid: "ndfasllgPyCtREAqxxdyFKb",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
requestBody: {
confirmed: true,
role: "[\"MEMBER\",\"VIEWER\"]",
projects: [
{
projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
role: "ADMIN",
},
],
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.UpdateTeamMemberRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.UpdateTeamMemberResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Remove a Team Member from the Team, or dismiss a user that requested access, or leave a team.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.removeTeamMember({
uid: "ndlgr43fadlPyCtREAqxxdyFK",
newDefaultTeamId: "team_nllPyCtREAqxxdyFKbbMDlxd",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsRemoveTeamMember } from "@vercel/sdk/funcs/teamsRemoveTeamMember.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 teamsRemoveTeamMember(vercel, {
uid: "ndlgr43fadlPyCtREAqxxdyFK",
newDefaultTeamId: "team_nllPyCtREAqxxdyFKbbMDlxd",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.RemoveTeamMemberRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.RemoveTeamMemberResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Get information for the Team specified by the teamId
parameter.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.getTeam({
slug: "my-team-url-slug",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsGetTeam } from "@vercel/sdk/funcs/teamsGetTeam.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 teamsGetTeam(vercel, {
slug: "my-team-url-slug",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetTeamRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<{ [k: string]: any }>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Update the information of a Team specified by the teamId
parameter. The request body should contain the information that will be updated on the Team.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.patchTeam({
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
description: "Our mission is to make cloud computing accessible to everyone",
emailDomain: "example.com",
name: "My Team",
previewDeploymentSuffix: "example.dev",
regenerateInviteCode: true,
saml: {
enforced: true,
},
slug: "my-team",
enablePreviewFeedback: "on",
enableProductionFeedback: "on",
sensitiveEnvironmentVariablePolicy: "on",
remoteCaching: {
enabled: true,
},
hideIpAddresses: false,
hideIpAddressesInLogDrains: false,
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsPatchTeam } from "@vercel/sdk/funcs/teamsPatchTeam.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 teamsPatchTeam(vercel, {
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {
description: "Our mission is to make cloud computing accessible to everyone",
emailDomain: "example.com",
name: "My Team",
previewDeploymentSuffix: "example.dev",
regenerateInviteCode: true,
saml: {
enforced: true,
},
slug: "my-team",
enablePreviewFeedback: "on",
enableProductionFeedback: "on",
sensitiveEnvironmentVariablePolicy: "on",
remoteCaching: {
enabled: true,
},
hideIpAddresses: false,
hideIpAddressesInLogDrains: false,
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.PatchTeamRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<{ [k: string]: any }>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Get a paginated list of all the Teams the authenticated User is a member of.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.getTeams({
limit: 20,
since: 1540095775951,
until: 1540095775951,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsGetTeams } from "@vercel/sdk/funcs/teamsGetTeams.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 teamsGetTeams(vercel, {
limit: 20,
since: 1540095775951,
until: 1540095775951,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetTeamsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetTeamsResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Create a new Team under your account. You need to send a POST request with the desired Team slug, and optionally the Team name.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.createTeam({
slug: "a-random-team",
name: "A Random Team",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsCreateTeam } from "@vercel/sdk/funcs/teamsCreateTeam.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 teamsCreateTeam(vercel, {
slug: "a-random-team",
name: "A Random Team",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CreateTeamRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.CreateTeamResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Delete a team under your account. You need to send a DELETE
request with the desired team id
. An optional array of reasons for deletion may also be sent.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.deleteTeam({
newDefaultTeamId: "team_LLHUOMOoDlqOp8wPE4kFo9pE",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsDeleteTeam } from "@vercel/sdk/funcs/teamsDeleteTeam.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 teamsDeleteTeam(vercel, {
newDefaultTeamId: "team_LLHUOMOoDlqOp8wPE4kFo9pE",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
requestBody: {},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.DeleteTeamRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.DeleteTeamResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |
Delete an active Team invite code.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.teams.deleteTeamInviteCode({
inviteId: "2wn2hudbr4chb1ecywo9dvzo7g9sscs6mzcz8htdde0txyom4l",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { teamsDeleteTeamInviteCode } from "@vercel/sdk/funcs/teamsDeleteTeamInviteCode.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 teamsDeleteTeamInviteCode(vercel, {
inviteId: "2wn2hudbr4chb1ecywo9dvzo7g9sscs6mzcz8htdde0txyom4l",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.DeleteTeamInviteCodeRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.DeleteTeamInviteCodeResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.VercelNotFoundError | 404 | application/json |
models.SDKError | 4XX, 5XX | */* |