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

> Earliest due first.



## OpenAPI

````yaml GET /api/pub/crm/tasks
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/crm/tasks:
    get:
      tags:
        - 'CRM: Tasks & Notes'
      summary: List Tasks
      description: Earliest due first.
      operationId: crmListTasks
      parameters:
        - name: contact
          in: query
          required: false
          description: Contact id or phone.
          schema:
            type: string
        - name: deal
          in: query
          required: false
          description: Deal id.
          schema:
            type: string
        - name: status
          in: query
          required: false
          description: pending or completed.
          schema:
            type: string
            enum:
              - pending
              - completed
        - name: dueBefore
          in: query
          required: false
          description: ISO date.
          schema:
            type: string
            format: date-time
        - name: page
          in: query
          required: false
          description: Page number, from 1.
          schema:
            type: integer
            default: 1
        - name: perPage
          in: query
          required: false
          description: Items per page, at most 100.
          schema:
            type: integer
            default: 25
            maximum: 100
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/CrmTask'
                      total:
                        type: integer
                      page:
                        type: integer
                      perPage:
                        type: integer
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmError'
        '429':
          description: >-
            Rate limit: 120 requests a minute per app. See the Retry-After
            header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmError'
components:
  schemas:
    CrmTask:
      type: object
      properties:
        _id:
          type: string
          example: 6650f1c2a1b2c3d4e5f60718
        title:
          type: string
        description:
          type: string
        contact:
          type: string
          example: 6650f1c2a1b2c3d4e5f60718
        deal:
          type: string
          example: 6650f1c2a1b2c3d4e5f60718
        dueAt:
          type: string
          format: date-time
        priority:
          type: string
          enum:
            - low
            - medium
            - high
        status:
          type: string
          enum:
            - pending
            - completed
        completedAt:
          type: string
          format: date-time
        agent:
          type: object
          description: The assignee.
          properties:
            _id:
              type: string
              example: 6650f1c2a1b2c3d4e5f60718
            firstName:
              type: string
            lastName:
              type: string
            email:
              type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CrmError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Contact not found
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
  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.'
  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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.