# API Reference

## AML Search by Verification

<mark style="color:green;">`POST`</mark> `https://api.app.authenteq.com/aml/search-by-verification`

This endpoint makes the AML search taking the person details from the given identity verification.

A search request in the request body should be represented in JSON and conforms to the following JSON schema:&#x20;

<https://api.app.authenteq.com/aml/search-by-verification-request-schema.json>

#### Headers

| Name                                             | Type   | Description                                                                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Your client credentials combined with a colon separator, base64-encoded and prefixed with "Basic ". |

#### Request Body

| Name                                             | Type   | Description                                                                        |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------- |
| verificationId<mark style="color:red;">\*</mark> | string | The id of an identity verification from which to extract the exact person details. |

{% tabs %}
{% tab title="200: OK Success." %}
The AML check has been requested successfully. Please sign in to your account in [Amiqus Dashboard](https://id.amiqus.co) and review the result.

```json
{
  "uuid": "b4abfad2-3d9f-11ee-924e-784f4385af2b",
  "searchType": "BY_VERIFICATIOIN",
  "reference": "d364cb70-3cdc-11ee-b43e-784f4385af2b",
  "surname": "DOE",
  "givenNames": "JOHN",
  "dateOfBirth": "1961-08-24",
  "countryCode": "USA",
  "url": "https://id.amiqus.co/clients/123/records/456"
}

```

{% endtab %}

{% tab title="400: Bad Request Invalid request." %}
{% tabs %}
{% tab title="Missing Request Body" %}

```json
{
  "errorCode": "MISSING_REQUEST_BODY",
  "errorMessage": "Required request body is missing"
}
```

{% endtab %}

{% tab title="Invalid Request Body" %}

```json
{
  "errorCode": "INVALID_REQUEST_BODY",
  "errorMessage": "Request body contains an invalid data",
  "errorDetails": {
    "verificationId": [
      "must not be null"
    ]
  }
}
```

{% endtab %}

{% tab title="Non-existing Verification" %}

```json
{
  "errorCode": "REQUEST_UNPROCESSABLE",
  "errorMessage": "Given request cannot be processed",
  "errorDetails": {
    "reason": "Requested verification not found"
  }
}
```

{% endtab %}

{% tab title="Verification Unexpected Status" %}

```json
{
  "errorCode": "REQUEST_UNPROCESSABLE",
  "errorMessage": "Given request cannot be processed",
  "errorDetails": {
    "reason": "Requested verification has an unexpected status: FAILED"
  }
}
```

{% endtab %}

{% tab title="Documentless Verification " %}

```json
{
  "errorCode": "REQUEST_UNPROCESSABLE",
  "errorMessage": "Given request cannot be processed",
  "errorDetails": {
    "reason": "Requested verification has no document data"
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="401: Unauthorized Full authentication required." %}
{% tabs %}
{% tab title="Missing API Keys" %}

```json
{
  "errorCode": "API_KEYS_MISSING",
  "errorMessage: "No API Keys in the Authorization header"
}
```

{% endtab %}

{% tab title="Invalid API Keys" %}

```json
{
  "errorCode": "API_KEYS_INVALID",
  "errorMessage: "Invalid API Keys in the Authorization header"
}
```

{% endtab %}

{% tab title="Bad API Keys" %}

```json
{
  "errorCode": "API_KEYS_BAD",
  "errorMessage: "Bad API Keys"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="403: Forbidden No access." %}
{% tabs %}
{% tab title="Account Deactivated" %}

```json
{
  "errorCode": "ACCOUNT_DEACTIVATED",
  "errorMessage: "Account deactivated. Please contact your Authenteq Sales  Representative in order to keep using this service"
}
```

{% endtab %}

{% tab title="AML Disabled" %}

```json
{
  "errorCode": "AML_DISABLED",
  "errorMessage: "Account deactivated. Please contact your Authenteq Sales Representative in order to keep using this service to get access to this service"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

## AML Search by Person

<mark style="color:green;">`POST`</mark> `https://api.app.authenteq.com/aml/search-by-person`

This endpoint makes the AML seach with the given person details.

A search request in the request body should be represented in JSON and conforms to the following JSON schema:

<https://api.app.authenteq.com/aml/search-by-person-request-schema.json>

#### Headers

| Name                                             | Type   | Description                                                                                         |
| ------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Your client credentials combined with a colon separator, base64-encoded and prefixed with "Basic ". |

#### Request Body

| Name                                         | Type   | Description                                                                                                           |
| -------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| surname<mark style="color:red;">\*</mark>    | string | The person's surname. It must not be longer than 255 characters.                                                      |
| givenNames<mark style="color:red;">\*</mark> | string | The person's given names.  It must not be longer than 255 characters.                                                 |
| dateOfBirth                                  | string | The person's date of birth. Format: `YYYY-MM-DD`. Example: `1976-12-01`. The age must be in range of 16 to 200 years. |
| countryCode                                  | string | The country code as ISO 3166-1 alpha-2 and alpha-3 strings of the person's country of residence.                      |
| reference<mark style="color:red;">\*</mark>  | UUID   | The reference that uniqely identifies the person.                                                                     |

{% tabs %}
{% tab title="200: OK Success." %}
The AML check has been requested successfully. Please sign in to your account in [Amiqus Dashboard](https://id.amiqus.co) and review the result.

```json
{
  "uuid": "b4abfad2-3d9f-11ee-924e-784f4385af2b",
  "searchType": "BY_PERSON",
  "reference": "d364cb70-3cdc-11ee-b43e-784f4385af2b",
  "surname": "DOE",
  "givenNames": "JOHN",
  "dateOfBirth": "1961-08-24",
  "countryCode": "USA",
  "url": "https://id.amiqus.co/clients/123/records/456"
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid request." %}
{% tabs %}
{% tab title="Missing Request Body" %}

```json
{
  "errorCode": "MISSING_REQUEST_BODY",
  "errorMessage": "Required request body is missing"
}
```

{% endtab %}

{% tab title="Invalid Request Body" %}

```json
{
  "errorCode": "INVALID_REQUEST_BODY",
  "errorMessage": "Request body contains an invalid data",
  "errorDetails": {
    "surname": [
      "must not be blank"
    ],
    "givenNames": [
      "must not be blank"
    ],
    "reference": [
      "must not be null"
    ]
  }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="401: Unauthorized Full authentication required." %}
{% tabs %}
{% tab title="Missing API Keys" %}

```json
{
  "errorCode": "API_KEYS_MISSING",
  "errorMessage: "No API Keys in the Authorization header"
}
```

{% endtab %}

{% tab title="Invalid API Keys" %}

```json
{
  "errorCode": "API_KEYS_INVALID",
  "errorMessage: "Invalid API Keys in the Authorization header"
}
```

{% endtab %}

{% tab title="Bad API Keys" %}

```json
{
  "errorCode": "API_KEYS_BAD",
  "errorMessage: "Bad API Keys"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="403: Forbidden No access." %}
{% tabs %}
{% tab title="Account Deactivated" %}

```json
{
  "errorCode": "ACCOUNT_DEACTIVATED",
  "errorMessage: "Account deactivated. Please contact your Authenteq Sales Representative in order to keep using this service"
}
```

{% endtab %}

{% tab title="AML Disabled" %}

```json
{
  "errorCode": "AML_DISABLED",
  "errorMessage: "Account deactivated. Please contact your Authenteq Sales Representative in order to keep using this service to get access to this service"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Both endpoints just start AML search that performs and finishes asynchronously. You will be notified when it's finished and about the result via your webhook. Please contact your Sales Representative to register a webhook for you.
{% endhint %}
