Invite a user
POST
https://api.vercel.com/v2/teams/{teamId}/membersInvite 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 to be invited must be specified by email.https://api.vercel.com/v2/teams/{teamId}/members
const response = await fetch('https://api.vercel.com/v2/teams/teamId/members?slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify([ { "email": "john@example.com", "role": "VIEWER", "projects": [ { "projectId": "prj_ndlgr43fadlPyCtREAqxxdyFK", "role": "ADMIN" } ] } ]),});
const data = await response.json();console.log(data);Response
{ "uid": "kr1PsOIzqEL5Xg6M4VZcZosf", "username": "john-doe", "email": "john@user.co", "role": "MEMBER", "teamRoles": [], "teamPermissions": []}AuthorizationbearerToken
Default authentication mechanism
200Success
400One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
The authenticated user must be a team owner to perform the action
503Error