invitations Endpoint

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

The invitations endpoint allows Bitbucket Cloud repository administrators to send email invitations to grant read, write, or admin privileges to a repository.  The email sent to a user includes a URL for accepting the invitation.  If the recipient already has a Bitbucket account corresponding to that email address, he or she must log into that account to access the repository. If the user does not have a Bitbucket account, the user must create a Bitbucket account before accessing the repository. An invitation endpoint has the following fields:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 "sent_on": "2011-01-11 01:03:31", "permission": "write", "invited_by": { "display_name": "Roger", "account_id": "557058:ec25fab6-5844-4b65-a30c-677ecd2ce3b5", "is_team": false, "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/CS-5.png", "resource_uri": "/api/1.0/users/roger", "nickname": "roger", "uuid": "{746046c8-9d5a-4b86-a414-485452396952}" }, "repository": { "website": "", "read_only": false, "has_wiki": true, "last_updated": "2010-12-24 05:26:20", "name": "ramjet", "language": "", "deleted": false, "is_mq": false, "mq_of": null, "created_on": "2010-12-24 05:26:20", "fork_of": null, "email_writers": true, "size": 4096, "owner": "roger", "has_issues": true, "no_public_forks": false, "email_mailinglist": "", "is_fork": false, "slug": "ramjet", "is_private": true, "description": "" }, "email": "john@example.com" }

These fields are the following:

Field

Description

sent_on

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

permission

Permission granted for the repository. This is one of:

  • read

  • write

  • admin

invited by

The user profile of the user issuing the invitation.

repository

The repository to which the user was invited.

email

The external email on the invite

POST send an invite

1 POST https://api.bitbucket.org/1.0/invitations/{accountname}/{repo_slug} --data 'permission={permission}' --data 'email={email_address}'

Invites a user to a repository. This method supports the following parameters:

Parameter

Required?

Description

accountname

Yes

The team or individual account.

repo_slug

Yes

A repository belonging to the account.

email_address

Yes

The email recipient.

permission

Yes

The permission the recipient is granted.

To send an invitation to grant write privileges to john@example.com for the repository roger/ramjet:

1 $ curl --user roger:password --request POST https://api.bitbucket.org/1.0/invitations/roger/ramjet --data permission=write --data email=john@example.com

The response would look like this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 { "sent_on": "2011-01-11 01:03:31", "permission": "write", "invited_by": { "display_name": "Roger", "account_id": "557058:ec25fab6-5844-4b65-a30c-677ecd2ce3b5", "is_team": false, "avatar": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/CS-5.png", "resource_uri": "/api/1.0/users/roger", "nickname": "roger", "uuid": "{746046c8-9d5a-4b86-a414-485452396952}" }, "repository": { "website": "", "read_only": false, "has_wiki": true, "last_updated": "2010-12-24 05:26:20", "name": "ramjet", "language": "", "deleted": false, "is_mq": false, "mq_of": null, "created_on": "2010-12-24 05:26:20", "fork_of": null, "email_writers": true, "size": 4096, "owner": "roger", "has_issues": true, "no_public_forks": false, "email_mailinglist": "", "is_fork": false, "slug": "ramjet", "is_private": true, "description": "" }, "email": "john@example.com" }

Additional Help