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

# Retrieve messages based on filter criteria with pagination

> Retrieve messages using filters like ProductID, OrganizationID, etc. and supports pagination



## OpenAPI

````yaml specs/notification_api_docs.json get /api/v1/messages
openapi: 3.0.1
info:
  title: Notifications API
  description: Notification service for sending email, sms and push notifications
  contact: {}
  version: '1.0'
servers:
  - url: https://notification.platform.dev.ai71services.ai/
security: []
paths:
  /api/v1/messages:
    get:
      tags:
        - Track Messages APIs
      summary: Retrieve messages based on filter criteria with pagination
      description: >-
        Retrieve messages using filters like ProductID, OrganizationID, etc. and
        supports pagination
      parameters:
        - name: product_id
          in: query
          description: Product ID
          required: true
          schema:
            type: string
        - name: organization_id
          in: query
          description: Organization ID
          schema:
            type: string
        - name: user_id
          in: query
          description: User ID
          schema:
            type: string
        - name: receiver_id
          in: query
          description: Receiver ID
          schema:
            type: string
        - name: status
          in: query
          description: Status
          schema:
            type: string
        - name: created_at
          in: query
          description: Creation Date
          schema:
            type: string
            format: date-time
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            default: 1
        - name: limit
          in: query
          description: Number of items per page
          schema:
            type: integer
            default: 10
        - name: x-api-key
          in: header
          description: API key for authorization
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entity.PaginatedMessages'
        '400':
          description: Invalid query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entity.ResponseError'
        '404':
          description: No messages found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entity.ResponseError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entity.ResponseError'
components:
  schemas:
    entity.PaginatedMessages:
      type: object
      properties:
        current_page:
          type: integer
        messages:
          type: array
          items:
            $ref: '#/components/schemas/entity.Message'
        page_size:
          type: integer
        total_items:
          type: integer
        total_pages:
          type: integer
    entity.ResponseError:
      type: object
      properties:
        error:
          type: string
    entity.Message:
      required:
        - channel
        - delivery_time
        - message_id
        - organization_id
        - payload
        - product_id
        - receiver_id
        - retry_count
        - sender_id
        - status
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/constant.ChannelType'
        created_at:
          type: string
        delivery_time:
          type: string
        message_id:
          type: string
        organization_id:
          type: string
        payload:
          $ref: '#/components/schemas/entity.NotificationEvent'
        product_id:
          type: string
        receiver_id:
          type: string
        retry_count:
          type: integer
        sender_id:
          type: string
        status:
          $ref: '#/components/schemas/constant.StatusType'
        updated_at:
          type: string
    constant.ChannelType:
      type: string
      enum:
        - email
        - sms
        - push
      x-enum-varnames:
        - EmailChannel
        - SMSChannel
        - PushChannel
    entity.NotificationEvent:
      required:
        - Organization_id
        - channel
        - id
        - message
        - priority
        - product_id
        - recipient
        - retry_enabled
        - sender
      type: object
      properties:
        Organization_id:
          type: string
        channel:
          $ref: '#/components/schemas/constant.ChannelType'
        id:
          type: string
        message:
          type: string
        priority:
          $ref: '#/components/schemas/constant.PriorityType'
        product_id:
          type: string
        recipient:
          type: string
        retry_count:
          $ref: '#/components/schemas/constant.RetryCount'
        retry_enabled:
          type: boolean
        sender:
          type: string
        subject:
          type: string
        template_fields:
          $ref: '#/components/schemas/entity.TemplateFields'
    constant.StatusType:
      type: string
      enum:
        - accepted
        - rejected
        - success
        - failed
        - pending
      x-enum-varnames:
        - ACCEPTED
        - REJECTED
        - SUCCESS
        - FAILED
        - PENDING
    constant.PriorityType:
      type: string
      enum:
        - high
        - medium
        - low
      x-enum-varnames:
        - HIGH
        - MEDIUM
        - LOW
    constant.RetryCount:
      type: integer
      enum:
        - 0
        - 1
        - 2
        - 3
      x-enum-varnames:
        - InitialRequest
        - FirstRetry
        - SecondRetry
        - ThirdRetry
    entity.TemplateFields:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/entity.EmailMessage'
        template_content:
          type: array
          items:
            $ref: '#/components/schemas/entity.TemplateContent'
        template_name:
          type: string
    entity.EmailMessage:
      required:
        - from_email
        - from_name
        - merge_language
        - subject
        - to
      type: object
      properties:
        from_email:
          type: string
        from_name:
          type: string
        global_merge_vars:
          type: array
          items:
            $ref: '#/components/schemas/entity.MergeVar'
        merge_language:
          type: string
        subject:
          type: string
        to:
          type: array
          items:
            $ref: '#/components/schemas/entity.EmailRecipient'
    entity.TemplateContent:
      type: object
    entity.MergeVar:
      required:
        - content
        - name
      type: object
      properties:
        content:
          type: object
        name:
          type: string
    entity.EmailRecipient:
      required:
        - email
        - name
        - type
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        type:
          type: string

````