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

# List Snippets

> Retrieves a paginated list of snippets.



## OpenAPI

````yaml GET /api/pub/wa/snippet/list
openapi: 3.1.0
info:
  title: AdsEra REST API
  description: >-
    Welcome to the AdsEra REST API. Use our API to integrate powerful,
    multi-channel communication (Email and WhatsApp) directly into your
    applications. Automate transactional messages, trigger marketing campaigns,
    manage your audience, and track performance programmatically.
  contact:
    name: Shubham
    email: shubham@adsera.in
  version: 1.0.0
servers:
  - url: https://app.adsera.in
    description: Production Server
security:
  - AppIdAuth: []
    AppSecretAuth: []
paths:
  /api/pub/wa/snippet/list:
    get:
      tags:
        - Snippets
      summary: List Snippets
      description: Retrieves a paginated list of snippets.
      parameters:
        - name: page
          in: query
          required: false
          description: The page number for pagination.
          schema:
            type: integer
            default: 1
        - name: perPage
          in: query
          required: false
          description: The number of items to return per page.
          schema:
            type: integer
            default: 10
        - name: search
          in: query
          required: false
          description: Search query for snippet name.
          schema:
            type: string
        - name: messageType
          in: query
          required: false
          description: Filter by message type.
          schema:
            type: string
            enum:
              - text
              - image
              - audio
              - document
              - video
              - sticker
              - location
              - contacts
              - interactive
      responses:
        '200':
          description: A paginated list of snippets.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnippetListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - AppIdAuth: []
          AppSecretAuth: []
components:
  schemas:
    SnippetListResponse:
      type: object
      properties:
        status:
          type: integer
          example: 200
        success:
          type: boolean
          example: true
        error:
          type: 'null'
          example: null
        snippets:
          type: array
          items:
            $ref: '#/components/schemas/Snippet'
        totalCount:
          type: integer
          example: 100
        currentPage:
          type: integer
          example: 1
        perPage:
          type: integer
          example: 10
    Snippet:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        messageType:
          type: string
          enum:
            - text
            - image
            - audio
            - document
            - video
            - sticker
            - location
            - contacts
            - interactive
        text:
          type: object
          properties:
            body:
              type: string
            preview_url:
              type: boolean
        image:
          type: object
          properties:
            link:
              type: string
            caption:
              type: string
        video:
          type: object
          properties:
            link:
              type: string
            caption:
              type: string
        audio:
          type: object
          properties:
            link:
              type: string
        document:
          type: object
          properties:
            link:
              type: string
            caption:
              type: string
            filename:
              type: string
        sticker:
          type: object
          properties:
            link:
              type: string
        location:
          $ref: '#/components/schemas/Location'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/Contact'
        interactive:
          $ref: '#/components/schemas/Interactive'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
    Location:
      type: object
      description: Location message payload.
      properties:
        longitude:
          type: number
          description: Longitude in degrees.
        latitude:
          type: number
          description: Latitude in degrees.
        name:
          type: string
          description: Name of the location.
        address:
          type: string
          description: Address of the location.
      required:
        - longitude
        - latitude
    Contact:
      type: object
      description: Contact card payload.
      properties:
        addresses:
          type: array
          items:
            type: object
            properties:
              street:
                type: string
              city:
                type: string
              state:
                type: string
              zip:
                type: string
              country:
                type: string
              country_code:
                type: string
              type:
                type: string
        birthday:
          type: string
          description: YYYY-MM-DD
        name:
          type: object
          properties:
            formatted_name:
              type: string
            first_name:
              type: string
            last_name:
              type: string
            middle_name:
              type: string
            suffix:
              type: string
            prefix:
              type: string
          required:
            - formatted_name
        phones:
          type: array
          items:
            type: object
            properties:
              phone:
                type: string
              type:
                type: string
              wa_id:
                type: string
        emails:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
              type:
                type: string
        org:
          type: object
          properties:
            company:
              type: string
            department:
              type: string
            title:
              type: string
        urls:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              type:
                type: string
      required:
        - name
    Interactive:
      type: object
      description: Interactive message payload.
      properties:
        type:
          type: string
          enum:
            - button
            - list
            - product
            - product_list
            - catalog_message
            - flow
            - voice_call
        header:
          type: object
          properties:
            type:
              type: string
              enum:
                - text
                - video
                - image
                - document
            text:
              type: string
              maxLength: 60
            video:
              type: object
              properties:
                link:
                  type: string
                caption:
                  type: string
            image:
              type: object
              properties:
                link:
                  type: string
                caption:
                  type: string
            document:
              type: object
              properties:
                link:
                  type: string
                caption:
                  type: string
                filename:
                  type: string
        body:
          type: object
          properties:
            text:
              type: string
              maxLength: 1024
        footer:
          type: object
          properties:
            text:
              type: string
              maxLength: 60
        action:
          type: object
          properties:
            buttons:
              type: array
              maxItems: 3
              items:
                type: object
                properties:
                  type: reply
                  reply:
                    type: object
                    properties:
                      title:
                        type: string
                        maxLength: 20
                      id:
                        type: string
                        maxLength: 256
                    required:
                      - title
                      - id
                required:
                  - type
                  - reply
            button:
              type: string
              maxLength: 20
            sections:
              type: array
              minItems: 1
              maxItems: 10
              items:
                type: object
                properties:
                  title:
                    type: string
                    maxLength: 24
                  rows:
                    type: array
                    maxItems: 10
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          maxLength: 200
                        title:
                          type: string
                          maxLength: 24
                        description:
                          type: string
                          maxLength: 72
                      required:
                        - id
                        - title
                  product_items:
                    type: array
                    maxItems: 30
                    items:
                      type: object
                      properties:
                        product_retailer_id:
                          type: string
                      required:
                        - product_retailer_id
            catalog_id:
              type: string
            product_retailer_id:
              type: string
            name:
              type: string
            parameters:
              type: object
      required:
        - type
        - action
  responses:
    Unauthorized:
      description: Unauthorized. The API keys are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            success: false
            error: 'Unauthorized: Please provide valid API credentials.'
    InternalServerError:
      description: Internal Server Error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your application's unique ID.
    AppSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret
      description: Your application's secret key.

````