---
title: "List Snippets"
url: "https://nov18-dev.movespot.fyi/apis/portal-2/versions/891fea74-0458-4c01-8657-e3e36ffacc99/operations/list-portal-snippets"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/portal-2/versions/891fea74-0458-4c01-8657-e3e36ffacc99.md

# List Snippets

`GET` `/api/v3/snippets`

Operation ID: `list-portal-snippets`

Returns a paginated list of snippets for the portal. Each snippet has a name, title, and content. Public snippets will be returned for non-authenticated users, while both private and public snippets will be returned for authenticated users.

## Query parameters

- `sort` (string, optional) - Sorts a collection of portal snippets. Supported sort attributes are: - created_at - updated_at - name - title - visibility
- `page[size]` (integer, optional) - The maximum number of items to include per page. The last page of a collection may include fewer items.
- `page[number]` (integer, optional) - Determines which page of the entities to retrieve.
- `filter[title][eq]` (string, optional) - Filter by direct equality comparison of the title property with a supplied value.
- `filter[title]` (string, optional) - Filter by direct equality comparison (short-hand) of the title property with a supplied value.
- `filter[title][contains]` (string, optional) - Filter by contains comparison of the title property with a supplied substring
- `filter[name][eq]` (string, optional) - Filter by direct equality comparison of the name property with a supplied value.
- `filter[name]` (string, optional) - Filter by direct equality comparison (short-hand) of the name property with a supplied value.
- `filter[visibility][eq]` (string, optional) - Filter by whether the pages returned are public or private. Private pages are only accessible to authenticated users. For authenticated users, results will include both public and private pages if not specified.
- `filter[visibility]` (string, optional) - Filter (short-hand) by whether the pages returned are public or private. Private pages are only accessible to authenticated users. For authenticated users, results will include both public and private pages if not specified.

## Responses

- `200` - Paginated list of portal snippets

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Portal
  version: 3.3.1
paths:
  /api/v3/snippets:
    get:
      operationId: list-portal-snippets
      summary: List Snippets
      description: Returns a paginated list of snippets for the portal. Each snippet
        has a name, title, and content. Public snippets will be returned for
        non-authenticated users, while both private and public snippets will be
        returned for authenticated users.
      parameters:
        - $ref: "#/components/parameters/SortPortalSnippets"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageNumber"
        - $ref: "#/components/parameters/FilterByTitleEquality"
        - $ref: "#/components/parameters/FilterByTitleEqualityShort"
        - $ref: "#/components/parameters/FilterByTitleContains"
        - $ref: "#/components/parameters/FilterByNameEquality"
        - $ref: "#/components/parameters/FilterByNameEqualityShort"
        - $ref: "#/components/parameters/FilterByVisibilityEquality"
        - $ref: "#/components/parameters/FilterByVisibilityEqualityShort"
      responses:
        "200":
          $ref: "#/components/responses/ListPortalSnippetsResponse"
      security:
        - portalAccessToken: []
        - {}
      tags:
        - Content
security:
  - portalAccessToken: []
  - {}
components:
  parameters:
    SortPortalSnippets:
      name: sort
      description: |
        Sorts a collection of portal snippets. Supported sort attributes are:
          - created_at
          - updated_at
          - name
          - title
          - visibility
      in: query
      required: false
      schema:
        type: string
    PageSize:
      name: page[size]
      description: The maximum number of items to include per page. The last page of a
        collection may include fewer items.
      required: false
      in: query
      allowEmptyValue: true
      schema:
        type: integer
        example: 10
    PageNumber:
      name: page[number]
      description: Determines which page of the entities to retrieve.
      required: false
      in: query
      allowEmptyValue: true
      schema:
        type: integer
        example: 1
    FilterByTitleEquality:
      name: filter[title][eq]
      description: Filter by direct equality comparison of the title property with a
        supplied value.
      in: query
      required: false
      schema:
        type: string
        example: Good Page
    FilterByTitleEqualityShort:
      name: filter[title]
      description: Filter by direct equality comparison (short-hand) of the title
        property with a supplied value.
      in: query
      required: false
      schema:
        type: string
        example: Good Page
    FilterByTitleContains:
      name: filter[title][contains]
      description: Filter by contains comparison of the title property with a supplied
        substring
      in: query
      required: false
      schema:
        type: string
        example: Good
    FilterByNameEquality:
      name: filter[name][eq]
      description: Filter by direct equality comparison of the name property with a
        supplied value.
      in: query
      required: false
      schema:
        type: string
        example: good service
    FilterByNameEqualityShort:
      name: filter[name]
      description: Filter by direct equality comparison (short-hand) of the name
        property with a supplied value.
      in: query
      required: false
      schema:
        type: string
        example: good service
    FilterByVisibilityEquality:
      name: filter[visibility][eq]
      description: Filter by whether the pages returned are public or private. Private
        pages are only accessible to authenticated users. For authenticated
        users, results will include both public and private pages if not
        specified.
      in: query
      required: false
      schema:
        type: string
        example: public
        enum:
          - public
          - private
    FilterByVisibilityEqualityShort:
      name: filter[visibility]
      description: Filter (short-hand) by whether the pages returned are public or
        private. Private pages are only accessible to authenticated users. For
        authenticated users, results will include both public and private pages
        if not specified.
      in: query
      required: false
      schema:
        type: string
        example: private
        enum:
          - public
          - private
  responses:
    ListPortalSnippetsResponse:
      description: Paginated list of portal snippets
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ListPortalSnippets"
          examples:
            ListPortalSnippetResponseExample1:
              value:
                data:
                  - id: 582b9327-3eba-4bfe-9438-6066840dbbca
                    title: Home
                    name: snip1
                    visibility: public
                    description: Welcome snippet
                    created_at: 2021-09-01T00:00:00Z
                    updated_at: 2021-09-01T00:00:00Z
                meta:
                  page:
                    size: 10
                    total: 1
                    number: 1
  schemas:
    ListPortalSnippets:
      description: A paginated list of snippets for the portal
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/PortalSnippetInfo"
        meta:
          $ref: "#/components/schemas/PaginatedMeta"
      additionalProperties: false
      title: ListPortalSnippets
    PortalSnippetInfo:
      description: A single snippet for the portal
      type: object
      properties:
        id:
          $ref: "#/components/schemas/SnippetId"
        name:
          $ref: "#/components/schemas/SnippetName"
        title:
          $ref: "#/components/schemas/SnippetTitle"
        visibility:
          $ref: "#/components/schemas/Visibility"
        description:
          $ref: "#/components/schemas/Description"
        created_at:
          $ref: "#/components/schemas/CreatedAt"
        updated_at:
          $ref: "#/components/schemas/UpdatedAt"
      additionalProperties: false
      required:
        - id
        - name
        - title
        - visibility
        - created_at
        - updated_at
      title: PortalSnippetInfo
    PaginatedMeta:
      description: returns the pagination information
      type: object
      properties:
        page:
          $ref: "#/components/schemas/PageMeta"
      required:
        - page
      title: PaginatedMeta
    SnippetId:
      description: The unique identifier of the snippet
      type: string
      format: uuid
      example: 582b9327-3eba-4bfe-9438-6066840dbbcb
      title: SnippetId
    SnippetName:
      description: The name of the snippet (no leading slash)
      type: string
      example: my-snippet
      title: SnippetName
    SnippetTitle:
      description: The title of the snippet
      type: string
      example: My Snippet
      title: SnippetTitle
    Visibility:
      description: Whether the page or snippet is public or private. Private pages and
        snippets are only accessible to authenticated users.
      type: string
      example: public
      enum:
        - public
        - private
      title: Resource Public Visibility
    Description:
      type: string
      example: A custom page about developer portals
      title: ResourceDescription
    CreatedAt:
      description: An ISO-8601 timestamp representation of entity creation date.
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      readOnly: true
    UpdatedAt:
      description: An ISO-8601 timestamp representation of entity update date.
      type: string
      format: date-time
      example: 2022-11-04T20:10:06.927Z
      readOnly: true
    PageMeta:
      description: Contains pagination query parameters and the total number of
        objects returned.
      type: object
      properties:
        number:
          type: number
          example: 1
        size:
          type: number
          example: 10
        total:
          type: number
          example: 100
      required:
        - number
        - size
        - total
  securitySchemes:
    portalAccessToken:
      type: apiKey
      in: cookie
      name: portalaccesstoken
      description: >
        The Developer portal cookie is meant to be used by the Developer API to
        authenticate with.
```
