v0.0.1
OAS 3.0.3

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.

Production API

No authentication selected

access-groups

Create an access group project

Allows creation of an access group project

Path Parameters
  • accessGroupIdOrName
    string
    required
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Body
application/json
projectId
string
max: 
256
required

The ID of the project.

Exampleprj_ndlgr43fadlPyCtREAqxxdyFK
role
string enum
required

The project role that will be added to this Access Group.

ExampleADMIN
  • ADMIN
  • PROJECT_VIEWER
  • PROJECT_DEVELOPER
Responses
  • 403

    You do not have permission to access this resource.

POST/v1/access-groups/{accessGroupIdOrName}/projects
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": "…"
}

Creates an access group

Allows to create an access group

Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Body
application/json
name
string
max: 
50
^[A-z0-9_ -]+$
required

The name of the access group

ExampleMy access group
projects
array object[]
membersToAdd
array string[]

List of members to add to the access group.

Example[ "usr_1a2b3c4d5e6f7g8h9i0j", "usr_2b3c4d5e6f7g8h9i0j1k" ]
Responses
  • 403

    You do not have permission to access this resource.

POST/v1/access-groups
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"
  ]
}

Delete an access group project

Allows deletion of an access group project

Path Parameters
  • accessGroupIdOrName
    string
    required
  • projectId
    string
    required
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Responses
  • 200
  • 403

    You do not have permission to access this resource.

DELETE/v1/access-groups/{accessGroupIdOrName}/projects/{projectId}
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();
No Body

Deletes an access group

Allows to delete an access group

Path Parameters
  • idOrName
    string
    required
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Responses
  • 200
  • 403

    You do not have permission to access this resource.

DELETE/v1/access-groups/{idOrName}
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();
No Body

List access groups for a team, project or member

List access groups

Query Parameters
  • projectId
    string

    Filter access groups by project.

    Exampleprj_pavWOn1iLObbx3RowVvzmPrTWyTf
  • search
    string

    Search for access groups by name.

    Exampleexample
  • membersLimit
    integer
    min: 
    1
    max: 
    100

    Number of members to include in the response.

    Example20
  • projectsLimit
    integer
    min: 
    1
    max: 
    100

    Number of projects to include in the response.

    Example20
  • limit
    integer
    min: 
    1
    max: 
    100

    Limit how many access group should be returned.

    Example20
  • next
    string

    Continuation cursor to retrieve the next page of results.

  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Responses
  • 403

    You do not have permission to access this resource.

GET/v1/access-groups
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

List members of an access group

Path Parameters
  • idOrName
    string
    required

    The ID or name of the Access Group.

    Exampleag_pavWOn1iLObbXLRiwVvzmPrTWyTf
Query Parameters
  • limit
    integer
    min: 
    1
    max: 
    100

    Limit how many access group members should be returned.

    Example20
  • next
    string

    Continuation cursor to retrieve the next page of results.

  • search
    string

    Search project members by their name, username, and email.

  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Responses
  • 403

    You do not have permission to access this resource.

GET/v1/access-groups/{idOrName}/members
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

List projects of an access group

Path Parameters
  • idOrName
    string
    required

    The ID or name of the Access Group.

    Exampleag_pavWOn1iLObbXLRiwVvzmPrTWyTf
Query Parameters
  • limit
    integer
    min: 
    1
    max: 
    100

    Limit how many access group projects should be returned.

    Example20
  • next
    string

    Continuation cursor to retrieve the next page of results.

  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Responses
  • 403

    You do not have permission to access this resource.

GET/v1/access-groups/{idOrName}/projects
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
  }
}

Reads an access group

Allows to read an access group

Path Parameters
  • idOrName
    string
    required
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Responses
  • 403

    You do not have permission to access this resource.

GET/v1/access-groups/{idOrName}
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"
  ]
}

Reads an access group project

Allows reading an access group project

Path Parameters
  • accessGroupIdOrName
    string
    required
  • projectId
    string
    required
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Responses
  • 403

    You do not have permission to access this resource.

GET/v1/access-groups/{accessGroupIdOrName}/projects/{projectId}
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": "…"
}

Update an access group

Allows to update an access group metadata

Path Parameters
  • idOrName
    string
    required
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Body
application/json
name
string
max: 
50
^[A-z0-9_ -]+$

The name of the access group

ExampleMy access group
projects
array object[]
membersToAdd
array string[]

List of members to add to the access group.

Example[ "usr_1a2b3c4d5e6f7g8h9i0j", "usr_2b3c4d5e6f7g8h9i0j1k" ]
membersToRemove
array string[]

List of members to remove from the access group.

Example[ "usr_1a2b3c4d5e6f7g8h9i0j", "usr_2b3c4d5e6f7g8h9i0j1k" ]
Responses
  • 403

    You do not have permission to access this resource.

POST/v1/access-groups/{idOrName}
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"
  ]
}

Update an access group project

Allows update of an access group project

Path Parameters
  • accessGroupIdOrName
    string
    required
  • projectId
    string
    required
Query Parameters
  • teamId
    string

    The Team identifier to perform the request on behalf of.

    Exampleteam_1a2b3c4d5e6f7g8h9i0j1k2l
  • slug
    string

    The Team slug to perform the request on behalf of.

    Examplemy-team-url-slug
Body
application/json
role
string enum
required

The project role that will be added to this Access Group.

ExampleADMIN
  • ADMIN
  • PROJECT_VIEWER
  • PROJECT_DEVELOPER
Responses
  • 403

    You do not have permission to access this resource.

PATCH/v1/access-groups/{accessGroupIdOrName}/projects/{projectId}
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": "…"
}

certs

Models