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

# Turn on/off monitoring for a given organization

> Toggle monitoring on or off for a given organization e.g. AML monitoring. Use this endpoint to either:
- Enable monitoring - System will start monitoring the organization for potential changes.
- Disable monitoring - System will no longer monitor the organization for new potential matches and will no longer send alerts.

The endpoint will effectively manage the monitoring status of the organization.
Having monitoring status of a type enabled means that the organization is being monitored for that type.
If the organization has several services under the entity, the endpoint will manage the subscription status of the organization for each service for the types requested.
Request:
The request object contains the `entityId` and list of `monitoring` that are about to toggle.
Also, the request body contains comment to be added to audit logs
Response:
The response object contains the `requestId` and the `subscriptions` that associated with the organization.
The subscriptions object contains the type of monitoring and the details of the subscriptions.
The details of the subscriptions includes:
  - service name
  - service profile ID
  - status of the subscription
  - the workflows that will be executed by the type for the service profile.



## OpenAPI

````yaml /specs/fc-kyb-bundled_generated.yaml patch /v2/organizations/{entityId}/monitor
openapi: 3.0.3
info:
  title: KYB V2 API
  version: '2.0'
  description: >-
    This is the MVP for Phase 1 APIs for native v2 KYB. Currently in
    development, changes to the structure can occur
  contact:
    name: FrankieOne
    url: https://www.frankieone.com/
    email: help@frankieone.com
servers:
  - url: https://api.uat.frankie.one
    description: UAT Environment API Base URL
  - url: https://api.frankie.one
    description: Production API Base URL
security:
  - Api-Key: []
tags:
  - name: Organizations
    description: Api calls related to Organizations
  - name: Organization Workflows
    description: Manage workflows and executions for organizations
  - name: Hosted URL
    description: Api calls related to Hosted URL
  - name: Organization Relationships
    description: Manage relationships for organizations
  - name: Organization Addresses
    description: Manage addresses for organizations
  - name: Organization Custom Attributes
    description: Manage custom attributes for organizations
  - name: Organization External References
    description: Manage external references for organizations
  - name: Organization Monitoring
    description: Manage AML monitoring for organizations
  - name: Organization Results
    description: Manage results for organizations
paths:
  /v2/organizations/{entityId}/monitor:
    parameters:
      - $ref: '#/components/parameters/entityId'
    patch:
      tags:
        - Organization Monitoring
      summary: Turn on/off monitoring for a given organization
      description: >-
        Toggle monitoring on or off for a given organization e.g. AML
        monitoring. Use this endpoint to either:

        - Enable monitoring - System will start monitoring the organization for
        potential changes.

        - Disable monitoring - System will no longer monitor the organization
        for new potential matches and will no longer send alerts.


        The endpoint will effectively manage the monitoring status of the
        organization.

        Having monitoring status of a type enabled means that the organization
        is being monitored for that type.

        If the organization has several services under the entity, the endpoint
        will manage the subscription status of the organization for each service
        for the types requested.

        Request:

        The request object contains the `entityId` and list of `monitoring` that
        are about to toggle.

        Also, the request body contains comment to be added to audit logs

        Response:

        The response object contains the `requestId` and the `subscriptions`
        that associated with the organization.

        The subscriptions object contains the type of monitoring and the details
        of the subscriptions.

        The details of the subscriptions includes:
          - service name
          - service profile ID
          - status of the subscription
          - the workflows that will be executed by the type for the service profile.
      operationId: patchOrganizationMonitoring
      parameters:
        - $ref: '#/components/parameters/Api-Key'
        - $ref: '#/components/parameters/X-Frankie-CustomerID'
        - $ref: '#/components/parameters/X-Frankie-CustomerChildID'
        - $ref: '#/components/parameters/X-Frankie-Channel'
        - $ref: '#/components/parameters/toggle-monitoring'
        - $ref: '#/components/parameters/monitoring-types'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  $ref: '#/components/schemas/Comment'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organizations-Patch-Monitoring-Response'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Invalid EntityId:
                  value:
                    errorCode: API-0400,
                    errorMsg: 'Multiple Errors: See Issues list'
                    details:
                      - issue: 'entityId in path must be of type uuid: "test"'
                        issueLocation: VALIDATE-entityId
                    requestId: 01HM5XJ7VASZ3EJMB1VQGTBFJ4
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Invalid authentication:
                  value:
                    errorCode: AUTH-0002,
                    errorMsg: Unauthorized
                    details:
                      - issue: Invalid Authentication provided. Access denied.
                        issueLocation: request
                    requestId: 00000000S6MNG7624K2TDXT1E3
                No Api-Key:
                  value:
                    errorCode: AUTH-0401
                    errorMsg: Unauthorized
                    details:
                      - issue: No api key provided. Access denied.
                        issueLocation: request
                    requestId: 00000001S6MNG7624K2TDXT1E3
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Api-Key: []
        - jwt:
            - kyb:api
components:
  parameters:
    entityId:
      name: entityId
      in: path
      schema:
        type: string
      description: Unique FrankieOne identifier for an entity
      required: true
    Api-Key:
      name: api_key
      in: header
      schema:
        type: string
        example: 245c765b124a098d09ef8765....
      description: Your API key provided by FrankieOne
      required: true
    X-Frankie-CustomerID:
      name: X-Frankie-CustomerID
      in: header
      required: true
      schema:
        type: string
        example: 12345678-1234-1234-1234-123456789012
      description: Your Customer ID provided by FrankieOne
    X-Frankie-CustomerChildID:
      name: X-Frankie-CustomerChildID
      in: header
      required: false
      schema:
        type: string
        example: 87654321-4321-4321-4321-210987654321
      description: Your Customer Child ID provided by FrankieOne
    X-Frankie-Channel:
      name: X-Frankie-Channel
      in: header
      required: false
      schema:
        type: string
      description: >-
        Open string that can be used to define the "channel" the request comes
        in from. It can potentially be used in routing and risk calculations
        upon request. Default values that can be used are:  api portal smartui
        Any alphanumeric string is supported though. Anything over 64 characters
        will be truncated.
    toggle-monitoring:
      in: query
      name: enabled
      schema:
        type: boolean
      description: >-
        Enable or disable monitoring for the given organization. Set to true to
        turn monitoring on or set to false to turn monitoring off.
      required: true
    monitoring-types:
      in: query
      name: monitoringTypes
      style: form
      explode: false
      schema:
        type: array
        items:
          $ref: '#/components/schemas/Monitoring-Type'
      description: >-
        The type of ongoing monitoring to be enabled/disabled for the given
        organization. Exclude this parameter to set the monitoring status for
        all types.
  schemas:
    Comment:
      type: object
      properties:
        commentId:
          type: string
          description: Unique identifier for the comment
          format: ulid
          example: 01K3G4CCQ3DY3B1413S19M9QW1
          readOnly: true
        text:
          type: string
          description: The text content of the comment.
          example: Update after speaking to customer over the phone directly.
        entityId:
          $ref: '#/components/schemas/Entity-ID-Writeable'
        entityType:
          $ref: '#/components/schemas/Entity-Type-Writeable'
    Organizations-Patch-Monitoring-Response:
      type: object
      properties:
        requestId:
          $ref: '#/components/schemas/Request-ID'
        monitoring:
          $ref: >-
            #/components/schemas/Organizations-Patch-Monitoring-Subscriptions-Response
    Error:
      type: object
      x-examples:
        '400':
          requestId: 0123456789ABCDEFGHIJKLMNOP
          errorCode: API-0400
          errorMsg: Parsing credentials from "<invalid>" failed, because invalid.
          httpStatusCode: 400
        '401':
          requestId: 0123456789ABCDEFGHIJKLMNOP
          errorCode: API-0401
          errorMsg: Unauthenticated due to invalid credentials.
          httpStatusCode: 401
        '409':
          requestId: 0123456789ABCDEFGHIJKLMNOP
          errorCode: API-0409
          errorMsg: Conflict.
          httpStatusCode: 409
      allOf:
        - $ref: '#/components/schemas/Error-Base'
        - type: object
          properties:
            requestId:
              $ref: '#/components/schemas/Request-ID'
    Monitoring-Type:
      type: string
      description: >-
        The type of workflow subscription. This determines which types are
        subscribing to a workflow.
      allOf:
        - $ref: '#/components/schemas/Subscription-Type'
    Entity-ID-Writeable:
      type: string
      description: >-
        Entities are assigned a FrankieOne auto-generated UUID to ensure global
        uniqueness, represented as entityId. The entityId allows for precise
        modification when required.

        To modify an entity, set the entityId of the entity you wish to update
        in an update request.
      example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
    Entity-Type-Writeable:
      type: string
      enum:
        - INDIVIDUAL
        - ORGANIZATION
        - UNKNOWN
      description: >-
        The type of entity within Frankie. This can be "INDIVIDUAL",
        "ORGANIZATION", or "UNKNOWN".
    Request-ID:
      type: string
      example: 01HN9XHZN6MGXM9JXG50K59Q85
      description: The unique request identifier for the API call made.
    Organizations-Patch-Monitoring-Subscriptions-Response:
      type: object
      properties:
        AML:
          $ref: >-
            #/components/schemas/Organizations-Patch-Monitoring-Subscriptions-AML-Response
    Error-Base:
      type: object
      properties:
        errorCode:
          type: string
        errorMsg:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/Issue'
    Subscription-Type:
      type: string
      description: >-
        Specifies the type of service profile subscription. This value
        determines the category of the service profile subscription.
      enum:
        - AML
        - ACTIVITY
    Organizations-Patch-Monitoring-Subscriptions-AML-Response:
      type: object
      description: The subscription details for AML monitoring
      properties:
        subscriptions:
          type: array
          description: The list of AML monitoring subscriptions
          items:
            $ref: >-
              #/components/schemas/Organizations-Patch-Monitoring-Subscriptions-Details-Response
        providers:
          type: array
          description: The providers that will be affected by the subscription
          items:
            type: string
            description: The provider name
        status:
          $ref: '#/components/schemas/Subscription-Status'
    Issue:
      type: object
      properties:
        issue:
          type: string
          description: Description of the issue.
        issueLocation:
          type: string
          description: The location or context where the issue was identified.
        issueType:
          type: string
          description: The type or category of the issue.
    Organizations-Patch-Monitoring-Subscriptions-Details-Response:
      type: object
      description: >-
        The subscription details for monitoring, this object is returned per
        monitoring type
      properties:
        serviceName:
          type: string
          description: The name of service associated the service profile
        serviceProfileId:
          type: string
          description: The ID of the service profile
        status:
          $ref: '#/components/schemas/Subscription-Status'
        enabledAt:
          type: string
          format: date-time
          description: The date and time when the subscription was last enabled
        enabledRequestId:
          type: string
          description: The request id when the subscription was last enabled
        enabledBy:
          type: string
          description: The username of last user who enabled the subscription
        disabledAt:
          type: string
          format: date-time
          description: The date and time when the subscription was last disabled
        disabledRequestId:
          type: string
          description: The request id when the subscription was last disabled
        disabledBy:
          type: string
          description: The username of last user who disabled the subscription
        workflows:
          type: array
          description: >-
            The workflows that will be executed by the type for the service
            profile
          items:
            type: object
            properties:
              workflowName:
                type: string
                description: Name of the workflow.
              workflowId:
                type: string
                description: Unique ID of the workflow.
              lifecyclePhase:
                $ref: '#/components/schemas/Workflow-LifecyclePhaseEnum'
    Subscription-Status:
      type: string
      description: |-
        Indicates the current status of the subscription.

          - `ENABLED`: The subscription is active and operational.
          - `DISABLED`: The subscription is inactive and not operational.
      enum:
        - ENABLED
        - DISABLED
    Workflow-LifecyclePhaseEnum:
      type: string
      description: >
        Specifies the lifecycle phase of the customer in which this workflow is
        executed:
          - ONBOARDING: Workflow is in the onboarding stage.
          - MONITORING: Workflow is in the monitoring stage.
          - REFRESH: Workflow is in the refresh stage.
          - OTHER: Workflow is in another stage.
      enum:
        - ONBOARDING
        - MONITORING
        - REFRESH
        - OTHER
      default: OTHER
  securitySchemes:
    Api-Key:
      type: apiKey
      in: header
      name: api_key
      description: ''
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````