Salv aml API

This section contains all operations managing the state of persons and transactions. There are three endpoints for creating or modifying a person, make sure to choose the right one for your task: * [Create new person](#tag/aml/operation/addPersonV2) will create a new person if a person with the same ID does not already exist in our system. * [Patch person](#tag/aml/operation/patchPersonV2) partially updates an existing person if this person exists in the system. A request to this endpoint will only update or add attributes which are provided in the request. Use this endpoint to update selected attributes of a person or to add new attributes without changing attributes not present in the request payload. This endpoint may also be used to update person type. * [Update person](#tag/aml/operation/updatePersonV2) updates an existing person if this person exists in the system. A request to this endpoint must contain both person type and attributes. A request to this endpoint overwrites both person type and attributes with the values given in the request. ID of a person or a transaction is a case-sensitive text field in our system. Salv does not transform the ID in any way. Only the following characters are allowed: Alphanumerics `a-zA-Z0-9`, hyphens `-`, underscores `_`, colons `:`, dots `.`. All requests must use ISO-8601 formatted timestamps. That includes defined fields (e.g. timestamp property in "Create new transaction" request) and custom key-value pairs (e.g. under attributes property in "Create new person" request). For any data passed in person or transaction objects, the keys must adhere to the following rules: - It must not contain a "**.**" - It must not consist of whitespaces ## Example: Uploading person and transaction This example shows how to upload data to use it later for monitoring or screening. ### 1. Add a person if not already added Add a new person, according to the documentation at [addPerson(POST)](#operation/addPersonV2). If the person has already been added to Salv, then skip this step. #### With cURL ``` curl --request POST \ --url https://app.salv.com/api/v2/persons \ --header 'Authorization: Bearer {yourBearerToken}' \ --header 'Content-Type: application/json' \ --data '{ "id": "bbt12345", "type": "INDIVIDUAL", "attributes": { "first_name": "Sheldon", "last_name": "Cooper", "dob": "1983-05-12", "city": "Pasadena", "street_address": "2311 North Los Robles Avenue", "country": "US", "onboarding_date": "2019-04-16", "email": "sheldon.cooper@gmail.com", "phone_number": "+1582693582", "id_document": "passport", "id_country": "US", "gender": "F" } }' ``` #### With Python Requests ``` import requests url = "https://app.salv.com/api/v2/persons" payload = { "id": "bbt12345", "type": "INDIVIDUAL", "attributes": { "first_name": "Sheldon", "last_name": "Cooper", "dob": "1983-05-12", "city": "Pasadena", "street_address": "2311 North Los Robles Avenue", "country": "US", "onboarding_date": "2019-04-16", "email": "sheldon.cooper@gmail.com", "phone_number": "+1582693582", "id_document": "passport", "id_country": "US", "gender": "F" } } headers = { "Content-Type": "application/json", "Authorization": "{yourBearerToken}" } response = requests.request("POST", url, json=payload, headers=headers) print(response.text) ``` ### 2. Add a transaction Add a new transaction, according to the documentation at [addTransaction(POST)](#operation/addTransaction). #### With cURL ``` curl --request POST \ --url https://app.salv.com/api/v1/persons/bbt12345/transactions \ --header 'Authorization: Bearer {yourBearerToken}' \ --header 'Content-Type: application/json' \ --data '{ "id": "aeio-1234567", "attributes": { "sender_name": "Sheldon Cooper", "sender_account": "GB123456789", "receiver_name": "Leonard Hofstadter", "receiver_account": "DE987654321", "amount": "15678.34", "type": "wire_transfer", "direction": "I", "timestamp": "2022-01-20T08:48:39.000Z" } }' ``` #### With Python Requests ``` import requests url = "https://app.salv.com/api/v1/persons/bbt12345/transactions" payload = { "id": "aeio-1234567", "attributes": { "sender_name": "Sheldon Cooper", "sender_account": "GB123456789", "receiver_name": "Leonard Hofstadter", "receiver_account": "DE987654321", "amount": "15678.34", "type": "wire_transfer", "direction": "I", "timestamp": "2022-01-20T08:48:39.000Z" } } headers = { "Content-Type": "application/json", "Authorization": "{yourBearerToken}" } response = requests.request("POST", url, json=payload, headers=headers) print(response.text) ```

OpenAPI Specification

salv-aml-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Salv alert aml API
  description: '# Introduction

    Welcome to the Salv AML API documentation.


    The Salv API is built on HTTP. Our API is RESTful. It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. You can use your favorite HTTP/REST library for your programming language to use Salv API.


    API definition to import into Postman can be downloaded at https://docs.salv.com/api/public.yaml

    '
  version: 1.0.9
  contact:
    name: Support
    email: support@salv.com
  x-logo:
    url: salv.svg
    altText: Salv API
servers:
- url: https://{environment}.salv.com/api/
  variables:
    environment:
      default: app
      enum:
      - app
      - demo
      description: 'Select environment:

        * `app` - Production

        * `demo` - Sandbox

        '
security:
- OAuth2:
  - aml
tags:
- name: aml
  x-displayName: Persons & Transactions
  description: "This section contains all operations managing the state of persons and transactions.\n\nThere are three endpoints for creating or modifying a person, make sure to choose the right one for your task:\n* [Create new person](#tag/aml/operation/addPersonV2) will create a new person if a person with the same ID does not already exist in our system. \n* [Patch person](#tag/aml/operation/patchPersonV2) partially updates an existing person if this person exists in the system. A request to this endpoint will only update or add \nattributes which are provided in the request. Use this endpoint to update selected \nattributes of a person or to add new attributes without changing attributes not present in the request payload. This endpoint may also be used to update person type.\n* [Update person](#tag/aml/operation/updatePersonV2) updates an existing person if this person exists in the system. A request to this endpoint must contain both person type and attributes. \nA request to this endpoint overwrites both person type and attributes with the values given in the request.\n\nID of a person or a transaction is a case-sensitive text field in our system. Salv does not transform the ID in any way. Only the following characters are allowed: Alphanumerics `a-zA-Z0-9`, hyphens `-`, underscores `_`, colons `:`, dots `.`.\n\nAll requests must use ISO-8601 formatted timestamps. That includes defined fields (e.g. timestamp property in \"Create new transaction\" request) and custom key-value pairs (e.g. under attributes property in \"Create new person\" request).\n\nFor any data passed in person or transaction objects, the keys must adhere to the following rules:  \n- It must not contain a \"**.**\"\n- It must not consist of whitespaces\n\n## Example: Uploading person and transaction\nThis example shows how to upload data to use it later for monitoring or screening.\n\n### 1. Add a person if not already added\nAdd a new person, according to the documentation at [addPerson(POST)](#operation/addPersonV2).\n\nIf the person has already been added to Salv, then skip this step.\n\n#### With cURL\n```\ncurl --request POST \\\n  --url https://app.salv.com/api/v2/persons \\\n  --header 'Authorization: Bearer {yourBearerToken}' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"id\": \"bbt12345\",\n  \"type\": \"INDIVIDUAL\",\n  \"attributes\": {\n    \"first_name\": \"Sheldon\",\n    \"last_name\": \"Cooper\",\n    \"dob\": \"1983-05-12\",\n    \"city\": \"Pasadena\",\n    \"street_address\": \"2311 North Los Robles Avenue\",\n    \"country\": \"US\",\n    \"onboarding_date\": \"2019-04-16\",\n    \"email\": \"sheldon.cooper@gmail.com\",\n    \"phone_number\": \"+1582693582\",\n    \"id_document\": \"passport\",\n    \"id_country\": \"US\",\n    \"gender\": \"F\"\n  }\n}'\n```\n\n#### With Python Requests\n```\nimport requests\n\nurl = \"https://app.salv.com/api/v2/persons\"\n\npayload = {\n    \"id\": \"bbt12345\",\n    \"type\": \"INDIVIDUAL\",\n    \"attributes\": {\n        \"first_name\": \"Sheldon\",\n        \"last_name\": \"Cooper\",\n        \"dob\": \"1983-05-12\",\n        \"city\": \"Pasadena\",\n        \"street_address\": \"2311 North Los Robles Avenue\",\n        \"country\": \"US\",\n        \"onboarding_date\": \"2019-04-16\",\n        \"email\": \"sheldon.cooper@gmail.com\",\n        \"phone_number\": \"+1582693582\",\n        \"id_document\": \"passport\",\n        \"id_country\": \"US\",\n        \"gender\": \"F\"\n    }\n}\nheaders = {\n    \"Content-Type\": \"application/json\",\n    \"Authorization\": \"{yourBearerToken}\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)\n```\n### 2. Add a transaction\nAdd a new transaction, according to the documentation at [addTransaction(POST)](#operation/addTransaction).\n\n#### With cURL\n```\ncurl --request POST \\\n  --url https://app.salv.com/api/v1/persons/bbt12345/transactions \\\n  --header 'Authorization: Bearer {yourBearerToken}' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"id\": \"aeio-1234567\",\n  \"attributes\": {\n    \"sender_name\": \"Sheldon Cooper\",\n    \"sender_account\": \"GB123456789\",\n    \"receiver_name\": \"Leonard Hofstadter\",\n    \"receiver_account\": \"DE987654321\",\n    \"amount\": \"15678.34\",\n    \"type\": \"wire_transfer\",\n    \"direction\": \"I\",\n    \"timestamp\": \"2022-01-20T08:48:39.000Z\"\n  }\n}'\n```\n\n#### With Python Requests\n```\nimport requests\n\nurl = \"https://app.salv.com/api/v1/persons/bbt12345/transactions\"\n\npayload = {\n    \"id\": \"aeio-1234567\",\n    \"attributes\": {\n        \"sender_name\": \"Sheldon Cooper\",\n        \"sender_account\": \"GB123456789\",\n        \"receiver_name\": \"Leonard Hofstadter\",\n        \"receiver_account\": \"DE987654321\",\n        \"amount\": \"15678.34\",\n        \"type\": \"wire_transfer\",\n        \"direction\": \"I\",\n        \"timestamp\": \"2022-01-20T08:48:39.000Z\"\n    }\n}\nheaders = {\n    \"Content-Type\": \"application/json\",\n    \"Authorization\": \"{yourBearerToken}\"\n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\nprint(response.text)\n```\n"
paths:
  /v2/persons:
    post:
      tags:
      - aml
      summary: Create new person
      description: Attributes supported maximum nesting depth is 2.
      operationId: addPersonV2
      x-codeSamples:
      - lang: curl
        label: cURL
        source: "curl -X POST \"https://app.salv.com/api/v2/persons\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"id\": \"person-123\",\n    \"type\": \"INDIVIDUAL\",\n    \"attributes\": {\n      \"first_name\": \"John\",\n      \"last_name\": \"Doe\",\n      \"dob\": \"1990-01-15\",\n      \"country\": \"US\"\n    }\n  }'\n"
      - lang: Python
        source: "import requests\n\nresponse = requests.post(\n    \"https://app.salv.com/api/v2/persons\",\n    headers={\"Authorization\": f\"Bearer {access_token}\"},\n    json={\n        \"id\": \"person-123\",\n        \"type\": \"INDIVIDUAL\",\n        \"attributes\": {\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"dob\": \"1990-01-15\",\n            \"country\": \"US\"\n        }\n    }\n)\n"
      - lang: JavaScript
        label: Node.js
        source: "const response = await fetch(\"https://app.salv.com/api/v2/persons\", {\n  method: \"POST\",\n  headers: {\n    \"Authorization\": `Bearer ${accessToken}`,\n    \"Content-Type\": \"application/json\"\n  },\n  body: JSON.stringify({\n    id: \"person-123\",\n    type: \"INDIVIDUAL\",\n    attributes: {\n      first_name: \"John\",\n      last_name: \"Doe\",\n      dob: \"1990-01-15\",\n      country: \"US\"\n    }\n  })\n});\n"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: models.yaml#/components/schemas/ApiCreatePersonV2
            examples:
              Individual:
                value:
                  id: bbt12345
                  type: INDIVIDUAL
                  attributes:
                    first_name: Sheldon
                    last_name: Cooper
                    dob: '1983-05-12'
                    city: Pasadena
                    street_address: 2311 North Los Robles Avenue
                    country: US
                    onboarding_date: '2019-04-16T11:10:55.123456Z'
                    email: sheldon.cooper@gmail.com
                    phone_number: '+1582693582'
                    id_document: passport
                    id_country: US
                    gender: F
              Individual_with_nested_attributes:
                value:
                  id: bbt12345
                  type: INDIVIDUAL
                  attributes:
                    first_name: Sheldon
                    last_name: Cooper
                    dob: '1983-05-12'
                    city: Pasadena
                    street_address: 2311 North Los Robles Avenue
                    country: US
                    onboarding_date: '2019-04-16T11:10:55.123456Z'
                    email: sheldon.cooper@gmail.com
                    phone_number: '+1582693582'
                    id_document: passport
                    id_country: US
                    gender: F
                    contracts:
                    - id: 1
                      loan_type: loan_agreement
                      status: active
                      start_date: '2022-01-20T08:48:39Z'
                    - id: 2
                      loan_type: lease
                      status: inactive
                      start_date: '2020-01-20T08:48:39Z'
                      end_date: '2022-01-20T08:48:39Z'
              Legal:
                value:
                  id: bbt12346
                  type: LEGAL
                  attributes:
                    company_name: The Cheesecake factory
                    onboarding_date: '2020-06-12T11:10:55.123456Z'
                    country: FR
                    city: Pasadena
                    street_address: 2311 North Los Robles Avenue
                    email: info@cheescakefactory.com
                    phone_number: '+1472583692'
                    industry: restaurant
                    business_reg_number: 12-3456789
                    expected_monthly_turnover: '100000'
              Legal_with_nested_attributes:
                value:
                  id: bbt12347
                  type: LEGAL
                  attributes:
                    company_name: Footprints on the Moon
                    onboarding_date: '2021-05-24T11:10:55.123456Z'
                    country: CA
                    city: Pasadena
                    street_address: 2311 North Los Robles Avenue
                    email: footprintsonthemoon@gmail.com
                    phone_number: '+1582472952'
                    industry: entertainment
                    shareholders:
                    - id: shrhldr-1
                      first_name: Howard
                      last_name: Wolowitz
                      dob: '1988-07-06'
                      citizenship: IL
                    - id: shrhldr-2
                      first_name: Raj
                      last_name: Koothrappali
                      dob: '1989-05-06'
                      citizenship: IN
                    - id: shrhldr-3
                      company_name: BIG Invest LLC
                      country: GB
                    business_reg_number: 98-7654321
                    expected_monthly_turnover: '10000'
      responses:
        '200':
          description: Created person
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '422':
          description: Person exists
  /v2/persons/search:
    post:
      tags:
      - aml
      summary: Fetch all persons
      operationId: findAllPersons
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: models.yaml#/components/schemas/ApiPersonSearchQuery
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: models.yaml#/components/schemas/PersonsPage
  /v2/persons/{personId}:
    patch:
      tags:
      - aml
      summary: Patch person
      description: "Partial person update. Only attributes present in request will be added/updated. Attributes supported maximum\nnesting depth is 2.\n\nThis endpoint also supports optional person type update.\n\nIn case the operation is successful there will be an empty response.\n\n### Examples\n#### cURL\n```\n$ curl --request PATCH \\\n  --url https://app.salv.com/api/v2/persons/{personId} \\\n  --header 'Authorization: Bearer {yourBearerToken}' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"type\": \"LEGAL\",\n    \"attributes\": {\n      \"company_name\": \"Best Vacuum Cleaning Ltd.\"\n    }\n  }'\n```\n\n#### With Python Requests\n```\nimport requests\n\npayload = {\n  \"attributes\": {\n    \"phone_number\": \"(198)747-8241x9209\",\n    \"shareholders\": [{\n      \"id\": 1,\n      \"name\": \"Rose Doe\",\n      \"dob\": \"1970-01-01\",\n      \"email\": \"rose.doe@gmail.com\"\n    }]\n  }\n}\n\nresponse = requests.post(\n   'https://app.salv.com/api/v2/persons/{personId}',\n   auth = ({clientId}, {clientSecret}),\n   json = payload)\n\nresponse.raise_for_status()\n```\n"
      operationId: patchPersonV2
      parameters:
      - name: personId
        in: path
        description: External unique person ID
        required: true
        schema:
          type: string
          minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: models.yaml#/components/schemas/ApiPatchPersonV2
            examples:
              Individual:
                value:
                  attributes:
                    last_name: Doe
                    dob: '1970-01-01'
              Legal:
                value:
                  attributes:
                    phone_number: (198)747-8241x9209
                    shareholders:
                    - id: 1
                      name: Rose Doe
                      dob: '1970-01-01'
                      email: rose.doe@gmail.com
              TypeChange:
                value:
                  type: LEGAL
                  attributes:
                    companyName: Very Good Vacuum Cleaning Ltd.
      responses:
        '200':
          description: Successfully updated person
        '400':
          description: Invalid input
        '401':
          description: Unauthorized
        '404':
          description: Person not found
    put:
      tags:
      - aml
      summary: Update person
      description: "Person update. Attributes in the request will be used to replace existing ones and type will be updated. \nAttributes supported maximum nesting depth is 2.\n\nIn case the operation is successful there will be an empty response.\n\n### Examples\n#### cURL\n```\n$ curl --request PUT \\\n  --url https://app.salv.com/api/v2/persons/{personId} \\\n  --header 'Authorization: Bearer {yourBearerToken}' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"type\": \"LEGAL\",\n    \"attributes\": {\n      \"company_name\": \"Best Vacuum Cleaning Ltd.\"\n    }\n  }'\n```\n\n#### With Python Requests\n```\nimport requests\n\npayload = {\n  \"type\": \"INDIVIDUAL\",\n  \"attributes\": {\n    \"phone_number\": \"(198)747-8241x9209\",\n    \"shareholders\": [{\n      \"id\": 1,\n      \"name\": \"Rose Doe\",\n      \"dob\": \"1970-01-01\",\n      \"email\": \"rose.doe@gmail.com\"\n    }]\n  }\n}\n\nresponse = requests.post(\n   'https://app.salv.com/api/v2/persons/{personId}',\n   auth = ({clientId}, {clientSecret}),\n   json = payload)\n\nresponse.raise_for_status()\n```\n"
      operationId: updatePersonV2
      parameters:
      - name: personId
        in: path
        description: External unique person ID
        required: true
        schema:
          type: string
          minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: models.yaml#/components/schemas/ApiUpdatePersonV2
            examples:
              Individual:
                value:
                  type: INDIVIDUAL
                  attributes:
                    last_name: Doe
                    dob: '1970-01-01'
              Legal:
                value:
                  type: LEGAL
                  attributes:
                    phone_number: (198)747-8241x9209
                    shareholders:
                    - id: 1
                      name: Rose Doe
                      dob: '1970-01-01'
                      email: rose.doe@gmail.com
      responses:
        '200':
          description: Updated person
        '400':
          description: Invalid input
        '401':
          description: Unauthorized
        '404':
          description: Person not found
  /v1/persons:
    get:
      deprecated: true
      tags:
      - aml
      summary: Fetch all persons
      operationId: findAllPersonsDeprecated
      description: NB! If there are more than 10000 results then the API shows the number of total results as 10000 and you can't paginate past the 10000th result.
      parameters:
      - $ref: models.yaml#/components/parameters/pageParam
      - $ref: models.yaml#/components/parameters/sizeParam
      - $ref: models.yaml#/components/parameters/queryParam
      - name: attribute
        in: query
        description: Search query attribute
        required: false
        schema:
          type: string
          minLength: 1
      - name: category
        in: query
        description: Person category
        required: false
        schema:
          type: string
          enum:
          - COUNTERPARTY
          - CUSTOMER
      - $ref: models.yaml#/components/parameters/orderByParam
      - $ref: models.yaml#/components/parameters/orderDirectionParam
      - $ref: models.yaml#/components/parameters/searchOperator
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: models.yaml#/components/schemas/PersonsPage
              examples:
                result:
                  value:
                    number: 0
                    size: 20
                    total: 1
                    content:
                    - id: bbt12345
                      type: INDIVIDUAL
                      attributes:
                        first_name: Sheldon
                        last_name: Cooper
                        dob: '1983-05-12'
                        city: Pasadena
                        street_address: 2311 North Los Robles Avenue
                        country: US
                        onboarding_date: '2019-04-16'
                        email: sheldon.cooper@gmail.com
                        phone_number: '+1582693582'
                        id_document: passport
                        id_country: US
                        gender: F
                      status: NEW
                      createdTime: '2019-08-24T14:15:22Z'
                      snoozeConfiguration:
                        id: 1
                        personId: 1
                        createdBy:
                          id: 1
                          email: dana.aml@starbank.com
                          name: Dana Cummings
                        createdTime: '2019-08-24T14:15:22Z'
                        endTime: '2019-08-24T14:15:22Z'
                        amount: 0
                        totalAmount: 0
                        note: {}
                      category: CUSTOMER
    post:
      tags:
      - aml
      summary: Create new person (v1)
      description: Use [Create new person v2](#tag/aml/operation/addPersonV2) instead.
      operationId: addPerson
      deprecated: true
      requestBody:
        required: true
        content:
          application/json:
            examples:
              Individual:
                value:
                  id: bbt12345
                  type: INDIVIDUAL
                  attributes:
                    first_name: Sheldon
                    last_name: Cooper
                    dob: '1983-05-12'
                    city: Pasadena
                    street_address: 2311 North Los Robles Avenue
                    country: US
                    onboarding_date: '2019-04-16T11:10:55.123456Z'
                    email: sheldon.cooper@gmail.com
                    phone_number: '+1582693582'
                    id_document: passport
                    id_country: US
                    gender: F
              Legal:
                value:
                  id: bbt12346
                  type: LEGAL
                  attributes:
                    company_name: The Cheesecake factory
                    onboarding_date: '2020-06-12T11:10:55.123456Z'
                    country: FR
                    city: Pasadena
                    street_address: 2311 North Los Robles Avenue
                    email: info@cheescakefactory.com
                    phone_number: '+1472583692'
                    industry: restaurant
                    business_reg_number: 12-3456789
                    expected_monthly_turnover: '100000'
            schema:
              $ref: models.yaml#/components/schemas/ApiCreatePerson
      responses:
        '200':
          description: Created person
          content:
            application/json:
              schema:
                $ref: models.yaml#/components/schemas/ApiPerson
              examples:
                Individual:
                  value:
                    id: bbt12345
                    type: INDIVIDUAL
                    attributes:
                      first_name: Sheldon
                      last_name: Cooper
                      dob: '1983-05-12'
                      city: Pasadena
                      street_address: 2311 North Los Robles Avenue
                      country: US
                      onboarding_date: '2019-04-16'
                      email: sheldon.cooper@gmail.com
                      phone_number: '+1582693582'
                      id_document: passport
                      id_country: US
                      gender: F
                Legal:
                  value:
                    id: bbt12346
                    type: LEGAL
                    attributes:
                      company_name: The Cheesecake factory
                      onboarding_date: '2020-06-12'
                      country: FR
                      city: Pasadena
                      street_address: 2311 North Los Robles Avenue
                      email: info@cheescakefactory.com
                      phone_number: '+1472583692'
                      industry: restaurant
                      business_reg_number: 12-3456789
                      expected_monthly_turnover: '100000'
        '400':
          description: Bad request
          content:
            application/text:
              schema:
                type: string
                description: Error message
        '401':
          description: Unauthorized
          content:
            application/text:
              schema:
                type: string
                description: Error message
        '422':
          description: Person exists
          content:
            application/text:
              schema:
                type: string
                description: Error message
  /v1/persons/{personId}:
    get:
      tags:
      - aml
      summary: Fetch person by id
      operationId: findPersonById
      x-codeSamples:
      - lang: curl
        label: cURL
        source: "curl -X GET \"https://app.salv.com/api/v1/persons/bbt12345\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\"\n"
      - lang: Python
        source: "import requests\n\nperson_id = \"bbt12345\"\nresponse = requests.get(\n    f\"https://app.salv.com/api/v1/persons/{person_id}\",\n    headers={\"Authorization\": f\"Bearer {access_token}\"}\n)\nperson = response.json()\n"
      - lang: JavaScript
        label: Node.js
        source: "const personId = \"bbt12345\";\nconst response = await fetch(\n  `https://app.salv.com/api/v1/persons/${personId}`,\n  {\n    headers: { \"Authorization\": `Bearer ${accessToken}` }\n  }\n);\nconst person = await response.json();\n"
      parameters:
      - name: personId
        in: path
        description: ID of person to return
        required: true
        schema:
          type: string
          minLength: 1
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: models.yaml#/components/schemas/ApiPerson
              examples:
                Individual:
                  value:
                    id: bbt12345
                    type: INDIVIDUAL
                    attributes:
                      first_name: Sheldon
                      last_name: Cooper
                      dob: '1983-05-12'
                      city: Pasadena
                      street_address: 2311 North Los Robles Avenue
                      country: US
                      onboarding_date: '2019-04-16'
                      email: sheldon.cooper@gmail.com
                      phone_number: '+1582693582'
                      id_document: passport
                      id_country: US
                      gender: F
                    status: NEW
                    createdTime: '2019-08-24T14:15:22Z'
                    snoozeConfiguration:
                      id: 1
                      personId: 1
                      createdBy:
                        id: 1
                        email: dana.aml@starbank.com
                        name: Dana Cummings
                      createdTime: '2019-08-24T14:15:22Z'
                      endTime: '2019-08-24T14:15:22Z'
                      amount: 0
                      totalAmount: 0
                      note: {}
                    category: CUSTOMER
                Individual_with_nested_attributes:
                  value:
                    id: bbt12345
                    type: INDIVIDUAL
                    attributes:
                      first_name: Sheldon
                      last_name: Cooper
                      dob: '1983-05-12'
                      city: Pasadena
                      street_address: 2311 North Los Robles Avenue
                      country: US
                      onboarding_date: '2019-04-16'
                      email: sheldon.cooper@gmail.com
                      phone_number: '+1582693582'
                      id_document: passport
                      id_country: US
                      gender: F
                      contracts:
                      - id: 1
                        loan_type: loan_agreement
                        status: active
                        start_date: '2022-01-20T08:48:39Z'
                      - id: 2
                        loan_type: lease
                        status: inactive
                        start_date: '2020-01-20T08:48:39Z'
                        end_date: '2022-01-20T08:48:39Z'
                    status: NEW
                    createdTime: '2019-08-24T14:15:22Z'
                    snoozeConfiguration:
                      id: 1
                      personId: 1
                      createdBy:
                        id: 1
                        email: dana.aml@starbank.com
                        name: Dana Cummings
                      createdTime: '2019-08-24T14:15:22Z'
                      endTime: '2019-08-24T14:15:22Z'
                      amount: 0
                      totalAmount: 0
                      note: {}
                    category: CUSTOMER
                Legal:
                  value:
                    id: bbt12346
                    type: LEGAL
                    attributes:
                      company_name: The Cheesecake factory
                      onboarding_date: '2020-06-12'
                      country: FR
                      city: Pasadena
                      street_address: 2311 North Los Robles Avenue
                      email: info@cheescakefactory.com
                      phone_number: '+1472583692'
                      industry: restaurant
                      business_reg_number: 12-3456789
                      expected_monthly_turnover: '100000'
                    status: NEW
                    createdTime: '2019-08-24T14:15:22Z'
                    snoozeConfiguration:
                      id: 1
                      personId: 1
                      createdBy:
                        id: 1
                        email: dana.aml@starbank.com
                        name: Dana Cummings
                      createdTime: '2019-08-24T14:15:22Z'
                      endTime: '2019-08-24T14:15:22Z'
                      amount: 0
                      totalAmount: 0
                      note: {}
                    category: CUST0MER
                Legal_with_nested_attributes:
                  value:
                    id: bbt12347
                    type: LEGAL
                    attributes:
                      company_name: Footprints on the Moon
                      onboarding_date: '2021-05-24'
                      country: CA
                      city: Pasadena
                      street_address: 2311 North Los Robles Avenue
                      email: footprintsonthemoon@gmail.com
                      phone_number: '+1582472952'
                      industry: entertainment
                      shareholders:
                      - id: shrhldr-1
                        first_name: Howard
                        last_name: Wolowitz
                        dob: '1988-07-06'
                        citizenship: IL
                      - id: shrhldr-2
                        first_name: Raj
                        last_name: Koothrappali
                        dob: '1989-05-06'
                        citizenship: IN
                      - id: shrhldr-3
                        company_name: BIG Invest LLC
                        country: GB
                      business_reg_number: 98-7654321
                      expected_monthly_turnover: '10000'
                    status: NEW
                    createdTime: '2019-08-24T14:15:22Z'
                    snoozeConfiguration:
                      id: 1
                      personId: 1
                      createdBy:
                        id: 1
                        email: dana.aml@starbank.com
                        name: Dana Cummings
                      createdTime: '2019-08-24T14:15:22Z'
                      endTime: '2019-08-24T14:15:22Z'
                      amount: 0
                      totalAmount: 0
                      note: {}
                    category: CUSTOMER
        '400':
          description: Invalid ID supplied
        '404':
          description: Person not found
    patch:
      tags:
      - aml
      summary: Patch person (v1)
      description: Use [Patch person v2](#tag/aml/operation/patchPersonV2) instead.
      operationId: updatePerson
      deprecated: true
      parameters:
      - name: personId
        in: path
        description: ID of person to return
        required: true
        schema:
          type: string
          minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: models.yaml#/components/schemas/ApiPerson
      responses:
        '200':
          description: Updated person
          content:
            application/json:
              schema:
                $ref: models.yaml#/components/schemas/ApiPerson
        '400':
          description: Invalid input
  /v1/persons/{personId}/transactions:
    get:
      tags:
      - aml
      summary: Fetch all person transactions
      description: NB! If there are more than 10000 results then the API shows the number of total results as 10000 and you can't paginate past the 10000th result.
      operationId: findAllPersonTransactions
      parameters:
      - name: personId
        in: path
        description: ID of person
        required: true
        schema:
          type:

# --- truncated at 32 KB (51 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/salv/refs/heads/main/openapi/salv-aml-api-openapi.yml