openapi: 3.0.2
info:
  title: InvestigationAction7.0.2
  description: | 
    POST API allowing the requestor to perform an action. When a requestor has made an investigation request (POSTs part of separate use case specific contracts), he has the possibility to take certain actions on it at a later stage. 
    
    Examples of these actions are: 
    
    (a) send a reminder in case the responder has not answered to the investigation request, 
    
    (b) object to a response received from the responder or 
    
    (c) request to cancel a previously sent request for example in case it was sent in error. 
    
    This 'action' API is a generic API that is used across all use cases for which the respective APIs are part of separate contracts. 
    
    In order for the responder to be informed that the requestor is performing an action, the responder has to query Case Management regularly with the respective GET APIs (available in the specific use case contracts as mentioned above). 

      ***Release note explaining change between version 7.0.2 and 7.0.1***
      In version 7.0.2, the requestor and responder were added in the request schema. There was also correction in the server urls adding the Sandbox server details and changing the base path from Case Manager to Case Management.
  contact:
    name: Developer Hub
    url: https://developer.swift.com
    email: developer-support@swift.com
  license:
    name: API Restricted License
    url: https://developer.swift.com/api-license
  version: 7.0.2
servers:
  - description: Test
    url: https://api-test.swiftnet.sipn.swift.com/swift-casemanagement-Investigation-Action-pilot/v7
  - description: Production
    url: https://api.swiftnet.sipn.swift.com/swift-casemanagement-Investigation-Action/v7
  - description: Sandbox
    url: https://sandbox.swift.com/swift-casemanagement-Investigation-Action/v7
paths:
  /investigations-actions:
    post:
      tags:
      - create investigation action request
      summary: This POST API allows the requestor to perform an investigation action. See more info above line 5.
      description: This POST API allows the requestor to perform an investigation action. See more info above line 5.
      operationId: createInvestigationAction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvestigationActionRequest3'
            examples:
              investigation_action_request_to_obtain_status_from_responder:
                $ref: '#/components/examples/investigation_action_request_to_obtain_status_from_responder'
              investigation_action_request_to_close_the_investigation:  
                $ref: '#/components/examples/investigation_action_request_to_close_the_investigation' 
              investigation_action_request_to_object_to_received_answer: 
                $ref: '#/components/examples/investigation_action_request_to_object_to_received_answer' 
              investigation_action_request_to_obtain_status_from_responder_RQFI_use_case: 
                $ref: '#/components/examples/investigation_action_request_to_obtain_status_from_responder_RQFI_use_case'
      responses:
        '200':
          description: This is the output received by the requestor creating an investigation action request. 
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvestigationActionRequestOutput2'
              examples:
                investigation_action_request_to_obtain_status_from_responder_output:
                  $ref: '#/components/examples/investigation_action_request_to_obtain_status_from_responder_output'
                investigation_action_request_to_close_the_investigation_output:  
                  $ref: '#/components/examples/investigation_action_request_to_close_the_investigation_output' 
                investigation_action_request_to_object_to_received_answer_output: 
                  $ref: '#/components/examples/investigation_action_request_to_object_to_received_answer_output' 
                investigation_action_request_to_obtain_status_from_responder_output_RQFI_use_case: 
                  $ref: '#/components/examples/investigation_action_request_to_obtain_status_from_responder_output_RQFI_use_case' 
        '204':
          description: No Content                  
        '400':
          $ref: '#/components/responses/400-BadRequest'
        '401':
          $ref: '#/components/responses/401-Unauthorized'
        '404':
          $ref: '#/components/responses/404-NotFound'
        '429':
          $ref: '#/components/responses/429-TooManyRequests'
        '500':
          $ref: '#/components/responses/500-InternalServerError'
        '503':
          $ref: '#/components/responses/503-ServerUnavailable'
        '504':
          $ref: '#/components/responses/504-GatewayTimeout'
        default:
          $ref: '#/components/responses/500-InternalServerError'
components:
  schemas:
    ErrorMessage:
      type: object
      required:
        - code
        - severity
        - text
      properties:
        severity:
          type: string
          enum:
            - Fatal
            - Transient
            - Logic
        code:
          type: string
        text:
          type: string
        user_message:
          type: string
        more_info:
          type: string
          format: uri
    InvestigationActionReason3:
      x-MXComponent: InvestigationActionReason3
      type: object
      description: Provides information on the action reason.
      additionalProperties: false
      properties:
        reason:
          x-MXComponent: ExternalInvestigationActionReason1Code
          description: |
            Specifies the reason for the action.

            Specifies the requested action, as published in an external investigation action code set.
            External code sets can be downloaded from www.iso20022.org.
          type: string
          minLength: 1
          maxLength: 4
        additional_information:
          type: array
          maxItems: 2
          description: |
            Further details on the action reason.

            Based on datatype CASE_RestrictedFINXMax105Text: Specifies a character string with a minimum length of 1, and a maximum length of 105 characters, and limited to character set X, that is, 0-9 a-z A-Z / - ? : ( ) . , ' + .
          items:
            x-MXComponent: CASE_RestrictedFINXMax105Text
            type: string
            minLength: 1
            maxLength: 105
            pattern: ^[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+$
      required:
      - reason
    InvestigationActionRequest3:
      x-MXComponent: InvestigationActionRequest3
      type: object
      description: 'This is the request sent by the requestor performing an investigation action.'
      additionalProperties: false
      properties:
        from:
          x-MXComponent: BICFIDec2014Identifier
          description: |
            Sender BIC of the business request

            Based on datatype BICFIDec2014Identifier: Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362: 2014 - "Banking - Banking telecommunication messages - Business identifier code (BIC)".
          type: string
          pattern: ^[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}$
        message_identification:
          x-MXComponent: CASE_RestrictedFINXMax35Text
          description: |
            Point to point reference, as assigned by the requestor, and sent to the responder to unambiguously identify the message.
            Usage: In the context of Case Management, the Message Identification must be unique per EIR per sender of POST.


            Based on datatype CASE_RestrictedFINXMax35Text: Specifies a character string with a minimum length of 1, and a maximum length of 35 characters, and limited to character set X, that is, 0-9 a-z A-Z / - ? : ( ) . , ‘ + .
          type: string
          minLength: 1
          maxLength: 35
          pattern: ^[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+$
        requestor_investigation_identification:
          x-MXComponent: CASE_RestrictedFINXMax35Text
          description: |
            Unique identification, as assigned by the requestor, to unambiguously identify the investigation for the requestor.
            Usage: the requestor investigation identification should be equal to the requestor investigation identification of the investigation request for which the action is taken.

            Based on datatype CASE_RestrictedFINXMax35Text: Specifies a character string with a minimum length of 1, and a maximum length of 35 characters, and limited to character set X, that is, 0-9 a-z A-Z / - ? : ( ) . , ‘ + .
          type: string
          minLength: 1
          maxLength: 35
          pattern: ^[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+$
        eir:
          x-MXComponent: UUIDv4Identifier
          description: |
            Unique identifier to provide the end-to-end reference of an investigation.

            Usage: the EIR should be equal to the EIR of the investigation request for which the action is taken.

            Based on datatype UUIDv4Identifier: Universally Unique IDentifier (UUID) version 4, as described in IETC RFC 4122 "Universally Unique IDentifier (UUID) URN Namespace".
          type: string
          pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
        investigation_type:
          x-MXComponent: Max4Text
          description: |
            Type of investigation.

            Usage: the investigation type should be equal to the investigation type of the investigation request for which the action is taken.

            Based on datatype Max4Text: Specifies a character string with a maximum length of 4 characters.
          type: string
          minLength: 1
          maxLength: 4
        investigation_sub_type:
          x-MXComponent: Max4Text
          description: |
            Sub type of an investigation.

            Usage: The investigation sub type element may be used to identify a department within an agent to whom the investigation can be directed to, for routing purposes. It should only be used when the investigation type could logically be directed to different departments within an agent, for example a request for information.

            Based on datatype Max4Text: Specifies a character string with a maximum length of 4 characters.
          type: string
          minLength: 1
          maxLength: 4
        request_action:
          x-MXComponent: Max4Text
          description: |
            Specifies an action the responder should now take in regard to the investigation.

            Based on datatype Max4Text: Specifies a character string with a maximum length of 4 characters.
          type: string
          minLength: 1
          maxLength: 4
        request_action_reason:
          #  Provides detailed information on the action reason.
          $ref: '#/components/schemas/InvestigationActionReason3'
        requestor:
          x-MXComponent: BICFIDec2014Identifier
          description: |
            Identification of the agent or party requesting a new investigation is opened or status update for an existing investigation.

            Based on datatype BICFIDec2014Identifier: Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362: 2014 - "Banking - Banking telecommunication messages - Business identifier code (BIC)".
          type: string
          pattern: ^[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}$
        responder:
          x-MXComponent: BICFIDec2014Identifier
          description: |
            Identification of the agent or party expected to open a new investigation or provide a status update for an existing investigation.

            Based on datatype BICFIDec2014Identifier: Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362: 2014 - "Banking - Banking telecommunication messages - Business identifier code (BIC)".
          type: string
          pattern: ^[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}$
      required:
      - from
      - message_identification
      - requestor_investigation_identification
      - eir
      - investigation_type
      - request_action
      - requestor
      - responder
    InvestigationActionRequestOutput2:
      x-MXComponent: InvestigationActionRequestOutput2
      type: object
      description: 'This is the output received by the requestor creating an investigation action request.'
      additionalProperties: false
      properties:
        eir:
          x-MXComponent: UUIDv4Identifier
          description: |
            Unique identifier to provide the end-to-end reference of an investigation.

            Based on datatype UUIDv4Identifier: Universally Unique IDentifier (UUID) version 4, as described in IETC RFC 4122 "Universally Unique IDentifier (UUID) URN Namespace".
          type: string
          pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
        requestor_investigation_identification:
          x-MXComponent: CASE_RestrictedFINXMax35Text
          description: |
            Unique identification, as assigned by the requestor, to unambiguously identify the investigation for the requestor.

            Based on datatype CASE_RestrictedFINXMax35Text: Specifies a character string with a minimum length of 1, and a maximum length of 35 characters, and limited to character set X, that is, 0-9 a-z A-Z / - ? : ( ) . , ‘ + .
          type: string
          minLength: 1
          maxLength: 35
          pattern: ^[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+$
        message_identification:
          x-MXComponent: CASE_RestrictedFINXMax35Text
          description: |
            Point to point reference, as assigned by the requestor, and sent to the responder to unambiguously identify the message.
            Usage: In the context of Case Management, the Message Identification must be unique per EIR per sender of POST.


            Based on datatype CASE_RestrictedFINXMax35Text: Specifies a character string with a minimum length of 1, and a maximum length of 35 characters, and limited to character set X, that is, 0-9 a-z A-Z / - ? : ( ) . , ‘ + .
          type: string
          minLength: 1
          maxLength: 35
          pattern: ^[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+$
        investigation_type:
          x-MXComponent: Max4Text
          description: |
            Type of investigation.

            Usage: the investigation type should be equal to the investigation type of the investigation request for which the action is taken.

            Based on datatype Max4Text: Specifies a character string with a maximum length of 4 characters.
          type: string
          minLength: 1
          maxLength: 4
        investigation_sub_type:
          x-MXComponent: Max4Text
          description: |
            Sub type of an investigation.

            Usage: The investigation sub type element may be used to identify a department within an agent to whom the investigation can be directed to, for routing purposes. It should only be used when the investigation type could logically be directed to different departments within an agent, for example a request for information.

            Based on datatype Max4Text: Specifies a character string with a maximum length of 4 characters.
          type: string
          minLength: 1
          maxLength: 4
        requestor:
          x-MXComponent: BICFIDec2014Identifier
          description: |
            Identification of the agent or party requesting a new investigation is opened or status update for an existing investigation.

            Based on datatype BICFIDec2014Identifier: Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362: 2014 - "Banking - Banking telecommunication messages - Business identifier code (BIC)".
          type: string
          pattern: ^[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}$
        responder:
          x-MXComponent: BICFIDec2014Identifier
          description: |
            Identification of the agent or party expected to open a new investigation or provide a status update for an existing investigation.

            Based on datatype BICFIDec2014Identifier: Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362: 2014 - "Banking - Banking telecommunication messages - Business identifier code (BIC)".
          type: string
          pattern: ^[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}$
      required:
      - eir
      - requestor_investigation_identification
      - message_identification
      - investigation_type
      - requestor
      - responder
  responses:
    400-BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            invalid_request:
              value:
                severity: Fatal
                code: Sw.cm.InvalidRequest
                text: Invalid request
            missing_mandatory_field:
              value:
                severity: Fatal
                code: Sw.cm.MandatoryFieldMissing
                text: Mandatory field %field missing
    401-Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            from_authorization_failure:
              value:
                severity: Fatal
                code: Sw.cm.AuthorizationFailure
                text: From %From does not have the appropriate RBAC role
    404-NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            resource_not_exist:
              value:
                severity: Fatal
                code: SwAP506
                text: Resource does not exist.
    429-TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            system_too_many_requests:
              value:
                severity: Transient
                code: SwAP507
                text: 
                  Request cannot be processed at this time. Please try later.
                  (header Retry-After indicates how long to wait before making a
                  follow-up request).
    500-InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            service_internal_error:
              value:
                severity: Transient
                code: Sw.cm.InternalError
                text: Internal error
    503-ServerUnavailable:
      description: ServerUnavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
    504-GatewayTimeout:
      description: GatewayTimeout
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            service_provider_timeout:
              value:
                severity: Transient
                code: SwAP591
                text: 
                  Service provider timeout
    default:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            service_internal_error:
              value:
                severity: Transient
                code: Sw.cm.InternalError
                text: Internal error

  examples:
      investigation_action_request_to_obtain_status_from_responder:
        summary: Request sent by requestor to obtain a status from the responder on the ongoing CCNR investigation (reminder). Code RQST (request status) is used.
        value:
          from: BANKUS33XXX
          message_identification: 'MsgID1'
          requestor_investigation_identification: 'ReqInvID1'
          eir: 4d95a38a-ff11-4de2-9648-3019ec1b42b3
          investigation_type: CCNR
          request_action: RQST
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX          
      investigation_action_request_to_obtain_status_from_responder_output:
        summary: Output received by requestor related to action to obtain status from responder.
        value:
          eir: 4d95a38a-ff11-4de2-9648-3019ec1b42b3
          requestor_investigation_identification: 'ReqInvID1'
          message_identification: 'MsgID1'
          investigation_type: CCNR
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX
      investigation_action_request_to_close_the_investigation:
        summary: Request sent by requestor to ask for the closure of the UTAP investigation. Request action code RQCL (request closure) is used for example together with request action reason code IRSI (InvestigationRequestSentInError).
        value:
          from: BANKUS33XXX
          message_identification: 'MsgID2'
          requestor_investigation_identification: 'ReqInvID2'
          eir: 5d06a49a-ff11-4de2-9648-3019ec1b52b4
          investigation_type: UTAP
          request_action: RQCL
          request_action_reason:
            reason: IRSI
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX             
      investigation_action_request_to_close_the_investigation_output:
        summary: Output received by requestor related to request to close the investigation.
        value:
          eir: 5d06a49a-ff11-4de2-9648-3019ec1b52b4
          requestor_investigation_identification: 'ReqInvID2'
          message_identification: 'MsgID2'
          investigation_type: UTAP
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX   
      investigation_action_request_to_object_to_received_answer:
        summary: Request sent by requestor to object to answer received from responder on the RQFI investigation. Request action code RQOB (request objection) is used for example together with request action reason IRIC (InvestigationResponseIncomplete) and narrative providing more details.
        value:
          from: BANKUS33XXX
          message_identification: 'MsgID3'
          requestor_investigation_identification: 'ReqInvID3'
          eir: 6e17b50b-ff11-4de2-9648-3019ec1c63c5
          investigation_type: RQFI
          request_action: RQOB
          request_action_reason:
            reason: IRIC
            additional_information:
              - The response you provided does not contain the birth date of the debtor.    
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX                
      investigation_action_request_to_object_to_received_answer_output:
        summary: Output received by requestor related to request to object.
        value:
          eir: 6e17b50b-ff11-4de2-9648-3019ec1c63c5
          requestor_investigation_identification: 'ReqInvID3'
          message_identification: 'MsgID3'
          investigation_type: RQFI
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX  
      investigation_action_request_to_obtain_status_from_responder_RQFI_use_case:
        summary: Request sent by requestor to obtain a status from the responder on the ongoing RQFI investigation (reminder). Code RQST (request status) is used.
        value:
          from: BANKUS33XXX
          message_identification: 'MsgID1'
          requestor_investigation_identification: 'ReqInvID1'
          eir: 4d95a38a-ff11-4de2-9648-3019ec1b42b3
          investigation_type: RQFI
          investigation_sub_type: UTEX
          request_action: RQST
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX          
      investigation_action_request_to_obtain_status_from_responder_output_RQFI_use_case:
        summary: Output received by requestor related to action to obtain status from responder (for the RQFI use case).
        value:
          eir: 4d95a38a-ff11-4de2-9648-3019ec1b42b3
          requestor_investigation_identification: 'ReqInvID1'
          message_identification: 'MsgID1'
          investigation_type: CCNR
          investigation_sub_type: UTEX
          requestor: BANKUS33XXX
          responder: BANKFRPPXXX

  securitySchemes:
    oauthBearerToken:
      type: http
      scheme: bearer
      bearerFormat: opaque OAuth 2.0
      description: 

        The access token obtained as a result of OAuth 2.0 flows. SWIFT supports
        two OAuth grant types depending on the API service.

        * JWT-Bearer grant type [RFC 7523](https://tools.ietf.org/html/rfc7523)

        * Password grant type


        This API uses JWT-Bearer grant type.


        Please visit [SWIFT OAuth Token
        API](https://developer.swift.com/swift-oauth-token-api) page for more
        information and examples on how to generate an OAuth token.
          
        In this declaration only the basic security element to transport the
        bearer token of an OAuth2 process is declared.
security:
  - oauthBearerToken: []