invitations Endpoint

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:

{
    "sent_on": "2011-01-11 01:03:31",
    "permission": "write",
    "invited_by": {
        "username": "roger",
        "first_name": "Roger",
        "last_name": "Ramjet",
        "avatar": "https://secure.gravatar.com/avatar/55a1369161d3a648729b59cabf160e70?d=identicon&s=32", 
        "resource_uri": "/1.0/users/roger/"
    },
    "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

Sending an invite

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

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

 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.
emailaddress Yes The email recipient.
perm Yes The permission the recipient is granted.
POST https://api.bitbucket.org/1.0/invitations/{accountname}/{repo_slug}/{emailaddress} --data permission={perm}
  Click here to expand...
{
    "sent_on": "2011-01-11 01:03:31",
    "permission": "write",
    "invited_by": {
        "username": "roger",
        "first_name": "Roger",
        "last_name": "Ramjet",
        "avatar": "https://secure.gravatar.com/avatar/55a1369161d3a648729b59cabf160e70?d=identicon&s=32", 
        "resource_uri": "/1.0/users/roger/"
    },
    "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"
}

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport