> ## 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 Macros

> List all SQL macros.

Accessible by all authenticated users.



## OpenAPI

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

        Accessible by all authenticated users.
      operationId: list_macros_api_v1_macros_get
      parameters:
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            default: 0
            title: Skip
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MacroResponse'
                title: Response List Macros Api V1 Macros Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    MacroResponse:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Unique name of the macro
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the macro
        sql_query:
          type: string
          title: Sql Query
          description: The SQL SELECT query
        parameters:
          items:
            type: string
          type: array
          title: Parameters
          description: List of parameter names
        id:
          type: integer
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
      type: object
      required:
        - name
        - sql_query
        - id
        - created_at
        - updated_at
      title: MacroResponse
      description: Schema for macro response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````