> For the complete documentation index, see [llms.txt](https://docs.pepdata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pepdata.com/english/api/registrations.md).

# Registers

{% hint style="warning" %}
This section of the API is still under development, so it may undergo significant changes. \
This page is under development.
{% endhint %}

## Get records

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/get_questionnaires`

Endpoint to get customer and transaction records.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                   | Type    | Description                                                                                                                                                                                                                |
| -------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                                     | string  | Id of the register or transaction                                                                                                                                                                                          |
| search\_term                           | string  | <p>Terms of search:<br>Search on name, vatin and id\_custom columns</p>                                                                                                                                                    |
| page                                   | integer | <p>page of the registers or transactions<br>Default: 1</p>                                                                                                                                                                 |
| id\_custom                             | string  | Custom id of the register or transaction                                                                                                                                                                                   |
| type<mark style="color:red;">\*</mark> | string  | <p>Type of the registers</p><p>Accepted values:</p><p><strong>customer</strong></p><p><strong>supplier</strong></p><p><strong>employee</strong></p><p><strong>transaction</strong></p><p><strong>relationship</strong></p> |
| status                                 | string  | <p>Status of the register<br>Accepted values:<br><strong>rejected</strong><br><strong>to\_decide</strong><br><strong>approved</strong><br><strong>incomplete</strong><br><strong>needs\_attention</strong></p>             |

{% tabs %}
{% tab title="200: OK Records retrieved successfully." %}

```javascript
{
    "data": {
        "items": [
            {
                "id": "7dd49ce1-9385-0cd1-7835-828393771ea0",
                "name": "individual",
                "vatin": null,
                "value": "{\"entity_proof\":{\"type\":\"\",\"identification_metadata\":{\"document_number\":\"\",\"document_validity\":\"\",\"is_document_perpetual\":\"\",\"document_issuing_entity\":\"\",\"document_issuing_date\":\"\",\"document_issuing_location\":\"\"},\"documentUpload\":{\"files\":[],\"type\":null,\"source\":null,\"extraData\":null,\"is_trustworthy\":null}},\"personal_data\":{\"name\":\"individual\",\"vatin\":null,\"email\":\"\",\"birth_date\":\"\",\"nationalities\":[],\"birth_place\":\"\",\"documentUpload\":{\"files\":[]}},\"address_data\":{\"type\":null,\"country\":null,\"cep\":\"\",\"address_line_1\":\"\",\"address_line_2\":\"\",\"city\":\"\",\"district\":\"\",\"documentUpload\":{\"files\":[],\"type\":null,\"source\":null,\"extraData\":null,\"is_trustworthy\":null}},\"occupation_data\":{\"type\":null,\"profession\":\"\",\"employer\":\"\",\"eni\":{\"commercial_name\":\"\",\"is_same_address\":null,\"address\":{\"country\":null,\"cep\":\"\",\"address_line_1\":\"\",\"address_line_2\":\"\",\"city\":\"\",\"district\":\"\"},\"cae\":\"\"},\"documentUpload\":{\"files\":[],\"type\":null,\"source\":null,\"extraData\":null,\"is_trustworthy\":null}},\"data_verification\":{\"type\":null,\"client_email\":\"\",\"documentUpload\":{\"files\":[],\"type\":null,\"source\":null,\"extraData\":null,\"is_trustworthy\":null},\"invite_sent\":false},\"adverse_media_data\":{\"adverse_media\":[]},\"suspicion_data\":{\"is_suspect\":null,\"reason\":\"\"},\"questionnaire_id\":\"7dd49ce1-9385-0cd1-7835-828393771ea0\",\"name\":\"individual\"}",
                "entity_type": "individual",
                "main_entity_subtype": "regular",
                "relations": null,
                "added_by": "cd9f4a64-ab25-4efb-bf31-323ee2280095",
                "added_at": 1693489958769,
                "submitted_at": null,
                "submitted_by": null,
                "approval_state": null,
                "approval_change_reason": null,
                "risk": 0,
                "risk_change_reason": null,
                "saved_at": 1693491414116,
                "assigned_to": null,
                "id_invited_user": null,
                "locked_by": null,
                "locked_at": null,
                "invited_submission_by": null,
                "invited_submission_at": null,
                "data_treatment_accepted_at": null,
                "needs_attention": "[{\"reason\":\"onboarding:quick_registration.needs_attention.risk_configurations_changed\",\"needs_attention_date\":\"2025-06-26\",\"old_risk_category_key\":\"medium\",\"new_risk_category_key\":\"low\"}]",
                "id_organization": "6cc1b6c1-33a9-4095-a4a4-aaca0db8d647",
                "id_custom": null,
                "invited_at": null,
                "invited_by_organization_name": null,
                "language": null,
                "organization_id_country": "PT",
                "id_iperson": "ID1",
                "type": "customer",
                "id_questionnaire_data": "4ba763f9-6675-949b-482c-35c689991d65",
                "risk_category": "low"
            }
        ],
        "page": 1,
        "max_results_per_page": 10,
        "count": 1,
        "total": 1
    },
    "version": "0.1",
    "timestamp": 1648132877766
}
```

{% endtab %}
{% endtabs %}

### Label

* **id**: id of the register.
* **name**: name of the register.&#x20;
* **vatin**: vat number of the register.&#x20;
* **value**: information of the register.
* **entity\_type**: type of entity (individual, organization or transaction).
* **main\_entity\_subtype**: subtype of the entity (representative, beneficiary owner, etc.).&#x20;
* **relations**: relations associated with the register.
* **added\_by**: id of the user who added the register.
* **added\_at**: date the register was added, in the form of a number of milliseconds since January 1, 1970 00:00:00 UTC.
* **submitted\_at**: date the register was submitted, in the form of a number of milliseconds since January 1, 1970 00:00:00 UTC.
* **submitted\_by**: id of the user who submitted the register.
* **approval\_state**: approval status of the register (***0*** - awaiting decision, ***1*** - approved, ***-1*** - rejected).
* **approval\_change\_reason**: justification for changing the approval status.
* **risk**: risk value of the register.
* **risk\_change\_reason**: justification for changing the risk category.
* **saved\_at**: date the register was last saved, in the form of a number of milliseconds since January 1, 1970 00:00:00 UTC.
* **assigned\_to**: id of the person responsible for the register.
* **id\_invited\_user**: id of the user invited to complete the register.
* **locked\_by**: id of the user who has the register open.
* **locked\_at**: date the register was last opened, in the form of a number of milliseconds since January 1, 1970 00:00:00 UTC.
* **invited\_submission\_by**: id of the invited user who accepted the invitation to complete.
* **invited\_submission\_at**: date on which the invitation to complete was accepted, in the form of a number of milliseconds since January 1, 1970 00:00:00 UTC.
* **data\_treatment\_accepted\_at**: date on which the guest user data processing conditions were accepted, in the form of a number of milliseconds since January 1, 1970 00:00:00 UTC.&#x20;
* **needs\_attention**: array of objects containing information about the reason for each alert.
* **id\_organization**: id of the organization that created the register.
* **id\_custom**: customizable id entered by the user.
* **invited\_at**: date on which the invitation to complete was sent, in the form of a number of milliseconds since January 1, 1970 00:00:00 UTC.
* **invited\_by\_organization\_name**: name of the organization that sent the invitation to complete.
* **language**: language in which the invitation to complete was sent.
* **organization\_id\_country**: country of the organization that created the record in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
* **id\_iperson**: id of the corresponding identifiable person. null if there was no match.
* **type:** type of the register.
* **id\_questionnaire\_data:** id of the record where the questionnaire's info is stored.
* **risk\_category:** category in which the risk value falls.

## Add one record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/add_questionnaire`

Endpoint to get customer and transaction records.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                   | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark> | string  | Name of the register or transactions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| id\_custom                             | string  | Custom id of the register                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| type<mark style="color:red;">\*</mark> | integer | <p>Type of register<br>Values accepted:<br><strong>individual</strong> (Register of an individual person)<br><strong>organization</strong> (Register of an organization)<br><strong>transaction</strong> (Transaction)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| vatin                                  | string  | Vat number of the register                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| questionnaire\_data                    | json    | <p><strong>Depending on each type of record,</strong> different objects are necessary<br><em>individual</em></p><p><code>{</code></p><p><code>"personal\_data": {</code></p><p><code>"email": "<test@test.pt>",</code></p><p><code>"birth\_date": "2010-10-10",</code></p><p><code>"nationalities": \["Portugal"],</code></p><p><code>"birth\_place": "Portugal"</code></p><p><code>},</code></p><p><code>"entity\_proof": {</code></p><p><code>"identification\_metadata": {</code></p><p><code>"document\_number": 123456789,</code></p><p><code>"is\_document\_perpetual": false,</code></p><p><code>"document\_validity": "2023-05-20",</code></p><p><code>"document\_issuing\_entity": "Test",</code></p><p><code>"document\_issuing\_date": "2013-05-20",</code></p><p><code>"document\_issuing\_location": "Test"</code></p><p><code>},</code></p><p><code>},</code></p><p><code>"address\_data": {</code></p><p><code>"type": "residence",</code> \*\* <code>"country":"Portugal",</code></p><p><code>"cep":"1234-567",</code></p><p><code>"address\_line\_1":"Rua X",</code></p><p><code>"address\_line\_2":"nº123", "city":"Lisboa",</code></p><p><code>"district":"Lisboa"</code></p><p><code>},</code></p><p><code>"suspicion\_data": {</code></p><p><code>"is\_suspect": false,</code></p><p><code>"reason": "Test"</code></p><p><code>},</code></p><p><code>}</code></p><p></p><p>\*\*Accepted values:</p><p><strong>residence</strong></p><p><strong>fiscal\_residence</strong></p><p><strong>headquarters</strong></p><p></p><p><em>organization</em></p><p><code>{</code></p><p><code>"company\_data": {</code></p><p><code>"alternative\_names": \["Alternative Name 1"],</code> </p><p><code>"object": "test",</code></p><p><code>"caes": \["01111"],</code></p><p><code>"country": "Portugal",</code></p><p><code>"foundation\_date": "2005-02-01",</code></p><p><code>"countries\_operations": \["Portugal"]</code></p><p><code>},</code></p><p><code>"entity\_proof": {</code></p><p><code>"national\_headquarters": true</code></p><p><code>},</code></p><p><code>"beneficiary\_data": {</code></p><p><code>"codigo\_rcbe": "123456"</code></p><p><code>},</code></p><p><code>"address\_data": {</code></p><p><code>"country":"Portugal", "cep":"1234-567", "address\_line\_1":"Rua X", "address\_line\_2":"nº 123", "city":"Lisboa", "district":"Lisboa"</code></p><p><code>},</code></p><p><code>"suspicion\_data": {</code></p><p><code>"is\_suspect": false,</code></p><p><code>"reason": "Test"</code></p><p><code>},</code></p><p><code>}</code></p><p><em>transaction</em></p><p><code>{</code></p><p><code>"buyer": {</code></p><p><code>"acquisition\_purpose": "test purpose",</code></p><p><code>},</code></p><p><code>"basic\_information": {</code></p><p><code>"sell\_type": "good",</code></p><p><code>"description": "test description",</code></p><p><code>"observations": "test observations"</code></p><p><code>},</code></p><p><code>"suspicion\_data": {</code></p><p><code>"is\_suspect": false,</code></p><p><code>"reason": "Test"</code></p><p><code>},</code></p><p><code>}</code></p> |

{% tabs %}
{% tab title="200: OK Register or transaction created." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1660060397561,
    "data": {
        "id": "aa199264-c62e-3763-e3a5-68127b070720",
        "risk": 0,
        "risk_category": "low"
    }
}
```

{% endtab %}

{% tab title="409: Conflict A record with the same vat number or custom id already exists." %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1660060761083,
        "message": "A record with the same vat number or custom id already exists."
    }
}
```

{% endtab %}

{% tab title="409: Conflict (Transactions) A record with the same custom id already exists. " %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1660060761083,
        "message": "A record with the same custom id already exists."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid vat number" %}

```json
{
    "message": {
        "version": 0.1,
        "timestamp": 1697022539285,
        "message": "vatin: The VAT identification number is invalid. If it's international, enter the country code at the beginning. Ex.: FR12345678901 for a French VAT identification number."
    }
}
```

{% endtab %}
{% endtabs %}

### Label

* **id**: id of the register or transaction created.
* **risk:** risk value of the new register/transaction.
* **risk\_category:** category in which the risk value of the new register/transaction falls.

## Edit one record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/edit_questionnaire`

Endpoint to edit a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                 | Type   | Description                                                                                                                                    |
| ------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Id of the register or transaction                                                                                                              |
| questionnaire\_data                  | json   | You can only edit the value you need: Check [add\_questionnaire](#add-one-record) (`questionnaire_data`) to see which properties are accepted. |

{% tabs %}
{% tab title="200: OK Register of customer or transaction edited." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1660061942863,
    "data": {
        "risk": 0,
        "risk_category": "low"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```json
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

### Label

* **risk:** risk value of the edited register/transaction.
* **risk\_category:** category in which the risk value of the edited register/transaction falls.

## Delete records

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/delete_questionnaire`

Endpoint to delete registers of customers or transactions.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                  | Type  | Description                          |
| ------------------------------------- | ----- | ------------------------------------ |
| ids<mark style="color:red;">\*</mark> | array | Ids of the registers or transactions |

{% tabs %}
{% tab title="200: OK The register of customer or transaction was deleted successfully" %}

```javascript
{
    "version": 0.1,
    "timestamp": 1695892485159,
    "data": {
        "message": "Record(s) successfully deleted."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Important**: You may get an error when deleting a record if it has dependencies with other records.
{% endhint %}

## Cancel the submission of a record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/unsubmit_questionnaire`

Endpoint to cancel the submission of a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                 | Type   | Description                       |
| ------------------------------------ | ------ | --------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Id of the register or transaction |

{% tabs %}
{% tab title="200: OK Submission of customer registration or canceled transactions has been canceled successfully." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1695893220141,
    "data": {
        "risk": 0,
        "risk_category": "low"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Canceling the submission will recalculate the register risk. If you have a manually configured risk category, it will be lost.
{% endhint %}

### Label

* **risk:** recalculated risk from customer or transaction records.
* **risk\_category:** category in which the recalculated risk value of the customer registration/transaction falls.

## Send an invitation to fill in a record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/send_questionnaire_invite`

Endpoint to send an invitation to fill in a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                            | Type   | Description                                                                                                                                                                                                 |
| ----------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>            | string | Id of the register or transaction                                                                                                                                                                           |
| client\_email<mark style="color:red;">\*</mark> | string | Email of the invited client                                                                                                                                                                                 |
| language                                        | string | <p>Language in which the invitation should be sent</p><p>Default: pt-PT<br>Accepted values:<br><strong>pt-PT</strong> (Portuguese)<br><strong>en</strong> (English)</p><p><strong>es</strong> (Spanish)</p> |

{% tabs %}
{% tab title="200: OK Invitation sent successfully." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1695997097315,
    "data": {
        "message": "Invitation sent to {{client_email}}."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

## Cancel an invitation to fill in a record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/cancel_questionnaire_invite`

Endpoint to cancel an invitation to fill in a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                            | Type   | Description                       |
| ----------------------------------------------- | ------ | --------------------------------- |
| id<mark style="color:red;">\*</mark>            | string | Id of the register or transaction |
| client\_email<mark style="color:red;">\*</mark> | string | Email of the invited client       |

{% tabs %}
{% tab title="200: OK Invitation canceled successfully." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1695997713238,
    "data": {
        "message": "Invitation from {{client_email}} has been canceled."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

## Assign a user to a record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/assign_user_to_questionnaire`

Endpoint to assign a user to a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                       | Type   | Description                       |
| ------------------------------------------ | ------ | --------------------------------- |
| id<mark style="color:red;">\*</mark>       | string | Id of the register or transaction |
| id\_user<mark style="color:red;">\*</mark> | string | Id of the user                    |

{% tabs %}
{% tab title="200: OK The user was assigned to the register of a customer or transactions successfully." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1695999232282,
    "data": {
        "message": "Responsible changed to {{user_name}}."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

## Assign departments to a record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/assign_departments_to_questionnaire`

Endpoint to assign departments to a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                          | Type   | Description                                               |
| --------------------------------------------- | ------ | --------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>          | string | Id of the register or transaction                         |
| departments<mark style="color:red;">\*</mark> | json   | <p>Array of departments<br>Exemple:<br>\["Financial"]</p> |

{% tabs %}
{% tab title="200: OK The departments were assigned to the register of a customer or transactions successfully." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1696001921643,
    "data": {
        "message": "Departments successfully assigned."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid departments" %}

```json
{
    "message": {
        "version": 0.1,
        "timestamp": 1697025520974,
        "message": "An error has occurred while associating departments to the registry. Check that the departments you are associating do exist on the \\'Settings\\' page."
    }
}
```

{% endtab %}
{% endtabs %}

## Edit the state of approval of a record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/edit_questionnaire_approval_state`

Endpoint to edit the state of approval of a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                                       | Type   | Description                                                                                                                                       |
| ---------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>                       | string | Id of the register or transaction                                                                                                                 |
| approval\_state<mark style="color:red;">\*</mark>          | string | <p>State of approval<br>Accepted values:<br><strong>-1</strong> (Rejected)<br><strong>0</strong> (Undecided)<br><strong>1</strong> (Approved)</p> |
| approval\_change\_reason<mark style="color:red;">\*</mark> | string | Justification for changing approval status                                                                                                        |

{% tabs %}
{% tab title="200: OK The state of approval of the register of a customer or transactions was successfully edited." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1696002523053,
    "data": {
        "message": "Approval state successfully edited."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

## Edit the status of a record (Active/Inactive)

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/edit_questionnaire_active_state`

Endpoint to change the status (active/inactive) of a register or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                       | Type    | Description                                                                                                                                               |
| ------------------------------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id<mark style="color:red;">\*</mark>       | string  | Id of the register or transaction                                                                                                                         |
| disabled<mark style="color:red;">\*</mark> | boolean | <p>State of a register or transaction<br></p><p>Accepted values:<br><strong>true</strong> register inactive<br><strong>false</strong> register active</p> |

{% tabs %}
{% tab title="200: OK The record’s status was successfully updated." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1696238603806,
    "data": {
        "is_disabled": false
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of register or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

### Label

* **is\_disabled:** state of the register or transaction.

## Revert the risk of a record

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/revert_questionnaire_risk`

Endpoint to revert the current risk of a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                 | Type   | Description                       |
| ------------------------------------ | ------ | --------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Id of the register or transaction |

{% tabs %}
{% tab title="200: OK The risk of the register of a customer or transaction was reverted successfully." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1696238603806,
    "data": {
        "risk": 0,
        "risk_category": "low"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

### Label

* **risk:** risk calculated of the register of a customer or transaction.
* **risk\_category:** category in which the risk value of the customer registration/transaction falls.

## Reset the state

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/reset_questionnaire_needs_attention`

Endpoint to reset the state "Needs attention" of a register of a customer or transaction.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                 | Type   | Description                       |
| ------------------------------------ | ------ | --------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Id of the register or transaction |

{% tabs %}
{% tab title="200: OK Status successfully reseted" %}

```javascript
{
    "version": 0.1,
    "timestamp": 1696239199674,
    "data": {
        "message": "Needs attention status successfully reseted."
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Register of customer or transaction not found" %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1697023379895,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}

## Submit the records

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/submit_questionnaires`

Endpoint that automatically submits all the unsubmitted records.\*

**\*This action is limited to 8000 records each time.**&#x20;

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                   | Type   | Description                                                                                                                 |
| -------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| type<mark style="color:red;">\*</mark> | string | <p>Type of the records to submit.</p><p>Accepted values:<br><strong>customers</strong><br><strong>transactions</strong></p> |

{% tabs %}
{% tab title="200: OK The records were successfuly submitted." %}

```javascript
{
    "version": 0.1,
    "timestamp": 1695983552463,
    "data": {
        "time_to_conclusion": 1
    }
}
```

{% endtab %}

{% tab title="400: Bad Request The type is not valid." %}

```
{
    "message": {
        "version": 0.1,
        "timestamp": 1708706955487,
        "message": "The type is not valid."
    }
}
```

{% endtab %}
{% endtabs %}

### Label

* **time\_to\_conclusion:** estimated time in seconds for the operation to complete.

## Export the risk assessment report

<mark style="color:green;">`POST`</mark> `https://www.pepdata.com/api/export_risk_pdf`

Endpoint to obtain the risk assessment report of a record in pdf format.

#### Headers

| Name                                            | Type   | Description     |
| ----------------------------------------------- | ------ | --------------- |
| Authorization<mark style="color:red;">\*</mark> | string | key \[API\_KEY] |

#### Request Body

| Name                                 | Type   | Description                       |
| ------------------------------------ | ------ | --------------------------------- |
| id<mark style="color:red;">\*</mark> | string | Id of the register or transaction |

**Response**

{% tabs %}
{% tab title="200: OK Report successfully exported" %}
{% file src="/files/R6ejr4DjNzUYgdVzbbzq" %}
Exemplo de relatório de avaliação de risco
{% endfile %}
{% endtab %}

{% tab title="400: Bad Request Register not found" %}

```json
{
    "message": {
        "version": 0.1,
        "timestamp": 1697030777756,
        "message": "The intended record was not found."
    }
}
```

{% endtab %}
{% endtabs %}
