# Claims

{% content-ref url="broken-reference" %}
[Broken link](https://docs-old.telematicssdk.com/platform-features/fnol-inspections-and-damage-recognition/broken-reference)
{% endcontent-ref %}

{% hint style="warning" %}
**Note:** FNOL, Inspections and Damage Recognition services are closely integrated with [Vehicle Management service](https://docs-old.telematicssdk.com/platform-features/car-service).\
You have to create a vehicle first to register a claim.
{% endhint %}

## Available accident types list

<mark style="color:blue;">`GET`</mark> `https://insp.telematicssdk.com/api/v1/accident_types`

**Authorization:** Required with Token

#### Headers

| Name          | Type   | Description                                                              |
| ------------- | ------ | ------------------------------------------------------------------------ |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v1/profiles/login> |

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

```
{
  "Result": {
    "AccidentTypes": [
      {
        "Label": "string", // Accident type's human label
        "Key": "string" // Accident type's enum
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Create a Claim

<mark style="color:green;">`POST`</mark> `https://insp.telematicssdk.com/api/v1/claims`

**Authorization:** Required with Token\
\
**Content Type:** application/json

#### Headers

| Name          | Type   | Description                                                              |
| ------------- | ------ | ------------------------------------------------------------------------ |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v1/profiles/login> |

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

```
{
  "Result": {
    "Claim": {
      "Id": 0,
      "Paint": "solid",
      "ClaimDateTime": "2020-10-20T14:50:13.153Z",
      "Description": "string",
      "Lat": "string",
      "Lng": "string",
      "DriverFirstName": "string",
      "DriverLastName": "string",
      "DriverPhone": "string",
      "DriverLicenseNo": "string",
      "InvolvedFirstName": "string",
      "InvolvedLastName": "string",
      "InvolvedLicenseNo": "string",
      "InvolvedVehicleLicenseplateno": "string",
      "VehicleMake": "string",
      "VehicleModel": "string",
      "VehicleLicenseplateno": "string",
      "CarToken": "string",
      "CarTowing": true,
      "CarDrivable": true,
      "CreatedAt": "2020-10-20T14:50:13.153Z",
      "UpdatedAt": "2020-10-20T14:50:13.153Z",
      "DriverName": "string",
      "InvolvedComments": "string",
      "Locations": "string",
      "State": "draft",
      "CanEdit": true,
      "Screens": [],
      "Quotes": [],
      "DamageReports": []
    }
  }
}
```

{% endtab %}
{% endtabs %}

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

```
{
  "Claim": {
    "AccidentType": "string", // Required. Available values : road_accident, vandalism, fire_damage, glass_damage, cataclysm, animals, hijacking, other | see /api/v1/accident_types
    "Paint": "solid", // Required. Available values : solid, metallic, pearl
    "ClaimDateTime": "2020-10-20T14:42:05.308Z",
    "Description": "string", // Claim Description (what happened)
    "Lat": "string", // Claim Location
    "Lng": "string", // Claim Location
    "DriverFirstName": "string",
    "DriverLastName": "string",
    "DriverPhone": "string",
    "DriverLicenseNo": "string",
    "InvolvedFirstName": "string", // Involved Party
    "InvolvedLastName": "string",
    "InvolvedLicenseNo": "string",
    "InvolvedVehicleLicenseplateno": "string",
    "VehicleMake": "string", // Required
    "VehicleModel": "string", // Required
    "CarToken": "string", // Required
    "VehicleLicenseplateno": "string",
    "Source": "string", // Available values : mobile_app, data_hub,
    "CarTowing": "boolean", // Yes/No
    "CarDriveable": "boolean", // Yes/No
    "InvolvedComments": "string", // Info about involved drivers
    "Locations": "string", // Address
    "CreatedLat": "string", // Current device location
    "CreatedLng": "string" // Current device location
  }
```

{% endtab %}
{% endtabs %}

## Update a Claim

<mark style="color:orange;">`PUT`</mark> `https://insp.telematicssdk.com/api/v1/claims`

**Authorization:** Required with Token\
\
**Content-Type:** application/json\
\
**Important:** You can update claim only if it's state is **Draft**, **Pending** or **Processing**.

#### Headers

| Name          | Type   | Description                                                              |
| ------------- | ------ | ------------------------------------------------------------------------ |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v1/profiles/login> |

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

```
{
  "Result": {
    "Claim": {
      "Id": 0,
      "Paint": "solid",
      "ClaimDateTime": "2020-10-20T14:50:13.153Z",
      "Description": "string",
      "Lat": "string",
      "Lng": "string",
      "DriverFirstName": "string",
      "DriverLastName": "string",
      "DriverPhone": "string",
      "DriverLicenseNo": "string",
      "InvolvedFirstName": "string",
      "InvolvedLastName": "string",
      "InvolvedLicenseNo": "string",
      "InvolvedVehicleLicenseplateno": "string",
      "VehicleMake": "string",
      "VehicleModel": "string",
      "VehicleLicenseplateno": "string",
      "CarToken": "string",
      "CarTowing": true,
      "CarDrivable": true,
      "CreatedAt": "2020-10-20T14:50:13.153Z",
      "UpdatedAt": "2020-10-20T14:50:13.153Z",
      "DriverName": "string",
      "InvolvedComments": "string",
      "Locations": "string",
      "State": "draft",
      "CanEdit": true,
      "Screens": [],
      "Quotes": [],
      "DamageReports": []
    }
  }
}
```

{% endtab %}
{% endtabs %}

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

```
{
  "Claim": {
    "AccidentType": "string", // Required. Find available values via /api/v1/accident_types
    "Paint": "solid", // Required. Available values : solid, metallic, pearl
    "ClaimDateTime": "2020-10-20T14:42:05.308Z",
    "Description": "string",
    "Lat": "string",
    "Lng": "string",
    "DriverFirstName": "string", // you can get it via https://docs.telematicssdk.com/platform-features/back-end-as-a-service/management
    "DriverLastName": "string", / you can get it via https://docs.telematicssdk.com/platform-features/back-end-as-a-service/management
    "DriverPhone": "string", // you can get it via https://docs.telematicssdk.com/platform-features/back-end-as-a-service/management
    "DriverLicenseNo": "string",
    "InvolvedFirstName": "string", // Involved parties in the accident
    "InvolvedLastName": "string", // Involved parties in the accident
    "InvolvedLicenseNo": "string", // Involved parties in the accident
    "InvolvedVehicleLicenseplateno": "string", // Involved parties in the accident
    "VehicleMake": "string", // Required // https://docs.telematicssdk.com/platform-features/car-service/directories
    "VehicleModel": "string", // Required // https://docs.telematicssdk.com/platform-features/car-service/directories
    "VehicleLicenseplateno": "string"
  }
```

{% endtab %}
{% endtabs %}

## Update Claim's State

<mark style="color:orange;">`PUT`</mark> `https://insp.telematicssdk.com/api/v1/claims/:id/change_state`

**Authorization:** Required with Token\
\
**Important!** Follow the statuses workflow\
\
**Content Type:** application/json

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| ID   | integer | Claim ID    |

#### Headers

| Name          | Type   | Description                                                               |
| ------------- | ------ | ------------------------------------------------------------------------- |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v1/profiles/login/> |

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

```
{
  "Result": {
    "Claim": {
      "Id": 0,
      "Paint": "solid",
      "ClaimDateTime": "2020-10-20T14:50:13.153Z",
      "Description": "string",
      "Lat": "string",
      "Lng": "string",
      "DriverFirstName": "string",
      "DriverLastName": "string",
      "DriverPhone": "string",
      "DriverLicenseNo": "string",
      "InvolvedFirstName": "string",
      "InvolvedLastName": "string",
      "InvolvedLicenseNo": "string",
      "InvolvedVehicleLicenseplateno": "string",
      "VehicleMake": "string",
      "VehicleModel": "string",
      "VehicleLicenseplateno": "string",
      "CarToken": "string",
      "CarTowing": true,
      "CarDrivable": true,
      "CreatedAt": "2020-10-20T14:50:13.153Z",
      "UpdatedAt": "2020-10-20T14:50:13.153Z",
      "DriverName": "string",
      "InvolvedComments": "string",
      "Locations": "string",
      "State": "draft",
      "CanEdit": true,
      "Screens": [],
      "Quotes": [],
      "DamageReports": []
    }
  }
}
```

{% endtab %}
{% endtabs %}

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

```
{
  "Claim": {
    "state": "string" // required see states's flow (https://docs.telematicssdk.com/platform-features/fnol-inspections-and-damage-recognition/how-it-works#statuses-workflow)
  }
```

{% endtab %}
{% endtabs %}

## Show a Claim

<mark style="color:blue;">`GET`</mark> `https://insp.telematicssdk.com/api/v1/claims/:id`

**Authorization:** Required with Token

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| ID   | integer | Claim ID    |

#### Headers

| Name          | Type   | Description                                                               |
| ------------- | ------ | ------------------------------------------------------------------------- |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v1/profiles/login/> |

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

```
{
  "Result": {
    "Claim": {
      "Id": 0,
      "Paint": "solid",
      "ClaimDateTime": "2020-10-20T14:50:13.153Z",
      "Description": "string",
      "Lat": "string",
      "Lng": "string",
      "DriverFirstName": "string",
      "DriverLastName": "string",
      "DriverPhone": "string",
      "DriverLicenseNo": "string",
      "InvolvedFirstName": "string",
      "InvolvedLastName": "string",
      "InvolvedLicenseNo": "string",
      "InvolvedVehicleLicenseplateno": "string",
      "VehicleMake": "string",
      "VehicleModel": "string",
      "VehicleLicenseplateno": "string",
      "CarToken": "string",
      "CarTowing": true,
      "CarDrivable": true,
      "CreatedAt": "2020-10-20T14:50:13.153Z",
      "UpdatedAt": "2020-10-20T14:50:13.153Z",
      "DriverName": "string",
      "InvolvedComments": "string",
      "Locations": "string",
      "State": "draft",
      "CanEdit": true,
      "CreatedLat": "string",
      "CreatedLng": "string",      
      "Screens": [],
      "Quotes": [],
      "DamageReports": []
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Show user's Claims

<mark style="color:blue;">`GET`</mark> `https://insp.telematicssdk.com/api/v1/claims/`

**Authorization:** Required with Token

#### Headers

| Name          | Type   | Description                                                                |
| ------------- | ------ | -------------------------------------------------------------------------- |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v/1/profiles/login/> |

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

```
{
  "Result": {
    "Claims": [
      {
        "Id": 0,
        "Paint": "solid",
        "ClaimDateTime": "2020-10-20T14:50:13.153Z",
        "Description": "string",
        "Lat": "string",
        "Lng": "string",
        "DriverFirstName": "string",
        "DriverLastName": "string",
        "DriverPhone": "string",
        "DriverLicenseNo": "string",
        "InvolvedFirstName": "string",
        "InvolvedLastName": "string",
        "InvolvedLicenseNo": "string",
        "InvolvedVehicleLicenseplateno": "string",
        "VehicleMake": "string",
        "VehicleModel": "string",
        "VehicleLicenseplateno": "string",
        "CarToken": "string",
        "CarTowing": true,
        "CarDrivable": true,
        "CreatedAt": "2020-10-20T14:50:13.153Z",
        "UpdatedAt": "2020-10-20T14:50:13.153Z",
        "DriverName": "string",
        "InvolvedComments": "string",
        "Locations": "string",
        "State": "draft",
        "CanEdit": true,
        "Screens": [],
        "Quotes": [],
        "DamageReports": []
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Delete a Claim

<mark style="color:red;">`DELETE`</mark> `https://insp.telematicssdk.com/api/v1/claims/:id`

**Authorization:** Required with Token

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| claim\_id | string | Claim ID    |

#### Headers

| Name          | Type   | Description                                                              |
| ------------- | ------ | ------------------------------------------------------------------------ |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v1/profiles/login> |

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

```
```

{% endtab %}
{% endtabs %}

## Get the closest to claim trips

<mark style="color:blue;">`GET`</mark> `https://insp.telematicssdk.com/api/v1/claims/:id/closest_trips`

**Authorization:** Required with Token

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| claim\_id | string | Claim ID    |

#### Headers

| Name          | Type   | Description                                                              |
| ------------- | ------ | ------------------------------------------------------------------------ |
| Authorization | string | Token. Get it via <https://insp.telematicssdk.com/api/v1/profiles/login> |

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

```
{
  "Result": {
    "trip": {
      "Id": 0,
      "TrackToken": "string",
      "AddressFinish": "string",
      "AddressStart": "string",
      "AverageSpeed": 0,
      "DeviceToken": "string",
      "MaxSpeed": 0,
      "OverSpeedMileage": 0,
      "MidOverSpeedMileage": 0,
      "HighOverSpeedMileage": 0,
      "Rating100": 0,
      "RichTrackid": 0,
      "PhoneUsage": 0,
      "StartDate": "string",
      "EndDate": "string",
      "VehicleToken": "string",
      "StartDateNoTz": "string",
      "EndDateNoTz": "string"
    },
    "all_trips_ids": [ // List all customer trips ids
      {
        "TrackToken": "string"
      }
    ],
    "index": 0 // Index this closest trip in the array "all_trips_ids" 
  }
}
```

{% endtab %}
{% endtabs %}
