---
title: "List snippets in a workspace"
method: GET
path: "/snippets/{workspace}"
tags: ["Snippets"]
---

# List snippets in a workspace

`GET /snippets/{workspace}`

Returns a paginated list of snippets owned by `{workspace}`.

To limit the set of returned snippets, apply the
`?role=[owner|contributor|member]` query parameter where the roles are
defined as follows:

* `owner`: snippets owned by `{workspace}` that also belong to the current user
    (only returns results when `{workspace}` is the current user's personal workspace)
* `contributor`: snippets owned by `{workspace}` that the current user is watching,
    plus any owned by `{workspace}` and the current user
* `member`: all snippets owned by `{workspace}` if the current user is a member,
    otherwise only those the current user is watching

When no role is specified, all snippets owned by `{workspace}` are returned.

If the current user is not a member of `{workspace}`, only public snippets are
returned regardless of role.

The returned response is a normal paginated JSON list. This endpoint
only supports `application/json` responses and no
`multipart/form-data` or `multipart/related`. As a result, it is not
possible to include the file contents.

## Query parameters

- `role` 'owner' | 'contributor' | 'member'

## Response `200`

A paginated list of snippets.

- PaginatedSnippets — A paginated list of snippets.
  - `size` integer — 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.
  - `page` integer — Page number of the current results. This is an optional element that is not provided in all responses.
  - `pagelen` integer — 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.
  - `next` string, uri — 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.
  - `previous` string, uri — 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.
  - `values` Snippet[]
    - `type` string, required
    - `id` integer
    - `title` string
    - `scm` 'git' — The DVCS used to store the snippet.
    - `created_on` string, date-time
    - `updated_on` string, date-time
    - `owner` Account — An account object.
      - `type` string, required
      - `links` AccountLinks — Links related to an Account.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `creator` Account — An account object.
      - `type` string, required
      - `links` AccountLinks — Links related to an Account.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `is_private` boolean

## Other responses

- `404` — If the user does not exist.

---

[API](https://skmtc.dev/bitbucket/apis/bitbucket-api.md) · [All operations](https://skmtc.dev/bitbucket/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bitbucket/bitbucket-api/revisions/952ded611d03/schema)
