{
  "openapi": "3.0.1",
  "info": {
    "title": "Outlook Inbox Reader API",
    "description": "Outlook Inbox Reader connects with Outlook API and Office 365 API to extract emails, filter by sender or date, and save bodies and attachments into structured datasets for HR, invoices, leads, support, and compliance.",
    "version": "0.0",
    "x-build-id": "9Mwj4W13PWu4UfOdw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/voyn~outlook-inbox-reader-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-voyn-outlook-inbox-reader-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/voyn~outlook-inbox-reader-api/runs": {
      "post": {
        "operationId": "runs-sync-voyn-outlook-inbox-reader-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/voyn~outlook-inbox-reader-api/run-sync": {
      "post": {
        "operationId": "run-sync-voyn-outlook-inbox-reader-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "authMode",
          "mailboxes"
        ],
        "properties": {
          "authMode": {
            "title": "Auth mode",
            "type": "string",
            "description": "Use 'application' for tenant mailboxes via client credentials, or 'delegated' to read the signed-in user's mailbox using a user access token.",
            "default": "application"
          },
          "userAccessToken": {
            "title": "User access token (delegated mode)",
            "type": "string",
            "description": "Paste a Microsoft Graph user access token with Mail.Read (and typically offline_access). Used only when authMode=delegated."
          },
          "tenantId": {
            "title": "Azure AD Tenant ID",
            "type": "string",
            "description": "Directory (tenant) ID for your Entra ID/Azure AD app (required for application mode)."
          },
          "clientId": {
            "title": "Azure App (Client) ID",
            "type": "string",
            "description": "Application (client) ID for your app registration (required for application mode)."
          },
          "clientSecret": {
            "title": "Azure Client Secret",
            "type": "string",
            "description": "Client secret value for your app registration (required for application mode)."
          },
          "mailboxes": {
            "title": "Mailbox emails (CSV or JSON)",
            "type": "string",
            "description": "List of tenant mailbox addresses to read in application mode. Accepts CSV (a@b.com,c@d.com), JSON array ([\"a@b.com\"]) or even {\"mailboxes\":[\"a@b.com\"]}. Ignored in delegated mode."
          },
          "folder": {
            "title": "Folder to read",
            "type": "string",
            "description": "Scope: 'inbox' for Inbox only, or 'all' to read all folders. Ignored in delegated mode (still reads the same mailbox, just via /me).",
            "default": "inbox"
          },
          "onlyUnread": {
            "title": "Only unread messages",
            "type": "boolean",
            "description": "If true, only unread messages are fetched.",
            "default": false
          },
          "markAsRead": {
            "title": "Mark as read after fetching",
            "type": "boolean",
            "description": "If true, marks fetched messages as read.",
            "default": false
          },
          "dateFrom": {
            "title": "Date from (ISO, inclusive)",
            "type": "string",
            "description": "Lower bound for receivedDateTime, e.g. 2025-09-01T00:00:00Z. Leave empty to ignore."
          },
          "dateTo": {
            "title": "Date to (ISO, inclusive)",
            "type": "string",
            "description": "Upper bound for receivedDateTime, e.g. 2025-09-30T23:59:59Z. Leave empty to ignore."
          },
          "senderEmails": {
            "title": "Allowed sender emails (CSV or JSON)",
            "type": "string",
            "description": "Optional filter. Exact sender email matches only. CSV or JSON array."
          },
          "subjectIncludes": {
            "title": "Subject contains (CSV or JSON)",
            "type": "string",
            "description": "Optional filter. Case-insensitive substrings; ANY match passes. CSV or JSON array."
          },
          "bodyIncludes": {
            "title": "Body contains (CSV or JSON)",
            "type": "string",
            "description": "Optional filter. Case-insensitive substrings searched in preview/full body; ANY match passes. CSV or JSON array."
          },
          "includeAttachments": {
            "title": "Download attachments",
            "type": "boolean",
            "description": "If true, downloads file attachments that satisfy the attachment filters.",
            "default": false
          },
          "attachmentNameIncludes": {
            "title": "Attachment name must include (CSV or JSON)",
            "type": "string",
            "description": "Optional filter. At least one substring must be present in the attachment name."
          },
          "attachmentNameExcludes": {
            "title": "Attachment name must NOT include (CSV or JSON)",
            "type": "string",
            "description": "Optional filter. If any substring matches, the attachment is skipped."
          },
          "attachmentExtensions": {
            "title": "Allowed attachment extensions (CSV or JSON, no dot)",
            "type": "string",
            "description": "Examples: pdf,xlsx,csv — or [\"pdf\",\"xlsx\",\"csv\"]. Empty means allow all."
          },
          "attachmentMinSizeKB": {
            "title": "Attachment min size (KB)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum file size in kilobytes to accept (0 = no minimum).",
            "default": 0
          },
          "attachmentMaxSizeKB": {
            "title": "Attachment max size (KB)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum file size in kilobytes to accept (0 = no limit).",
            "default": 0
          },
          "maxMessagesPerMailbox": {
            "title": "Max messages per mailbox",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap for messages processed per mailbox (0 = no limit).",
            "default": 500
          },
          "pageSize": {
            "title": "Page size ($top)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Microsoft Graph page size for listing messages (1–1000).",
            "default": 50
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}