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

# Find Portal Verification Codes

> Search connected email mailboxes for recent portal verification codes. Requires portal:verify. This does not request a code or mark an email read. Only use a code automatically when status is found. Other matches are candidates for human review. Delivery preferences are optional and stored in customer metadata. Responses must not be cached or logged.

**Scope:** `portal:verify`


## OpenAPI

````yaml /openapi/portals.yaml post /v1/portal-tasks/{portalTaskId}/verification-code
openapi: 3.1.0
info:
  title: Portal Tasks API
  version: '1.0'
servers:
  - url: https://api.monk.com
    description: Production
  - url: https://api-sandbox.monk.com
    description: Sandbox
security:
  - bearerAuth: []
paths:
  /v1/portal-tasks/{portalTaskId}/verification-code:
    post:
      summary: Find Portal Verification Codes
      description: >-
        Search connected email mailboxes for recent portal verification codes.
        Requires portal:verify. This does not request a code or mark an email
        read. Only use a code automatically when status is found. Other matches
        are candidates for human review. Delivery preferences are optional and
        stored in customer metadata. Responses must not be cached or logged.
      operationId: lookupPortalVerificationCode
      parameters:
        - name: portalTaskId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                portalConfigurationId:
                  type: string
                  format: uuid
                  description: >-
                    A portal configuration belonging to a customer linked to
                    this task.
                useSavedPreferences:
                  type: boolean
                  default: false
                  description: >-
                    Explicitly narrow delivery method, mailbox and recipient
                    using optional saved preferences. Otherwise search all
                    authorized connected email mailboxes.
                requestedAfter:
                  type: string
                  format: date-time
                  description: >-
                    Time the login challenge was requested. Must be within the
                    last ten minutes.
                lookbackMinutes:
                  type: integer
                  enum:
                    - 3
                    - 10
                  default: 3
            example:
              portalConfigurationId: 00000000-0000-4000-8000-000000000001
              lookbackMinutes: 3
      responses:
        '200':
          description: Lookup outcome. An incomplete search never confirms a code.
          headers:
            Cache-Control:
              schema:
                type: string
                const: private, no-store
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - candidates
                  - searchedAfter
                  - checkedAt
                  - incomplete
                properties:
                  status:
                    type: string
                    enum:
                      - found
                      - pending
                      - ambiguous
                      - not_configured
                      - unavailable
                  searchedAfter:
                    type: string
                    format: date-time
                  checkedAt:
                    type: string
                    format: date-time
                  incomplete:
                    type: boolean
                  candidates:
                    type: array
                    maxItems: 20
                    items:
                      type: object
                      required:
                        - code
                        - profile
                        - mailboxId
                        - destination
                        - receivedAt
                        - messageId
                      properties:
                        code:
                          type: string
                          description: Transient verification code. Preserve leading zeros.
                        profile:
                          type: string
                          enum:
                            - coupa
                            - sap_ariba
                            - piee
                            - supplier
                        mailboxId:
                          type: string
                          format: uuid
                        destination:
                          type: string
                        receivedAt:
                          type: string
                          format: date-time
                        messageId:
                          type: string
        '400':
          description: Invalid search time window
        '401':
          description: Invalid or missing API key
        '403':
          description: API key lacks portal:verify
        '404':
          description: Task or selected portal configuration not found in this tenant
        '422':
          description: Invalid request body
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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