account Resource

Overview

This resource returns a user structure and the repositories array associated with an existing account.

GET the account profile

Gets the information associated with an account. The information returned by this call depends on whether you authenticate with the  accountname:password  combination or not. An an unauthenticated gets a user's basic information and lists any public repositories for that user. This call takes the following parameters:

Parameter Required Description
accountname Yes The name of an individual or team account. You can also use a validated email address in place of the accountname value.
GET https://api.bitbucket.org/1.0/users/{accountname} 
GET https://api.bitbucket.org/1.0/users/{emailaddress}
  Response for an unauthenticated call. Click to expand...
{
    "repositories": [
        {
            "scm": "hg",
            "has_wiki": false,
            "last_updated": "2012-07-13 00:38:14",
            "creator": null,
            "created_on": "2012-07-12 01:50:25",
            "owner": "auserbb",
            "logo": null,
            "email_mailinglist": "",
            "is_mq": false,
            "size": 1198,
            "read_only": false,
            "fork_of": null,
            "mq_of": null,
            "followers_count": 0,
            "state": "available",
            "utc_created_on": "2012-07-11 23:50:25+00:00",
            "website": "",
            "description": "",
            "has_issues": false,
            "is_fork": false,
            "slug": "myowncode",
            "is_private": false,
            "name": "myowncode",
            "language": "",
            "utc_last_updated": "2012-07-12 22:38:14+00:00",
            "email_writers": true,
            "no_public_forks": false,
            "resource_uri": "/1.0/repositories/auserbb/myowncode"
        }
    ],
    "user": {
        "username": "auserbb",
        "first_name": "A",
        "last_name": "User",
        "avatar": "https://secure.gravatar.com/avatar/49bd0ee69e520e8bc250adb95710bbb8?d=identicon&s=32",
        "resource_uri": "/1.0/users/auserbb"
    }
}

An authenticated call returns the following:

  Response for an authenticated call. Click to expand...
{
    "repositories": [
        {
            "scm": "hg",
            "has_wiki": false,
            "last_updated": "2012-07-13 00:38:14",
            "creator": null,
            "created_on": "2012-07-12 01:50:25",
            "owner": "auserbb",
            "logo": null,
            "email_mailinglist": "",
            "is_mq": false,
            "size": 1198,
            "read_only": false,
            "fork_of": null,
            "mq_of": null,
            "followers_count": 0,
            "state": "available",
            "utc_created_on": "2012-07-11 23:50:25+00:00",
            "website": "",
            "description": "",
            "has_issues": false,
            "is_fork": false,
            "slug": "myowncode",
            "is_private": false,
            "name": "myowncode",
            "language": "",
            "utc_last_updated": "2012-07-12 22:38:14+00:00",
            "email_writers": true,
            "no_public_forks": false,
            "resource_uri": "/1.0/repositories/auserbb/myowncode"
        },
        {
            "scm": "git",
            "has_wiki": false,
            "last_updated": "2012-07-12 01:53:01",
            "creator": null,
            "created_on": "2012-07-12 01:53:01",
            "owner": "auserbb",
            "logo": null,
            "email_mailinglist": "",
            "is_mq": false,
            "size": 659,
            "read_only": false,
            "fork_of": {
                "scm": "git",
                "has_wiki": false,
                "last_updated": "2012-06-27 00:22:15",
                "creator": null,
                "created_on": "2012-06-27 00:22:15",
                "owner": "1team",
                "logo": null,
                "email_mailinglist": "",
                "is_mq": false,
                "size": 580,
                "read_only": false,
                "fork_of": null,
                "mq_of": null,
                "followers_count": 2,
                "state": "available",
                "utc_created_on": "2012-06-26 22:22:15+00:00",
                "website": "",
                "description": "",
                "has_issues": false,
                "is_fork": false,
                "slug": "justdirectteam",
                "is_private": true,
                "name": "justdirectteam",
                "language": "",
                "utc_last_updated": "2012-06-26 22:22:15+00:00",
                "email_writers": true,
                "no_public_forks": false,
                "resource_uri": "/1.0/repositories/1team/justdirectteam"
            },
            "mq_of": null,
            "followers_count": 1,
            "state": "available",
            "utc_created_on": "2012-07-11 23:53:01+00:00",
            "website": null,
            "description": "",
            "has_issues": false,
            "is_fork": true,
            "slug": "auser-justdirectteam",
            "is_private": true,
            "name": "auser-justdirectteam",
            "language": "",
            "utc_last_updated": "2012-07-11 23:53:01+00:00",
            "email_writers": true,
            "no_public_forks": false,
            "resource_uri": "/1.0/repositories/auserbb/auser-justdirectteam"
        }
    ],
    "user": {
        "username": "auserbb",
        "first_name": "A",
        "last_name": "User",
        "is_team": false,
        "avatar": "https://secure.gravatar.com/avatar/49bd0ee69e520e8bc250adb95710bbb8?d=identicon&s=32",
        "resource_uri": "/1.0/users/auserbb"
    }
}

GET the account plan

Gets the number of users counted against an account's plan. This call requires authentication and  takes the following parameters:

Parameter Required Description
accountname Yes The name of an individual or team account. You can also use a validated email address in place of the accountname value.
GET https://api.bitbucket.org/1.0/users/{accountname}/plan
  Click here to expand...
{
    "count": 3
}

GET the followers

Gets a count and the list of accounts following an account. Use this API to get a list of the individuals following an account. Currently, the Bitbucket UI does not list each account, it only displays the count. This call requires authentication and takes the following parameters:

Parameter Required Description
accountname Yes The name of an individual or team account. You can also use a validated email address in place of the accountname value.

Users can follow another user or a repository. Use this resource to list an account's followers. This resource does not require authentication. To list the followers of a repository, see followers Resource. For a list of repositories an individual user follows, see user Endpoint.

 GET https://api.bitbucket.org/1.0/users/{accountname}/followers
  Click here to expand...
{
    "count": 3,
    "followers": [
        {
            "username": "BitLasso",
            "first_name": "richard",
            "last_name": "howard",
            "avatar": "https://secure.gravatar.com/avatar/25324c0f7832ae4dc58548f1d9287881?d=identicon&s=32",
            "resource_uri": "/1.0/users/BitLasso"
        },
        {
            "username": "rmanalan",
            "first_name": "Rich",
            "last_name": "Manalang",
            "avatar": "https://secure.gravatar.com/avatar/7696e50d0dfde6995d3e09d9d8809d21?d=identicon&s=32",
            "resource_uri": "/1.0/users/rmanalan"
        },
        {
            "username": "sherif",
            "first_name": "Sherif",
            "last_name": "Mansour",
            "avatar": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2010/Apr/27/n620925694_5342_avatar.jpg",
            "resource_uri": "/1.0/users/sherif"
        }
    ]
}

GET the events

Gets a count and the list of events associated with an account. This call requires authentication and takes the following parameters:

Parameter Required Description
accountname Yes The name of an individual or team account. You can also use a validated email address in place of the accountname value.

Users can follow another user or a repository. Use this resource to list an account's followers. This resource does not require authentication. To list the events within a repository, see events Resource

 GET https://api.bitbucket.org/1.0/users/{accountname}/events
  Click here to expand...
{
  "count": 2,
  "events": [
    {
      "node": null,
      "description": null,
      "repository": {},
      "created_on": "2013-02-20 00:15:53",
      "user": {},
      "utc_created_on": "2013-02-19 23:15:53+00:00",
      "event": "pullrequest_fulfilled"
    },
    {
      "node": null,
      "description": null,
      "repository": {},
      "created_on": "2013-02-20 00:15:08",
      "user": {},
      "utc_created_on": "2013-02-19 23:15:08+00:00",
      "event": "pullrequest_fulfilled"
    }
  ]
}

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