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

# Fetch Cases

> ```
GET api/v1/case-management/listing
```


<Note>
  Use `view=me` to retrieve only cases assigned to the authenticated user, or `view=all` to retrieve all cases for your business. Pass `analytics=true` to include a summary of open, overdue, resolved, and closed counts alongside the results.
</Note>


## OpenAPI

````yaml case-management-model.json GET /case-management/listing
openapi: 3.1.0
info:
  title: Sigma Case Management API
  description: Case Management API documentation
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://sigmaprod.sabipay.com/api/v1
    description: Production
  - url: https://sigmastaging.sabipay.com/api/v1
    description: Sandbox
security:
  - ApiKey: []
    ApiSecret: []
paths:
  /case-management/listing:
    get:
      summary: Fetch Cases
      description: >-
        Returns a paginated list of cases for your business. Supports filtering
        by status, priority, and assignee, sorting, free-text search, and
        optional analytics totals.
      parameters:
        - name: view
          in: query
          required: true
          schema:
            type: string
            enum:
              - me
              - all
          description: >-
            `me` returns only cases assigned to the authenticated user. `all`
            returns all cases for the business.
          example: all
        - name: page
          in: query
          schema:
            type: integer
            default: 1
          description: Page number for pagination.
          example: 1
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
          description: Number of cases to return per page.
          example: 20
        - name: status
          in: query
          schema:
            type: string
            enum:
              - open
              - in progress
              - resolved
              - closed
              - escalated
          description: Filter cases by status.
          example: open
        - name: priority
          in: query
          schema:
            type: string
            enum:
              - low
              - medium
              - high
          description: Filter cases by priority.
          example: high
        - name: sort
          in: query
          schema:
            type: string
            enum:
              - due date
              - priority
              - newest
          description: Sort order for the results.
          example: newest
        - name: search
          in: query
          schema:
            type: string
          description: Free-text search across case titles and descriptions.
          example: high-value transfer
        - name: analytics
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
          description: >-
            When `true`, includes a summary of case counts and average
            completion time in the response.
          example: 'true'
        - name: recordId
          in: query
          schema:
            type: string
          description: Filter cases linked to a specific Sigma record ID.
          example: 64f1a2b3c4d5e6f7a8b9c0d1
      responses:
        '200':
          description: Cases returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchCasesResponse'
              example:
                message: Cases fetched successfully
                data:
                  cases:
                    - _id: 6801c4f2a3b7d8e9f1c2d3e4
                      module: transaction-monitoring
                      title: High-value transaction requiring review
                      description: >-
                        A transfer of ₦4,500,000 was flagged by the fraud
                        scoring engine with a score of 87.
                      priority: high
                      status: open
                      assignedTo:
                        _id: 64a9f1c2d3e4b5a6c7d8e9f0
                        firstName: Amaka
                        lastName: Osei
                      assignedBy:
                        _id: 63e8b0a1c2d3f4e5a6b7c8d9
                        firstName: Tunde
                        lastName: Adeyemi
                      dueDate: '2026-04-25T23:59:59.000Z'
                      isEscalated: false
                      createdAt: '2026-04-22T09:15:42.000Z'
                      updatedAt: '2026-04-22T09:15:42.000Z'
                    - _id: 6801d5a3b4c8e9f0a1b2c3d5
                      module: aml
                      title: PEP match — senior government official
                      description: >-
                        Customer returned a high-confidence PEP match during
                        onboarding screening. Requires enhanced due diligence
                        before account activation.
                      priority: high
                      status: in progress
                      assignedTo:
                        _id: 64a9f1c2d3e4b5a6c7d8e9f0
                        firstName: Amaka
                        lastName: Osei
                      assignedBy:
                        _id: 63e8b0a1c2d3f4e5a6b7c8d9
                        firstName: Tunde
                        lastName: Adeyemi
                      dueDate: '2026-04-24T17:00:00.000Z'
                      isEscalated: true
                      createdAt: '2026-04-21T14:30:00.000Z'
                      updatedAt: '2026-04-22T08:45:00.000Z'
                  total: 2
                  page: 1
                  limit: 20
                  analytics:
                    openCases: 1
                    overdue: 0
                    resolved: 3
                    closed: 1
                    averageCompletionTime:
                      - formatted: 1d 4h
                    resolvedTypes:
                      - _id: high
                        count: 2
                      - _id: medium
                        count: 1
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Invalid API credentials
components:
  schemas:
    FetchCasesResponse:
      type: object
      properties:
        message:
          type: string
          example: Cases fetched successfully
        data:
          $ref: '#/components/schemas/FetchCasesData'
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          example: An error occurred
    FetchCasesData:
      type: object
      properties:
        cases:
          type: array
          items:
            $ref: '#/components/schemas/Case'
        total:
          type: integer
          description: Total number of cases matching the query.
          example: 2
        page:
          type: integer
          example: 1
        limit:
          type: integer
          example: 20
        analytics:
          $ref: '#/components/schemas/CaseAnalytics'
    Case:
      type: object
      properties:
        _id:
          type: string
          description: Unique case identifier.
          example: 6801c4f2a3b7d8e9f1c2d3e4
        businessProfile:
          type: string
          description: The ID of the business this case belongs to.
          example: 63f0a1b2c3d4e5f6a7b8c9d0
        module:
          type: string
          example: transaction-monitoring
        record:
          $ref: '#/components/schemas/CaseRecord'
        title:
          type: string
          example: High-value transaction requiring review
        description:
          type: string
          example: >-
            A transfer of ₦4,500,000 was flagged by the fraud scoring engine
            with a score of 87.
        priority:
          type: string
          enum:
            - low
            - medium
            - high
          example: high
        status:
          type: string
          enum:
            - open
            - in progress
            - resolved
            - closed
          example: open
        assignedTo:
          $ref: '#/components/schemas/CaseUser'
        assignedBy:
          $ref: '#/components/schemas/CaseUser'
        dueDate:
          type: string
          format: date-time
          nullable: true
          example: '2026-04-25T23:59:59.000Z'
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/CaseTask'
        comments:
          type: array
          items:
            type: object
          example: []
        attachments:
          type: array
          items:
            type: string
          example: []
        isEscalated:
          type: boolean
          example: false
        log:
          type: array
          items:
            $ref: '#/components/schemas/CaseLogEntry'
        createdAt:
          type: string
          format: date-time
          example: '2026-04-22T09:15:42.000Z'
        updatedAt:
          type: string
          format: date-time
          example: '2026-04-22T09:15:42.000Z'
    CaseAnalytics:
      type: object
      description: Summary analytics included when `analytics=true` is passed.
      properties:
        openCases:
          type: integer
          description: Total number of open cases.
          example: 1
        overdue:
          type: integer
          description: Number of open cases that have passed their due date.
          example: 0
        resolved:
          type: integer
          description: Number of cases resolved in the current period.
          example: 3
        closed:
          type: integer
          description: Number of cases closed in the current period.
          example: 1
        averageCompletionTime:
          type: array
          items:
            type: object
            properties:
              formatted:
                type: string
                example: 1d 4h
          description: Average time from case creation to resolution.
        resolvedTypes:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
                description: Priority level.
                example: high
              count:
                type: integer
                example: 2
          description: Breakdown of resolved cases by priority.
    CaseRecord:
      type: object
      description: A reference to an existing Sigma record to link to this case.
      required:
        - id
        - type
      properties:
        id:
          type: string
          description: >-
            The ID of the linked record (e.g. a transaction ID, customer ID, or
            AML screening result ID).
          example: 64f1a2b3c4d5e6f7a8b9c0d1
        type:
          type: string
          description: The type of record being linked.
          example: transaction
        name:
          type: string
          description: A human-readable name or reference for the linked record.
          example: TXN-00123456
    CaseUser:
      type: object
      properties:
        _id:
          type: string
          example: 64a9f1c2d3e4b5a6c7d8e9f0
        firstName:
          type: string
          example: Amaka
        lastName:
          type: string
          example: Osei
    CaseTask:
      type: object
      properties:
        _id:
          type: string
          example: 6801c4f2a3b7d8e9f1c2d3e5
        text:
          type: string
          example: Review customer transaction history for the last 90 days
        status:
          type: boolean
          description: Whether the task has been completed.
          example: false
    CaseLogEntry:
      type: object
      properties:
        _id:
          type: string
          example: 6801c4f2a3b7d8e9f1c2d3e9
        status:
          type: string
          example: open
        message:
          type: string
          example: Case created
        user:
          $ref: '#/components/schemas/CaseUser'
        date:
          type: string
          format: date-time
          example: '2026-04-22T09:15:42.000Z'
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: apiKey
    ApiSecret:
      type: apiKey
      in: header
      name: apiSecret

````