# PEP / Sanction Search

`POST /pep_sanction_check`

- Live: `POST https://gdapi.globaldata.net.au/api/v2/pep_sanction_check`
- Sandbox: `POST https://sandbox-gdapi.globaldata.net.au/api/v2/pep_sanction_check`

PEP / Sanction Search is a powerful API query that can be used to find individuals or companies who are politically exposed persons
or have an international sanction applied to them. The results provide a list of pep or sanction sources that the individuals or companies are listed on
and there is the option to tailor the search to narrow, medium or broad.

## Search Types
### Narrow Search
A narrow search will match exact first name, exact last name and exact birth date. This is the most restrictive search and should be used for low risk searches.
For companies, the search will match companies with names which contain the exact names provided.

### Medium Search
A medium search will match exact last name and birth date year, and will allow for a partial match on other names. This is a good balance between accuracy and flexibility.
For companies, this search will match companies names which contain the partial names provided. However the results will filter out any results where the
matched name only consists of words from a stop word list. The stop word list is a list of common words that are not useful for matching, such as "group", "company", "LTD", etc.

###  Broad Search
A broad search will match partial first name, partial last name and partial birth date. This is the most flexible search and should be used for high risk searches.
For companies, this search type will match companies with names which contain the partial names provided.

### Note on Matching
When matching names, the API ignores the order of the names as some names may be reported in different orders.
Consequently, it is possible to search for John Michael and find a match for an individual with a reported name of Michael John.

When matching company names, the API will ignore birth dates and pep countries.

## Sandbox environment data

When simulating queries in the sandbox environment, the following records will return a match:

**Individuals**

| First name  | Middle name  | Last name  | Birth date  | PEP?  | Sanctioned?  | Country  |
|:------------|:-------------|:-----------|:------------|:------|:-------------|:---------|
| Ed          | Virgil       | Leuschke   | 1993-03-23  | No    | Yes          | AU       |
| Justus      | Tanner       | Beatty     | 1950-06-04  | Yes   | No           | AU       |
| Julien      | -            | Kovacek    | 2002-08-14  | Yes   | No           | AU       |
| Alford      | -            | McGlynn    | 1994-03-13  | No    | Yes          | AU       |

**Companies**

| Company name                       | Sanction country    |
|:-----------------------------------|:--------------------|
| Southern Cross Commodities Pty Ltd | AU, US              |
| Baltic Petrochem Logistics OU      | EU, GB              |
| Jade Meridian Holdings Pte Ltd     | US                  |
| Andes Orbital Freight SAC          | GB                  |
| Sahel Mineral Ventures SARL        | UN, AU              |

## Request body

The details of the individual to search for.

| Field | Type | Description |
|-------|------|-------------|
| `company_name` | string [1..255 characters] or null | The name of the company to search for |
| `vessel_name` | string [1..255 characters] or null | The name of the vessel to search for |
| `first_name` | string [1..255 characters] | The first name of the individual Example: `Phil` |
| `middle_name` | string [1..255 characters] or null | The middle name of the individual |
| `last_name` | string [2..255 characters] | The last name of the individual Example: `Smith` |
| `full_name` | string [2..255 characters] or null | The full name of the individual. This can be provided instead of first, middle and last names. |
| `birth_date` | string (date) | The birth date of the individual Example: `1938-10-24` |
| `search_type` | string | The type of search to perform. Narrow searches for exact matches, medium searches for similar matches and broad searches for partial matches. Enum: `narrow_search`, `medium_search`, `broad_search` Example: `broad_search` |
| `pep_countries` | array of strings [items 2..7 characters] | A list of countries of the politically exposed person as a country code to include in the search |
| `sanction_countries` | array of strings [items 2..7 characters] | A list of countries of the sanction as a country code to include in the search |
| `max_results` | integer [1..100] | The maximum number of results to return Default: `20` Example: `20` |
| `similarity_threshold` | number [0..100] | The minimum similarity percentage to return results for. Default: `80` Example: `80` |
| `pep_sanction_extended_result` | boolean | Whether to return include the extended results for the individual matches Default: `false` Example: `true` |

**Sample request**

```json
{
    "company_name": null,
    "vessel_name": null,
    "first_name": "Phil",
    "middle_name": null,
    "last_name": "Smith",
    "full_name": null,
    "birth_date": "1938-10-24",
    "search_type": "broad_search",
    "pep_countries": [
        "au"
    ],
    "sanction_countries": [
        "au"
    ],
    "max_results": 20,
    "similarity_threshold": 80,
    "pep_sanction_extended_result": true
}
```

## Responses

### 200 Successful response

Content type: `application/json`

| Field | Type | Description |
|-------|------|-------------|
| `message` | string | A message indicating the result of the request. This will be `Ok` if the request was successful. Example: `Ok` |
| `api_reference` | string (uuid) | A unique identifier for this request. This can be used to track the request in the logs. Example: `fe4291ca-d831-4760-96df-c9cb03b3cd95` |
| `function` | string | The function that was called. Example: `pep_sanction_check` |
| `matches` | array of objects | Array of matched individuals. |
| `matches[].uuid` | string (uuid) | The unique identifier of the individual. Example: `389d8f0f-b2c4-465a-b2e9-8a14722031f7` |
| `matches[].caption` | string | Example: `Phil Smith` |
| `matches[].is_pep` | boolean | Whether the individual is a politically exposed person. Example: `true` |
| `matches[].is_sanctioned` | boolean | Whether the individual is sanctioned. Example: `false` |
| `matches[].distance` | number | The levenshtein distance of the names of the individual to the search name. Example: `0` |
| `matches[].similarity` | number | The percentage similarity of the matched name to the search name. Example: `100` |
| `matches[].matched_name` | string | The name of the individual that was matched to the search name and used for the similarity score. Example: `PHIL SMITH` |
| `matches[].sanctions` | array of strings | Array of countries where the individual is sanctioned. |
| `matches[].pep_matches` | array of strings | Array of sources where the individual has been identified as a pep. |
| `matches[].sanction_matches` | array of strings | Array of sources where the individual has been identified as being sanctioned. |
| `matches[].data` | object | Additional data about the individual which is included if pep_sanction_extended_result is true. |
| `more_results` | boolean | Whether there are more results available. Example: `false` |

**Sample response**

```json
{
    "message": "Ok",
    "api_reference": "fe4291ca-d831-4760-96df-c9cb03b3cd95",
    "function": "pep_sanction_check",
    "matches": [
        {
            "uuid": "389d8f0f-b2c4-465a-b2e9-8a14722031f7",
            "caption": "Phil Smith",
            "is_pep": true,
            "is_sanctioned": false,
            "distance": 0,
            "similarity": 100,
            "matched_name": "PHIL SMITH",
            "sanctions": [],
            "pep_matches": [
                "wd_peps"
            ],
            "sanction_matches": [],
            "data": {
                "id": "Q21598350",
                "schema": "Person",
                "target": true,
                "caption": "Phil Smith",
                "datasets": [
                    "wd_peps",
                    "wikidata"
                ],
                "last_seen": "2024-06-14T12:48:02",
                "referents": [],
                "first_seen": "2023-04-20T10:30:17",
                "properties": {
                    "name": [
                        "جون سميث",
                        "Филипп Смит",
                        "Phil Smith"
                    ],
                    "alias": [
                        "Philip John Smith"
                    ],
                    "notes": [
                        "Australian politician and teacher"
                    ],
                    "gender": [
                        "male"
                    ],
                    "topics": [
                        "role.pep"
                    ],
                    "country": [
                        "au"
                    ],
                    "keywords": [
                        "State government"
                    ],
                    "lastName": [
                        "Smith"
                    ],
                    "position": [
                        "Member of the Western Australian Legislative Assembly"
                    ],
                    "birthDate": [
                        "1938-10-24"
                    ],
                    "firstName": [
                        "Philip",
                        "John"
                    ],
                    "modifiedAt": [
                        "2023-03-07"
                    ],
                    "wikidataId": [
                        "Q21598350"
                    ],
                    "nationality": [
                        "au"
                    ],
                    "positionOccupancies": [
                        {
                            "id": "wd-18fdca25ec2964d511fe7a039144bd178a3039f9",
                            "schema": "Occupancy",
                            "target": false,
                            "caption": "Occupancy",
                            "datasets": [
                                "wd_peps"
                            ],
                            "last_seen": "2024-06-14T12:48:02",
                            "referents": [],
                            "first_seen": "2023-09-08T07:00:40",
                            "properties": {
                                "post": [
                                    {
                                        "id": "Q20165902",
                                        "schema": "Position",
                                        "target": false,
                                        "caption": "Member of the Western Australian Legislative Assembly",
                                        "datasets": [
                                            "ann_pep_positions",
                                            "wd_peps"
                                        ],
                                        "last_seen": "2024-06-14T14:38:06",
                                        "referents": [],
                                        "first_seen": "2023-09-08T07:00:40",
                                        "properties": {
                                            "name": [
                                                "Member of the Western Australian Legislative Assembly"
                                            ],
                                            "topics": [
                                                "gov.state"
                                            ],
                                            "country": [
                                                "au"
                                            ],
                                            "wikidataId": [
                                                "Q20165902"
                                            ]
                                        },
                                        "last_change": "2023-12-22T14:40:54"
                                    }
                                ],
                                "holder": [
                                    "Q21598350"
                                ],
                                "status": [
                                    "unknown"
                                ]
                            },
                            "last_change": "2023-09-08T07:00:40"
                        }
                    ]
                },
                "last_change": "2024-01-31T00:47:01"
            }
        }
    ],
    "more_results": false
}
```

Standard error responses: 400, 401, 402, 403, 429, 5XX (see [Common error responses](/docs/reference/general/common-error-responses.md))

