curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--data "email=test@example.com&user_id=1&access_level=30" "/proxy/https://gitlab.example.com/api/v4/groups/:id/invitations"
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--data "email=test@example.com&user_id=1&access_level=30" "/proxy/https://gitlab.example.com/api/v4/projects/:id/invitations"
Example responses:
When all emails were successfully sent:
When there was any error sending the email:
{
"status": "error",
"message": {
"test@example.com": "Invite email has already been taken",
"test2@example.com": "User already exists in source",
"test_username": "Access level is not included in the list"
}
}
To enable Manage non-billable promotions,
you must first enable the enable_member_promotion_management
application setting.
Example response:
{
"queued_users": {
"username_1": "Request queued for administrator approval."
},
"status": "success"
}
List all invitations pending for a group or project
Gets a list of invited group or project members viewable by the authenticated user.
Returns invitations to direct members only, and not through inherited ancestors’ groups.
This function takes pagination parameters page
and per_page
to restrict the list of members.
GET /groups/:id/invitations
GET /projects/:id/invitations
[
{
"id": 1,
"invite_email": "member@example.org",
"created_at": "2020-10-22T14:13:35Z",
"access_level": 30,
"expires_at": "2020-11-22T14:13:35Z",
"user_name": "Raymond Smith",
"created_by_name": "Administrator"
},
]
Updates a pending invitation’s access level or access expiry date.
PUT /groups/:id/invitations/:email
PUT /projects/:id/invitations/:email
Deletes a pending invitation by email address.
DELETE /groups/:id/invitations/:email
DELETE /projects/:id/invitations/:email