openapi: 3.0.4
info:
  title: Signicat Monitor
  description: This API enables monitoring of organization through registries.
  contact:
    name: Signicat
    url: https://developer.signicat.com/docs/support/
    email: support@signicat.com
  version: v1
paths:
  /info/monitor/{monitorId}:
    get:
      tags:
        - Monitor Endpoints
      summary: Get monitor
      description: This endpoint allows to get monitor by Id from the system.
      parameters:
        - name: monitorId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorDto'
              example:
                id: 402d1ce2-ce71-4f9b-b252-3fa90fef0de4
                accountId: a-ppge-c5jsmhR5fLM3jxBY8H1v
                name: Monitor Name
                sources:
                  - name: trapets
                profiles:
                  - screening
                description: Monitor that reach source
                size: 10
                entityType: Organisation
                createdAt: '2025-09-11T11:27:11.3126593Z'
                isEnabled: true
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
  /info/monitor:
    post:
      tags:
        - Monitor Endpoints
      summary: Create monitor
      description: >-
        This endpoint allows the creation of a new monitor resource in the
        system.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMonitorRequestDto'
            example:
              name: Monitor Name
              description: Monitor that reach source
              entityType: Organisation
              sources:
                - name: trapets
              profiles:
                - screening
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal Server Error
  /info/monitor/{monitorId}/organisations:
    post:
      tags:
        - Organisation Endpoints
      summary: Add organisation
      description: >-
        This endpoint allows the creation of a new organisation to monitor in
        the system.
      parameters:
        - name: monitorId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/OrganisationRequestDto'
            example:
              - organisationNumber: '23432342'
                source: Trapets
                country: NOR
                companyName: Signicat
                referenceKey: 402d1ce2-ce71-4f9b-b252-3fa90fef0de4
                externalId: null
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal Server Error
  /info/monitor/{monitorId}/organisations/{referenceKey}:
    get:
      tags:
        - Organisation Endpoints
      summary: Get organisation
      description: >-
        This endpoint allows to get the organisation last snapshot by monitor id
        and reference key from the system.
      parameters:
        - name: monitorId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: referenceKey
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationDataDto'
              example:
                country: NOR
                name: Organisation Name
                added: '2025-09-10T11:27:11.316009Z'
                lastUpdate: '2025-09-11T11:27:11.3160111Z'
                organisationNumber: '12345678'
                operationalStatus: null
                externalId: 1454-15
                alias: Organisation Alias
                legalForm: Other
                screening:
                  matchStrength: 100
                  listType: SANCTION
                  source: EU_GLOBAL
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
    delete:
      tags:
        - Organisation Endpoints
      summary: Delete organisation associated to a monitor
      description: >-
        This endpoint allows to delete the organisation from the system in one
        specific monitor.
      parameters:
        - name: monitorId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: referenceKey
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
  /info/monitor/{monitorId}/organisations/{referenceKey}/changes:
    get:
      tags:
        - Organisation Endpoints
      summary: Get organisation changes by monitor and reference key
      description: >-
        This endpoint allows to get the organisation all changes by monitor id
        and reference key from the system.
      parameters:
        - name: monitorId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: referenceKey
          in: path
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          schema:
            type: integer
            format: int32
            default: 1000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationChangesDtoPagedCollection'
              example:
                size: 3
                nextCursor: 2
                limit: 1000
                items:
                  - id: 1
                    referenceKey: 402d1ce2-ce71-4f9b-b252-3fa90fef0de4
                    monitorId: bc8b6383-ed53-4ffe-a847-2e0072f5a23d
                    detected: '2025-09-11T11:27:11.317656Z'
                    created: '2025-09-10T17:27:11.3176563Z'
                    changes:
                      - profile: screening
                        attribute: CompanyName
                        action: Update
                        new: New Name
                        old: Previous Name
                      - profile: screening
                        attribute: MatchStrength
                        action: Update
                        new: '100'
                        old: '60'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
  /info/monitor/{monitorId}/organisations/changes:
    get:
      tags:
        - Organisation Endpoints
      summary: Get organisation changes from monitor
      description: >-
        This endpoint allows to get the organisation all changes by monitor id
        from the system.
      parameters:
        - name: monitorId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: cursor
          in: query
          schema:
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          schema:
            type: integer
            format: int32
            default: 1000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationChangesDtoPagedCollection'
              example:
                size: 3
                nextCursor: 2
                limit: 1000
                items:
                  - id: 1
                    referenceKey: 402d1ce2-ce71-4f9b-b252-3fa90fef0de4
                    monitorId: 8a1d17e9-626d-44b0-9eaa-0935bf2c8fe1
                    detected: '2025-09-11T11:27:11.3183971Z'
                    created: '2025-09-10T17:27:11.3183975Z'
                    changes:
                      - profile: screening
                        attribute: CompanyName
                        action: Update
                        new: New Name
                        old: Previous Name
                      - profile: screening
                        attribute: MatchStrength
                        action: Update
                        new: '100'
                        old: '60'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
components:
  schemas:
    ChangesDto:
      required:
        - attribute
        - profile
      type: object
      properties:
        profile:
          type: string
          nullable: true
        attribute:
          type: string
          nullable: true
        action:
          type: string
          nullable: true
        new:
          nullable: true
        old:
          nullable: true
      additionalProperties: false
    CreateMonitorRequestDto:
      type: object
      properties:
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        entityType:
          type: string
          nullable: true
        sources:
          type: array
          items:
            $ref: '#/components/schemas/SourcesDto'
          nullable: true
        profiles:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    MonitorDto:
      required:
        - entityType
      type: object
      properties:
        id:
          type: string
          nullable: true
        accountId:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        sources:
          type: array
          items:
            $ref: '#/components/schemas/SourcesDto'
          nullable: true
        profiles:
          type: array
          items:
            type: string
          nullable: true
        description:
          type: string
          nullable: true
        size:
          type: integer
          format: int32
        entityType:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        isEnabled:
          type: boolean
      additionalProperties: false
    OrganisationChangesDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        referenceKey:
          type: string
          nullable: true
        monitorId:
          type: string
          format: uuid
        detected:
          type: string
          format: date-time
        created:
          type: string
          format: date-time
        changes:
          type: array
          items:
            $ref: '#/components/schemas/ChangesDto'
          nullable: true
      additionalProperties: false
    OrganisationChangesDtoPagedCollection:
      type: object
      properties:
        size:
          type: integer
          format: int32
        nextCursor:
          type: integer
          format: int32
          nullable: true
        limit:
          type: integer
          format: int32
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrganisationChangesDto'
          nullable: true
      additionalProperties: false
    OrganisationDataDto:
      type: object
      properties:
        country:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        added:
          type: string
          format: date-time
          nullable: true
        lastUpdate:
          type: string
          format: date-time
          nullable: true
        organisationNumber:
          type: string
          nullable: true
        operationalStatus:
          type: string
          nullable: true
        externalId:
          type: string
          nullable: true
        alias:
          type: string
          nullable: true
        legalForm:
          type: string
          nullable: true
        screening:
          $ref: '#/components/schemas/RiskScreening'
      additionalProperties: false
    OrganisationRequestDto:
      required:
        - organisationNumber
      type: object
      properties:
        organisationNumber:
          type: string
          nullable: true
        source:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        companyName:
          type: string
          nullable: true
        referenceKey:
          type: string
          nullable: true
        externalId:
          type: string
          nullable: true
      additionalProperties: false
    RiskScreening:
      type: object
      properties:
        matchStrength:
          type: integer
          format: int32
          nullable: true
        listType:
          type: string
          nullable: true
        source:
          type: string
          nullable: true
      additionalProperties: false
    SourcesDto:
      required:
        - name
      type: object
      properties:
        name:
          type: string
          nullable: true
      additionalProperties: false
