Skip to content

List workspaces for the current user

GET
/user/workspaces

Returns an object for each workspace accessible to the caller. This object also contains details on whether the caller has admin permissions on the workspace ("administrator" = true) or not ("administrator" = false).

Queries support filtering based on administrator permissions, sorting or filtering by slug. Results can be paginated.

sort
string

Name of a response property to sort results (only slug is supported).

administrator
boolean

Filter workspaces based on which ones the caller has admin permissions or not.

The list of workspaces accessible by the authenticated user.

Media type application/json
Paginated Workspace Permissions

A paginated list of workspace permissions.

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
administrator

The permission level the user has for the workspace. True if the user is an administrator, otherwise False.

boolean
workspace
object
type
required
string
links
object
avatar
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
slug

The short label that identifies this workspace.

string
Examples
Example response
{
"pagelen": 25,
"page": 1,
"size": 1,
"values": [
{
"administrator": true,
"type": "workspace_access",
"workspace": {
"links": {
"avatar": {
"href": "https://api.bitbucket.org/workspaces/bbworkspace1/avatar/"
},
"self": {
"href": "https://api.bitbucket.org/2.0/workspaces/bbworkspace1"
}
},
"slug": "bbworkspace1",
"type": "workspace_base",
"uuid": "{470c176d-3574-44ea-bb41-89e8638bcca4}"
}
}
]
}

The request was invalid.

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": {}
}
}

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": {}
}
}