> For the complete documentation index, see [llms.txt](https://iothentix.gitbook.io/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iothentix.gitbook.io/api-reference/reference/http-api-reference/idp-api.md).

# IdP API

The IdP API is used to validate issued access tokens with our IoT identity provider.

## Introspection Endpoint

Use this endpoint to verify the access tokens issued by the IdP. This endpoint is mainly used by the IoT platform but may also be used by IoT devices to verify the received access token.&#x20;

## Introspect token

<mark style="color:green;">`POST`</mark> `https://iot-idp.demo.apps.iothentix.io/idp/introspect`

Validate the access token with the IdP.

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | String | Basic authentication |

#### Request Body

| Name                                    | Type   | Description                                  |
| --------------------------------------- | ------ | -------------------------------------------- |
| token<mark style="color:red;">\*</mark> | String | Access token issued by the identity provider |

{% tabs %}
{% tab title="200: OK The provided access token is VALID." %}

```json
{
    "active": true,
    "sub": "test.device.01",
    "scope": "tenant.demo refresh.token temp",
    "iss": "https://iot-idp.demo.apps.iothentix.com/",
    "exp": 1658179642
}
```

{% endtab %}

{% tab title="401: Unauthorized The basic authentication failed. " %}

```json
{
    "error": {
        "code": 401,
        "status": "Unauthorized",
        "request": "<REQUEST_ID>",
        "message": "The request could not be authorized"
    }
}
```

{% endtab %}

{% tab title="200: OK The provided access token is INVALID." %}

```json
{
    "active": false
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal error in the IdP infrastructure. " %}

```json
{
    "error": 
    {
        "code": 500,
        "status": "Internal Server Error",
        "request": "<REQUEST_ID>",
        "message": "An internal server error occurred, please contact the system administrator"
    }
}
```

{% endtab %}

{% tab title="404: Not Found The resource could not be found or the wrong HTTP method was used." %}

```json
{
    "error": {
        "code": 404,
        "status": "Not Found",
        "request": "<REQUEST_ID>",
        "message": "The requested resource could not be found"
    }
}
```

{% endtab %}
{% endtabs %}
