# How to Create a Custom Type for Background Check

{{<tags >}}

Performing a customized background check allows for greater accuracy in finding information and provides a more accurate assessment of your end users. To customize a background check to your company's needs, it is essential to understand the concepts of [Datasets, Scores and Check Types](/guides/datasets_scores_types/):

- **Datasets:** Datasets are categories of information used to group related data sources and the information they return.

- **Scores:** Check scores are a quantitative measure of the confidence level of background check results. The higher the score, the cleaner the check results. This attribute makes scores useful for easily automating decisions. Scores range from 0 to 1 in API responses, or from 0 to 10 when displayed on the dashboard.

- **Check Types:** Check types define what datasets will be queried on the check and how relevant will each dataset be when calculating the global score. Truora has 3 default check types:

{{<table "table w-auto small m-auto table-striped table-bordered">}}
| Type      | Included datasets                                                                                                                                                                                                                                                           | Description                                                       |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `person`  | - Personal Identity <br /> - Criminal Record <br /> - Legal Background<br /> - International Background<br /> - Alert In Media <br /><br/> Only available in some countries: <br/> - Professional Background <br/> - Affiliations and Insurances <br/> - Taxes and Finances | Used to perform a background check on a person.                   |
| `vehicle` | - Vehicle Information <br/> - Personal Identity <br/> - Traffic Fines<br/> - Driving Licenses <br/> - Criminal Record <br/> - International Background <br/><br/> Only available in some countries: <br/>- Vehicle Permits                                                  | Used to perform a background check on a driver and their vehicle. |
| `company` | - Business Background<br/> - International Background<br/> - Alert in Media <br/><br/> Only available in some countries: <br/>- Criminal Record <br/>- Legal Background <br/>- Taxes and Finances                                                                           | Used to perform a background check on a company.                  |
{{</table>}}

## Creating a Custom Type

### Using an API Platform like Postman

Custom check types allow you to choose which Datasets are searched and how impactful each one of them are when calculating the Global Score. Follow these steps to create a Custom Type:

1. Create a **POST** request to https://api.checks.truora.com/v1/config.
2. Click the **Headers** tab. Create a new key named Truora-API-Key.
3. Set the value for ``Truora-API-Key`` as your [Truora API-key](/guides/authentication/).
4. Set the value for ``Content-Type header`` as ``application/x-www-form-urlencoded``.
5. Add the key ``type``, and set the value as the name of your custom type. The following values are not allowed as they are reserved types: ``person``, ``vehicle`` and ``company``.
6. Create the key named ``country`` and set its value to your country:
    - ``ALL`` for International Lists
    - ``BR`` for Brazil
    - ``CO`` for Colombia
    - ``CL`` for Chile
    - ``CR`` for Costa Rica
    - ``MX`` for Mexico
    - ``PE`` for Peru
7. Create one key named after each of the following datasets except those you do not want to include:
    - `dataset_personal_identity`
    - `dataset_criminal_record`
    - `dataset_legal_background`
    - `dataset_international_background`
    - `dataset_professional_background`
    - `dataset_affiliations_and_insurances`
    - `dataset_alert_in_media`
    - `dataset_business_background`
    - `dataset_traffic_fines`
    - `dataset_driving_licenses`
    - `dataset_vehicle_information`
    - `dataset_taxes_and_finances` (not supported in Brazil)
    - `dataset_vehicle_permits`
    - `dataset_document_validation`*

*If you want to use a custom type in Document Validation, remember to add the dataset `dataset_document_validation` with a weight of 0. Otherwise, you won't be able to use the custom type, and you'll receive the error `Invalid request: invalid check_type config` when you are creating the validation. To learn more about Document Validation, please visit the [**Document Validation**](/guides/document/) and [**Document and Face Validation**](/guides/documentandface/) guides.

8. Set the value for each **dataset** key to a number between **0** and **1** to determine how impactful every dataset will be to the global score, where 0 is irrelevant and 1 is the only dataset to have an impact on the score. Keep in mind that the total weights of the **datasets** must always equal **1**. Any sum greater or lower than 1 will result in a creation failure.

9. The above request should return a response in JSON format including all custom types that apply for the country you entered.

{{<code lang="json" lang_title="Response 200">}}
{
    "config_id": "xxxxxxxxxxxxxxxxxxxxxx",
    "client_id": "xxxxxxxxxxxxxxxxxxxxxx",
    "score_configs": {
        "CO": {
            "test-custom-type": [
                {
                    "data_set": "document_validation",
                    "weight": 0
                },
                {
                    "data_set": "personal_identity",
                    "weight": 0.2
                },
                {
                    "data_set": "taxes_and_finances",
                    "weight": 0.2
                },
                {
                    "data_set": "criminal_record",
                    "weight": 0.2
                },
                {
                    "data_set": "business_background",
                    "weight": 0
                },
                {
                    "data_set": "international_background",
                    "weight": 0.2
                },
                {
                    "data_set": "alert_in_media",
                    "weight": 0
                },
                {
                    "data_set": "legal_background",
                    "weight": 0.2
                }
            ]
        }
    }
}
{{</code>}}

10. Finally, after successfully creating your **Custom Type** you can use it by simply setting the value of the `type` key in the [Check Creation](/checks/create) process with the **name** of the **Custom Type** you just set.

### Using an example Script (Javascript or Python)

Let’s make our first custom type to help illustrate the usage of our API. In the next example we will create a **Custom Check Type** where the country is **CO** (Colombia), the type is a custom type name of your preference “**your_custom_type**”, and we selected two datasets with the following weights:
- `dataset_personal_identity` has a weight of 0.5
- `dataset_criminal_record` has a weight of 0.5

Please note that the total weights of the datasets must always equal 1. Any sum greater or lower than 1 will result in a creation failure:

{{<code2 "{\"python\": \"create_custom_type.py\", \"javascript\": \"create_custom_type.js\"}" "Create Custom Type" >}}

Finally, after successfully creating your **Custom Check Type** you can use it by simply setting the value of the `type` key in the [Check Creation](/checks/create) process with the **name** of the **Custom Type** you just set.

The following is the list of all the available datasets you can choose to impact your score:
- `dataset_personal_identity`
- `dataset_criminal_record`
- `dataset_legal_background`
- `dataset_international_background`
- `dataset_professional_background`
- `dataset_affiliations_and_insurances`
- `dataset_alert_in_media`
- `dataset_business_background`
- `dataset_traffic_fines`
- `dataset_driving_licenses`
- `dataset_vehicle_information`
- `dataset_taxes_and_finances` (not supported in Brazil)
- `dataset_vehicle_permits`
- `dataset_document_validation`*

*If you want to use a custom type in Document Validation, remember to add the dataset `dataset_document_validation` with a weight of 0. Otherwise, you won't be able to use the custom type, and you'll receive the error `Invalid request: invalid check_type config` when you are creating the validation. To learn more about Document Validation, please visit the [**Document Validation**](/guides/document/) and [**Document and Face Validation**](/guides/documentandface/) guides.