invitations Resource

Bitbucket Cloud v1 APIs are deprecated

Bitbucket Cloud REST API version 1 is deprecated effective 30 June 2018, and were removed from the REST API permanently on 29 April 2019. Read the deprecation notice. Or you can jump right to the version 2.0 REST API documentation.

Temporary support for limited 1.0 API resources

The 2.0 REST API will rely on the Atlassian Cloud Admin API for user and group management, but those API endpoints are not yet available. Until the Atlassian platform services are fully available in Bitbucket we will continue to support these 1.0 REST endpoints:

  • /1.0/groups

  • /1.0/group-privileges

  • /1.0/invitations

  • /1.0/users/{accountname}/invitations

Overview

An invitation is a request sent to an external email address to participate one or more of an account's groups. Any user with admin access to the account can invite someone to a group. An invitation consists of the following fields:

Field

Description

groups

One or more of the account's groups that the person was invited to.

invited by

The user profile of the user issuing the invitation.

utc_sent_on

A UTC value representing when the invitation was issued.

email

The external email on the invite

GET a list of pending invitations

1 GET https://api.bitbucket.org/1.0/users/{uuid}

Gets a list of pending invitations on a team or individual account. This call requires authorization and the caller must have administrative rights on the account. The call returns an array of invitations and takes the following parameters:

Parameter

Required

Description

uuid

Yes

Unique identifier for an account.

Issue an invitation to a group

1 2 3 curl -X PUT https://api.bitbucket.org/1.0/users/{accountname}/invitations \ --header "Content-Type: application/json" \ --data '{"email":"address@example.com","group_slug":"my-group"}'

Issues an invitation to the specified account group. An invitation is a request sent to an external email address to participate in one or more of an account's groups. Any user with admin access to the account can invite someone to a group. This call requires authorization and the caller must have administrative rights on the account. This call does not validate the email address.

When making this call, you must provide a Content-Length header even if the length is 0 (zero). This call takes the following parameters:

Parameter

Required?

Description

accountname

Yes

The name of an individual or team account.

group_slug

Yes

An identifier for the group. The  slug  is an identifier constructed by the Bitbucket service. Bitbucket creates a  slug  by converting spaces to dashes and making all text lower case.

email

Yes

Name of the email address to delete.

Click here to expand...

This call returns OK if the invitation succeeds.

1 OK

Otherwise, it returns Not Found if specified group_slug does not exist.

1 Not found

DELETE pending invitations by email address

1 2 3 curl -X DELETE https://api.bitbucket.org/1.0/users/{accountname}/invitations \ --header "Content-Type: application/json" \ --data '{"email":"address@example.com"}'

Deletes any pending invitations on a team or individual account for a particular email address. An invitation is a request sent to an external email address to participate one or more of an account's groups. If a email is invited on multiple groups, the invitation is removed from all groups. This call requires authorization and the caller must have administrative rights on the account. This call takes the following parameters:

Parameter

Required?

Description

accountname

Yes

The name of an individual or team account.

email

Yes

Name of the email address to delete.

 

Upon success, this call returns 204 NO CONTENT.

DELETE pending invitation by group 

1 2 3 curl -X DELETE https://api.bitbucket.org/1.0/users/{accountname}/invitations \ --header "Content-Type: application/json" \ --data '{"email":"address@example.com","group_slug":"my-group"}'

Deletes a pending invitation for a particular email on account's group. An invitation is a request sent to an external email address to participate one or more of an account's groups. Any user with admin access to the account can invite someone to a group. This call requires authorization and the caller must have administrative rights on the account. This call takes the following parameters:

Parameter

Required?

Description

accountname

Yes

The name of an individual or team account.

group_slug

Yes

An identifier for the group. The  slug  is an identifier constructed by the Bitbucket service. Bitbucket creates a  slug  by converting spaces to dashes and making all text lower case.

email

Yes

Name of the email address to delete.

Upon success, this call returns 204 NO CONTENT.

 

Still need help?

The Atlassian Community is here for you.