Skip to content

List workspaces for user

Deprecated
GET
/workspaces

This endpoint is deprecated. Please use the supported alternative.

Returns a list of workspaces accessible by the authenticated user.

Results may be further filtered or sorted by workspace or permission by adding the following query string parameters:

  • q=slug="bbworkspace1" or q=is_private=true
  • sort=created_on

Note that the query parameter values need to be URL escaped so that = would become %3D.

The collaborator role is being removed from the Bitbucket Cloud API. For more information, see the deprecation announcement.

role
string
Allowed values: owner collaborator member
        Filters the workspaces based on the authenticated user's role on each workspace.

        * **member**: returns a list of all the workspaces which the caller is a member of
            at least one workspace group or repository
        * **collaborator**: returns a list of workspaces which the caller has write access
            to at least one repository in the workspace
        * **owner**: returns a list of workspaces which the caller has administrator access
        
q
string

Query string to narrow down the response. See filtering and sorting for details.

sort
string

Name of a response property to sort results. See filtering and sorting for details.

The list of workspaces accessible by the authenticated user.

Media type application/json
Paginated Workspaces

A paginated list of workspaces.

object
size

Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.

integer
page

Page number of the current results. This is an optional element that is not provided in all responses.

integer
>= 1
pagelen

Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.

integer
>= 1
next

Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.

string format: uri
previous

Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.

string format: uri
values
Array
0 unique items
object
type
required
string
links
object
avatar
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
html
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
members
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
owners
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
projects
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
repositories
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
snippets
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
uuid

The workspace’s immutable id.

string
name

The name of the workspace.

string
slug

The short label that identifies this workspace.

string
is_private

Indicates whether the workspace is publicly accessible, or whether it is private to the members and consequently only visible to members.

boolean
is_privacy_enforced

Indicates whether the workspace enforces private content, or whether it allows public content.

boolean
forking_mode

Controls the rules for forking repositories within this workspace.

  • allow_forks: unrestricted forking
  • internal_only: prevents forking of private repositories outside the workspace or to public repositories
string
Allowed values: allow_forks internal_only
created_on
string format: date-time
updated_on
string format: date-time
Examples
Example response
{
"pagelen": 10,
"page": 1,
"size": 1,
"values": [
{
"uuid": "{a15fb181-db1f-48f7-b41f-e1eff06929d6}",
"links": {
"owners": {
"href": "https://api.bitbucket.org/2.0/workspaces/bbworkspace1/members?q=permission%3D%22owner%22"
},
"self": {
"href": "https://api.bitbucket.org/2.0/workspaces/bbworkspace1"
},
"repositories": {
"href": "https://api.bitbucket.org/2.0/repositories/bbworkspace1"
},
"snippets": {
"href": "https://api.bitbucket.org/2.0/snippets/bbworkspace1"
},
"html": {
"href": "https://bitbucket.org/bbworkspace1/"
},
"avatar": {
"href": "https://bitbucket.org/workspaces/bbworkspace1/avatar/?ts=1543465801"
},
"members": {
"href": "https://api.bitbucket.org/2.0/workspaces/bbworkspace1/members"
},
"projects": {
"href": "https://api.bitbucket.org/2.0/workspaces/bbworkspace1/projects"
}
},
"created_on": "2018-11-14T19:15:05.058566+00:00",
"type": "workspace",
"slug": "bbworkspace1",
"is_private": true,
"name": "Atlassian Bitbucket"
}
]
}

The request wasn’t authenticated.

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}