# Management API

## Intro

This is the API documentation for the **IntelliProve management API**, which allows you to perform management operations such as requesting reminaing quota.

## Prerequisites

If you are new to this developer portal, we recommend first reading the [Plug-in: overview](https://docs.intelliprove.com/product-docs-v1), a five minute read which will get you acquainted with how our plug-in works and how it can be integrated into your platform. To integrate the plug-in into your platform, follow our [Plug-in](https://docs.intelliprove.com/technical-docs-v1) documentation.

> Keep in mind that this API is mainly geared towards backend functionality such as requesting quota. The actual health check is performed using our [web plug-in](https://docs.intelliprove.com/product-docs-v1).

## Setup

### Environments

As a customer, you will receive information about the environment (API base URL) to use for development and production.

### Authentication

All the endpoints described below require an API key or a bearer token in the header for authentication purposes.

#### API Key

An API key forms a permanent access key to authenticate with the API. Your API key should **never be exposed** **in your front-end** and only be used on protected servers and back-end systems.

API keys are sent in the header of the request:  
`x-api-key: <your-api-key>`

No API key and interested in our product? Contact us ([info@intelliprove.com](mailto:info@intelliprove.com)) or [set up a call](https://calendly.com/joeri-tulkens/30min)

## Auth endpoints

### Get user details

GET`https://engine.intelliprove.com/v1/auth/me`

Use this endpoint to retrieve user information for the current user. The user information defines to which user group and customer you belong.

Request

**curl**

```bash
curl --location 'https://engine.intelliprove.com/v1/auth/me' \
--header 'Accept: application/json' \
--header 'x-api-key: your-api-key'
```

Response

**200**

```json
{
    "email": "sales@intelliprove.com",
    "customer": "intelliprove",
    "group": "contributor"
}
```

**403**

```json
{
    "status": 403,
    "reason": "Missing or invalid authentication credentials."
}
```

### Create action token

POST`https://engine.intelliprove.com/v1/auth/action-token`

Create a new action token with optional custom lifetime and custom metadata. Do not place confidential information in the metadata object. This endpoint can only be called with an API key.

Body parameters

<table><tbody><tr><td style="padding-left:0.75rem"><code>expire_in</code><span class="api-type">Integer</span></td><td><span class="api-kind api-kind-optional">optional</span></td><td>Lifetime of the token in seconds. Defaults to 6 hours, maximum 12 hours.</td></tr><tr><td style="padding-left:0.75rem"><code>meta</code><span class="api-type">Object</span></td><td><span class="api-kind api-kind-optional">optional</span></td><td>Custom metadata to place in the action token.</td></tr></tbody></table>

Request

**curl**

```bash
curl --location 'https://engine.intelliprove.com/v1/auth/action-token' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your-key' \
--data '{
  "expire_in": 2592000,
  "meta": {}
}'
```

Response

**201**

```json
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImVtYWlsIjoiIiwiY3VzdG9tZXIiOiJ0ZXN0aW5nLWFwaS1rZXkiLCJncm91cCI6ImFkbWluIiwibWF4X21lYXN1cmVtZW50X2NvdW50IjotMX0sIm1ldGEiOnt9LCJleHAiOjE2ODU2NTE1OTl9.uwOflWBIWUVLXFpMzVG3pLRet1Q-9vbzF1XNfpuKTC0"
}
```

**401**

```json
{
    "status": 401,
    "reason": "Missing or invalid authentication credentials."
}
```

**500**

```json
{
    "status": 500,
    "reason": "Could not create new action token"
}
```

### Delete patient data

DELETE`https://engine.intelliprove.com/v1/patient/data`

Delete all results for a specific patient.

Query parameters

<table><tbody><tr><td style="padding-left:0.75rem"><code>patient-ref</code><span class="api-type">string</span></td><td><span class="api-kind api-kind-optional">optional</span></td><td>Patient for which the health checks are to be deleted.</td></tr><tr><td style="padding-left:0.75rem"><code>performer-ref</code><span class="api-type">string</span></td><td><span class="api-kind api-kind-optional">optional</span></td><td>Additional filter on performer reference.</td></tr></tbody></table>

Request

**curl**

```bash
curl --location --request DELETE 'https://engine.intelliprove.com/v1/patient/data?patient-ref=your-patient-ref&performer-ref=your-performer-ref' \
--header 'x-api-key: your-api-key'
```

Response

**400**

```json
{
    "detail": "Please provide a patient reference."
}
```

**403**

```json
{
    "detail": "Provided patient is not allowed."
}
```

## Account endpoints

### Get quota

GET`https://engine.intelliprove.com/v1/account/quota`

Receive information abour your quota and current usage.

Request

**curl**

```bash
curl --location 'https://engine.intelliprove.com/v1/account/quota' \
--header 'x-api-key: your-api-key'
```

Response

**200**

```json
{
    "performed_measurements": 0,
    "quota": 10000,
    "period_start": "2023-06-01T00:00:00",
    "period_stop": "2023-07-01T00:00:00",
    "usage_percentage": 0.0
}
```

**403**

```json
Only admins are allowed to use this request
```

**401**

```json
{
    "detail": "Missing or invalid authentication credentials."
}
```

## Regulatory endpoints

### Get CE Label

GET`https://engine.intelliprove.com/v1/regulatory/ce-label`

Request the IntelliProve medical device label

Request

**curl**

```bash
curl --location 'https://engine.intelliprove.com/v1/regulatory/ce-label'
```

Response

**200**

```json
// returns the medical device label as PNG file
```

Refer to our [Instructions for use](https://docs.intelliprove.com/instructions-for-use) for more information related to our medical device’s product description and intended use.
