> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snackbase.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List Collections

> List all collections with pagination and search.

Only superadmins (users in the system account) can list collections.



## OpenAPI

````yaml get /api/v1/collections
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/collections:
    get:
      tags:
        - collections
      summary: List Collections
      description: |-
        List all collections with pagination and search.

        Only superadmins (users in the system account) can list collections.
      operationId: list_collections_api_v1_collections_get
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page
          description: Page number
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Items per page
            default: 25
            title: Page Size
          description: Items per page
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            description: Field to sort by
            default: created_at
            title: Sort By
          description: Field to sort by
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort order: asc or desc'
            default: desc
            title: Sort Order
          description: 'Sort order: asc or desc'
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search term for name or ID
            title: Search
          description: Search term for name or ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionListResponse'
        '403':
          description: Superadmin access required
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CollectionListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CollectionListItem'
          type: array
          title: Items
          description: List of collections
        total:
          type: integer
          title: Total
          description: Total number of collections
        page:
          type: integer
          title: Page
          description: Current page number
        page_size:
          type: integer
          title: Page Size
          description: Number of items per page
        total_pages:
          type: integer
          title: Total Pages
          description: Total number of pages
      type: object
      required:
        - items
        - total
        - page
        - page_size
        - total_pages
      title: CollectionListResponse
      description: Paginated list of collections.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CollectionListItem:
      properties:
        id:
          type: string
          title: Id
          description: Collection ID (UUID)
        name:
          type: string
          title: Name
          description: Collection name
        table_name:
          type: string
          title: Table Name
          description: Physical table name in database
        fields_count:
          type: integer
          title: Fields Count
          description: Number of fields in the schema
        records_count:
          type: integer
          title: Records Count
          description: Number of records in the collection
          default: 0
        has_public_access:
          type: boolean
          title: Has Public Access
          description: True if any rule is public (empty string)
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the collection was created
      type: object
      required:
        - id
        - name
        - table_name
        - fields_count
        - created_at
      title: CollectionListItem
      description: Collection item for list view.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````