Skip to content
Docs

Invite a user

POSThttps://api.vercel.com/v2/teams/{teamId}/members
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 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

teamIdstringRequired
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Success
uidstringRequired
The ID of the invited user
usernamestringRequired
The username of the invited user
emailstringRequired
The email of the invited user.
rolestringRequired
The role used for the invitation
teamRolesarrayOptional
The team roles of the user
teamPermissionsarrayOptional
The team permissions of the user
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