# Endpoints

## All Relations

<mark style="color:blue;">`GET`</mark> `https://api.insolventiemonitor.nl/api/v1/dev/relations`

This endpoint allows you to get a list of all relations

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| X-API-Key | string | Api key     |

{% tabs %}
{% tab title="202 Succesfully fetched relations" %}

```
    "message": "Succesfully fetched relations",
    "response": [
        {
            "ID": "831c17e8-1f85-40a2-8548-9872c86f8fe1",
            "CreatedAt": "2021-03-01T19:39:16.68947Z",
            "UpdatedAt": "2021-04-28T11:27:14.582229Z",
            "DeletedAt": null,
            "CompanyName": "Jouwkabel.nl B.V.",
            "CocNumber": "63893436",
            "VatNumber": "",
            "VatCheckDate": null,
            "TrackResults": null,
            "LastInsolvencyCheck": "2021-03-01T20:30:09.797955Z",
            "InsolventieRecords": null,
            "LastPublicationsCheck": "2021-04-26T22:27:17.431973Z",
            "KvkPublicatiesRercords": null,
            "LastLocationsCheck": "2021-04-26T19:43:34.164195Z",
            "KvkVestigingen": null
        }
    ],
    "succesfull": true
}
```

{% endtab %}

{% tab title="401 Invalid X-API-key header, or just forbidden." %}

```
{    
    "message": "{
    "message": "Unauthorized",
    "succesfull": false
} 
```

{% endtab %}
{% endtabs %}

## Get Relation

<mark style="color:blue;">`GET`</mark> `https://api.insolventiemonitor.nl/api/v1/dev/relation/:uuid`

Select a specific relation with the underlaying dataset.&#x20;

#### Query Parameters

| Name | Type   | Description               |
| ---- | ------ | ------------------------- |
| uuid | string | uuid of specific relation |

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| X-API-Key | string | Api key     |

{% tabs %}
{% tab title="202 " %}

```
{
    "message": "Succesfully fetched relation",
    "response": {
        "ID": "831c17e8-1f85-40a2-8548-9872c86f8fe1",
        "CreatedAt": "2021-03-01T19:39:16.68947Z",
        "UpdatedAt": "2021-04-28T11:27:14.582229Z",
        "DeletedAt": null,
        "CompanyName": "REFERENCE BV",
        "CocNumber": "12345678",
        "VatNumber": "",
        "VatCheckDate": null,
        "TrackResults": [
            {
                "ID": "0dc8488b-b632-4c47-9976-7eb8d7ae2bf2",
                "CreatedAt": "2021-03-01T19:39:16.784702Z",
                "UpdatedAt": "2021-04-28T11:27:14.591053Z",
                "DeletedAt": null,
                "TrackID": "831c17e8-1f85-40a2-8548-9872c86f8fe1",
                "TrackType": "INFO",
                "StatusMessage": "Relatie aangemaakt op 2021-03-01",
                "RelationValid": true,
                "Status": ""
            },
            {
                "ID": "2aa3d608-fc0e-4c0c-a67c-2427877c6b8f",
                "CreatedAt": "2021-03-01T20:00:09.520021Z",
                "UpdatedAt": "2021-04-28T11:27:14.583755Z",
                "DeletedAt": null,
                "TrackID": "831c17e8-1f85-40a2-8548-9872c86f8fe1",
                "TrackType": "INSOLVENTIE",
                "StatusMessage": "Op basis van het KvK nummer vonden wij een hit in het insolventie register: REFERENCE",
                "RelationValid": false,
                "Status": ""
            }
        ],
        "LastInsolvencyCheck": "2021-03-01T20:30:09.797955Z",
        "InsolventieRecords": [
            {
                "CreatedAt": "2021-03-01T20:00:09.531238Z",
                "UpdatedAt": "2021-04-28T11:27:14.594776Z",
                "DeletedAt": null,
                "RelationID": "831c17e8-1f85-40a2-8548-9872c86f8fe1",
                "InsolventieKenmerk": "REFERENCE",
                "PublicatieDatum": "0001-01-01T00:00:00Z",
                "KvkNummer": "12345678",
                "HandelsNaam": "REFERENCE BV"
            }
        ],
        "LastPublicationsCheck": "2021-04-26T22:27:17.431973Z",
        "KvkPublicatiesRercords": [],
        "LastLocationsCheck": "2021-04-26T19:43:34.164195Z",
        "KvkVestigingen": []
    },
    "succesfull": true
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "message": "Missing ID header",
    "succesfull": false
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "message": "Not found",
    "succesfull": false
}
```

{% endtab %}
{% endtabs %}

## Create new relation

<mark style="color:green;">`POST`</mark> `https://api.insolventiemonitor.nl/api/v1/dev/relations`

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |
| X-API-Key    | string | Api Key          |

#### Request Body

| Name        | Type   | Description                   |
| ----------- | ------ | ----------------------------- |
| VATnumber   | string | VAT number such as NL00000000 |
| COCnumber   | string | Chamber of Commerce number    |
| CompanyName | string | Name of your relation         |

{% tabs %}
{% tab title="202 " %}

```
{
    "message": "Succesfully created relation, we have scheduled checking task, if the're are any problems, you'll receive a notification by webhook or email.",
    "response": {
        "ID": "17f94649-88c8-4a81-b599-bb956d93bd6f",
        "CreatedAt": "2021-05-01T10:08:17.625945+02:00",
        "UpdatedAt": "2021-05-01T10:08:17.625945+02:00",
        "DeletedAt": null,
        "CompanyName": "EXAMPLE BV",
        "CocNumber": "12345678",
        "VatNumber": "",
        "VatCheckDate": null,
        "TrackResults": null,
        "LastInsolvencyCheck": null,
        "InsolventieRecords": null,
        "LastPublicationsCheck": null,
        "KvkPublicatiesRercords": null,
        "LastLocationsCheck": null,
        "KvkVestigingen": null
    },
    "succesfull": true
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "message": "Bad Request",
    "succesfull": false
}
```

{% endtab %}

{% tab title="409 " %}

```
{
    "message": "Unable to create this relation",
    "succesfull": false
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.insolventiemonitor.nl/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
