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

# List mail filters and automations

> Filters on one folder (`space_id` and `folder`) or, without `folder`, every filter in the space. With `kind=automation`, a space's read-only automations list.



## OpenAPI

````yaml /api-reference/endpoint/m365/openapi.json get /m365/mail/filings
openapi: 3.0.3
info:
  title: quiva.ai Microsoft 365 API
  description: >-
    Outlook mail connection, mail filing into space folders, and mail
    automations. All routes act on the caller's own mailbox unless marked admin.
    The `/m365/rules` routes were withdrawn. Files and SharePoint sync routes
    are not part of this spec.
  version: 1.0.0
  contact:
    name: quiva.ai Support
    url: https://app.quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Mail
    description: The caller's Outlook mailbox connection
  - name: Mail filing
    description: Filing mail from a mailbox into space folders
  - name: Mail automations
    description: Actions that run on each filed message
  - name: Files connection
    description: Connecting a Microsoft 365 tenant for SharePoint files
  - name: SharePoint browse
    description: Browsing sites, libraries and folders with a setup session
  - name: SharePoint sync sources
    description: Syncing a SharePoint library folder into a space
paths:
  /m365/mail/filings:
    get:
      tags:
        - Mail filing
      summary: List mail filters and automations
      description: >-
        Filters on one folder (`space_id` and `folder`) or, without `folder`,
        every filter in the space. With `kind=automation`, a space's read-only
        automations list.
      operationId: listMailFilings
      parameters:
        - name: space_id
          in: query
          required: true
          description: Space id
          schema:
            type: string
        - name: folder
          in: query
          required: false
          description: Space-relative folder path
          schema:
            type: string
        - name: kind
          in: query
          required: false
          description: '`automation` for automations'
          schema:
            type: string
            enum:
              - filter
              - automation
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  filings:
                    type: array
                    items:
                      $ref: '#/components/schemas/MailFiling'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Microsoft Graph or a downstream service failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    MailFiling:
      type: object
      description: >-
        A mail filter or an automation. Matching messages from the owner's
        mailbox are saved into `folder` as .eml files, and an automation then
        runs its action on each.
      properties:
        id:
          type: string
        kind:
          type: string
          enum:
            - filter
            - automation
          description: A record with no kind is a filter
        name:
          type: string
          description: Automations only
        space_id:
          type: string
        folder:
          type: string
          description: Space-relative dot path the files land in
        entity_type:
          type: string
        entity_folder:
          type: string
          description: Contact or organisation folder the filter was set up from
        addresses:
          type: array
          items:
            type: string
        domains:
          type: array
          items:
            type: string
        subjects:
          type: array
          items:
            type: string
          description: Subject words to match
        attachments:
          type: boolean
          description: Also save attachments beside the copy
        then:
          $ref: '#/components/schemas/FilingAction'
        run_on_import:
          type: boolean
          description: Whether the action also runs for imported history. Off by default.
        mailbox_user_id:
          type: string
        mailbox_display_name:
          type: string
        created_by:
          type: string
        state:
          type: string
          enum:
            - active
            - paused
            - removed
        stopped:
          type: object
          description: Why a filter paused by itself
          properties:
            reason:
              type: string
            at:
              type: string
              format: date-time
        backfill:
          type: object
          description: History import progress
          properties:
            since:
              type: string
              format: date-time
            started_at:
              type: string
              format: date-time
            done_at:
              type: string
              format: date-time
            expected:
              type: integer
            filed:
              type: integer
            skipped:
              type: integer
            seen:
              type: integer
        last_filed_at:
          type: string
          format: date-time
        filed_count:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
    FilingAction:
      type: object
      description: An automation's action, run once per message it files.
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - agent
            - flow
            - notification
          description: >-
            `agent` asks Abbie with `prompt`, `flow` starts the flow at
            `flow_subject` with the filed copy, `notification` tells `user_ids`.
        prompt:
          type: string
        flow_subject:
          type: string
        user_ids:
          type: array
          items:
            type: string
          description: Members of the destination space
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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