# MOVE Admin API

## Authentication <a href="#gettingstartedwiththedolphinmovetimelineservice-authentication" id="gettingstartedwiththedolphinmovetimelineservice-authentication"></a>

### Fetch or create <a href="#gettingstartedwiththedolphinmovetimelineservice-authentication" id="gettingstartedwiththedolphinmovetimelineservice-authentication"></a>

Registration or login of a user is equivalent to obtaining the security tokens and initialising the frontend MOVE SDK with those tokens. In other words: use the registration request to obtain the user tokens, and then forward the user tokens to your app for initializing the MOVE SDK (using a [MoveAuth](/move-platform/sdk/models/moveauth.md) object).

{% hint style="info" %}
Api Key: [MOVE Backend](/move-platform/backend/move-backend.md)
{% endhint %}

## Create or fetch user

<mark style="color:green;">`POST`</mark> `https://sdk.dolph.in/v20/user`

This request enables users to either fetch an existing user or create a new one. The response object includes an access token, which can be used to initialize the MOVE SDK on your mobile device. This access token is valid for 5 days. The registration process supports both new and existing user IDs.

#### Headers

| Name                                            | Type   | Description                       |
| ----------------------------------------------- | ------ | --------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | **Basic \<ProjectId>:\<API-Key>** |

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| userId<mark style="color:red;">\*</mark> | string | An ID for the given user should be unique                                                                                                                                                                                                                                                                                                                          |
| qualifier                                | string | An unique device identifier (see Get Device Qualifier [Android](/move-platform/sdk/api-interface/android/services.md#get-device-qualifier) / [iOS](/move-platform/sdk/api-interface/ios/services.md#get-device-qualifier) / [React](/move-platform/sdk/api-interface/react-native/services.md) / [Flutter](/move-platform/sdk/api-interface/flutter/services.md)). |

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

```
{
  "accessToken": "string",
  "refreshToken": "string",
  "userId": "string",
  "audience": "string",
  "installationId": "string",
  "projectId": 0
}
```

{% endtab %}

{% tab title="403: Forbidden Invalid authorization" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Fetch auth code

<mark style="color:green;">`GET`</mark> `https://sdk.dolph.in/v20/user/authcode`

The Auth Code is a unique identifier (UUID) used to initialize the SDK on the front end. This code is fetched from the backend and is valid for 10 minutes. By using the Auth Code, you simplify the process of integrating the SDK into your front-end application.

#### Headers

<table><thead><tr><th>Name</th><th width="234">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td><strong>Basic &#x3C;ProjectId>:&#x3C;API-Key></strong></td></tr></tbody></table>

#### Query Parameters

<table><thead><tr><th>Name</th><th width="234">Type</th><th>Description</th></tr></thead><tbody><tr><td>userId<mark style="color:red;">*</mark></td><td>string</td><td>The unique identifier for the user for whom the Auth Code is being requested.</td></tr></tbody></table>

#### Response Body

<table><thead><tr><th>Name</th><th width="227">Type</th><th>Description</th></tr></thead><tbody><tr><td>authCode<mark style="color:red;">*</mark></td><td>string</td><td>UUID to initalize SDK valid for 10 minutes</td></tr></tbody></table>

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

```
{
  "authCode": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```

{% endtab %}

{% tab title="403 Forbidden" %}

```
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### Delete User <a href="#gettingstartedwiththedolphinmovetimelineservice-gettingnotifiedaboutnewtimelineitems" id="gettingstartedwiththedolphinmovetimelineservice-gettingnotifiedaboutnewtimelineitems"></a>

This request permanently deletes all user data associated with a specific user ID. Please note that the data is irreversibly lost.

## Delete User

<mark style="color:red;">`DELETE`</mark> `https://sdk.dolph.in/v20/user`

Deletes all user data permanently and all of its data

#### Headers

| Name                                            | Type   | Description                       |
| ----------------------------------------------- | ------ | --------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | **Basic \<ProjectId>:\<API-Key>** |
|                                                 |        |                                   |

#### Request Body

| Name                                        | Type   | Description            |
| ------------------------------------------- | ------ | ---------------------- |
| userId<mark style="color:red;">\*</mark>    | String | Id of Move SDK user    |
| projectId<mark style="color:red;">\*</mark> | String | Id of MOVE SDK project |

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### User Config

API for retrieving or modifying user configuration settings.

## Fetch user config

<mark style="color:blue;">`GET`</mark> `https://sdk.dolph.in/v20/user/config`

fetch the current config for the given user

#### Query Parameters

| Name                                        | Type   | Description            |
| ------------------------------------------- | ------ | ---------------------- |
| projectId<mark style="color:red;">\*</mark> | String | Id of MOVE SDK project |
| userId                                      | String | Id of Move SDK user    |

#### Headers

| Name          | Type   | Description                       |
| ------------- | ------ | --------------------------------- |
| Authorization | String | **Basic \<ProjectId>:\<API-Key>** |

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

```
{
  "eco": {
    "co2EmissionBase": 160,
    "co2EngineType": "INTERNAL_COMBUSTION"
  }
}
```

{% endtab %}
{% endtabs %}

## Patch user config

<mark style="color:purple;">`PATCH`</mark> `https://dolph.in/v20/user/config`

update the current config for the given user

#### Query Parameters

| Name                                        | Type   | Description            |
| ------------------------------------------- | ------ | ---------------------- |
| userId<mark style="color:red;">\*</mark>    | String | Id of Move SDK user    |
| projectId<mark style="color:red;">\*</mark> | String | Id of MOVE SDK project |

#### Headers

| Name                                            | Type   | Description                       |
| ----------------------------------------------- | ------ | --------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | **Basic \<ProjectId>:\<API-Key>** |

### User scores

This API enables you to retrieve scores for a specific user, with a focus on Exposure to Risk (ETR) and Move scores. Detailed parameters and responses are provided below

#### Exposure to risk

Why It's Important: The more time you spend driving, the greater your exposure to the risk of accidents. This risk is influenced not just by the distance traveled but also by the duration and timing of each trip. For instance, many accidents occur within the first few minutes of a drive, and the risk increases during extended journeys. Avoiding very short trips and taking breaks on longer ones can help mitigate this risk.&#x20;

How It Works: The ETR Score is calculated based on the number and duration of your trips. Additionally, the type of roads you travel on is factored into the score, with highways being the safest and rural roads posing higher risks. This score helps you understand and manage your exposure to risk, guiding you towards safer driving habits.MOVE Score

#### MOVE Score

Why It's Important: The MOVE Score is your total risk score, offering a clear and comprehensive understanding of your driving safety. It reflects your overall driving habits, combining key factors that influence driving risks.&#x20;

How It Works: This score merges your MOVE IQ, which evaluates your driving style, with your ETR, which considers how often and how long you drive. By bringing together these aspects, the MOVE Score provides a complete overview of your driving safety, taking into account both the quality of your driving and your time on the road.

## User scores

<mark style="color:blue;">`GET`</mark> `https://dolph.in/v20/scores/user`

Fetch scores of user, at the moment only ETR and Move score is supported.

#### Query Parameters

| Name                                        | Type    | Description                                                                                             |
| ------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| userId<mark style="color:red;">\*</mark>    | String  | Id of Move SDK user                                                                                     |
| projectId<mark style="color:red;">\*</mark> | String  | Id of MOVE SDK project                                                                                  |
| startTs<mark style="color:red;">\*</mark>   | Integer | Start timestamp for the score retrieval.                                                                |
| endTs<mark style="color:red;">\*</mark>     | Integer | End timestamp for the score retrieval.                                                                  |
| timeframe                                   | String  | Timeframe for the score calculation. Available values include DAILY, WEEKLY, MONTHLY, YEARLY, and NONE. |

#### Headers

| Name                                            | Type   | Description                       |
| ----------------------------------------------- | ------ | --------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | **Basic \<ProjectId>:\<API-Key>** |

{% tabs %}
{% tab title="200: OK " %}
This example response includes Exposure to Risk and Move scores along with historical data for various timeframes (daily, weekly, monthly, yearly).

```json
{
  "etr": 0,
  "moveScore": 0,
  "moveIq": 0,
  "dates": "string",
  "history": {
    "daily": [
      {
        "year": 2023,
        "month": 11,
        "day": 9,
        "weekOfYear": 45,
        "date": "09.11.2023",
        "score": 94,
        "moveScore": 94,
        "moveIq": 94,
        "calculated": "2023-11-09T15:04:13.941729Z"
      }
    ],
    "weekly": [
      {
        "year": 2023,
        "month": 11,
        "day": 9,
        "weekOfYear": 45,
        "date": "09.11.2023",
        "score": 94,
        "moveScore": 94,
        "moveIq": 94,
        "calculated": "2023-11-09T15:04:13.941729Z"
      }
    ],
    "monthly": [
      {
        "year": 2023,
        "month": 11,
        "day": 9,
        "weekOfYear": 45,
        "date": "09.11.2023",
        "score": 94,
        "moveScore": 94,
        "moveIq": 94,
        "calculated": "2023-11-09T15:04:13.941729Z"
      }
    ],
    "yearly": [
      {
        "year": 2023,
        "month": 11,
        "day": 9,
        "weekOfYear": 45,
        "date": "09.11.2023",
        "score": 94,
        "moveScore": 94,
        "moveIq": 94,
        "calculated": "2023-11-09T15:04:13.941729Z"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Access Management&#x20;

### Block / Unblock User

Use this API endpoint to block or unblock a MOVE SDK User. When a user is blocked, the MOVE SDK Backend will return an HTTP Error 403 for all subsequent requests made by the blocked user.

## Block or unblock Move SDK user

<mark style="color:green;">`POST`</mark> `https://sdk.dolph.in/v20/access/block`

#### Request Body

| Name                                        | Type    | Description |
| ------------------------------------------- | ------- | ----------- |
| projectId<mark style="color:red;">\*</mark> | Int     |             |
| userId<mark style="color:red;">\*</mark>    | String  |             |
| block<mark style="color:red;">\*</mark>     | Boolean |             |

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

```javascript
{
    // Response
}
```

{% 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://docs.movesdk.com/move-platform/backend/move-backend/move-admin-api.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.
