# Welcome

The IntServ Access API allows your application to integrate with access control systems connected to the IntServ Access platform. The API contains a set of HTTP endpoints that provides a unified interface that works in the same way regardless of which access control system you are targeting.


# Overview

### Request and Response Formats

IntServ Access API is RPC-based. In general, requests uses HTTP POST and the JSON data format for request and response payloads. Requests is authorized using the `Authorization` header and an access token (see the [Authentication](/basics/authentication) section for more details).

### Date and Time Format

Date and time is always expressed in UTC, formatted according to ISO 8601, if nothing else is explicitly stated in the endpoint documentation.

Example: `2020-01-01T12:30:00Z`

### Summary of API Specifications

|                   |                  |
| ----------------- | ---------------- |
| Content type      | application/json |
| Encoding          | UTF-8            |
| Protocol / Scheme | HTTPS / TLS 1.2  |
| Date Time Format  | ISO 8601         |
|                   |                  |


# Authentication

Requests to the API is authorized using an access token that should be specified in the `Authorization` header with the value `Bearer <access token>` , where `access token` is an api key obtained from the IntServ Access portal.

Example:

`Authorization: Bearer <access token>`

There are mainly two different types of access tokens that can be used: *Integration API Key* and *App API Key.* Which type of access token to use depends on the context of the request and is described in the documentation for each endpoint.

| Access Token Types  |                                                               |
| ------------------- | ------------------------------------------------------------- |
| Integration API Key | Used to authorize a request to target a specific integration. |
| App API Key         | Used for operations that is scoped to an integration app.     |


# Get Started

### Obtain a Integration API Key

To be able to perform API operations targeting a specific integration, you need an *Integration API Key.*

* Select **Integrations** in the navigation pane, and find the integration to create a key for.
* Click **Settings** available on the integration
* Choose the **Keys** tab and click **Generate API Key**.
* When the key has been generated, a dialog is displayed with the API key. Copy the key using the **Copy Key** button, and paste it where it is supposed to be stored (typically in a key vault or configuration file). Note that once the dialog is closed, you will not be able to retrieve the key again.&#x20;

Using the created API key will only authorize access to the integration it was created for. This means that an Integration API Key must be created for each integration your app should operate on.

{% hint style="warning" %}
Ensure that the API key always is stored safe. The API key is only intended to be used on server-side (backend), and *never* in client-side applications for security reasons. Do *never* share the key to anyone you don't trust or third party.
{% endhint %}

{% hint style="info" %}
If a key needs to be revoked, just generate a new API key following the steps above. This automatically revokes the previously generated key.
{% endhint %}


# Access Keys

Depending on the access control system, proximity serial numbers is interpreted differently. For example, some systems may use the whole raw serial number, while others uses only a part of it, or forms a vendor specific serial number based on an algorithm. As IntServ Access are an access control system independent integration platform, IntServ Access takes care of all this behind the scenes for you. In order to be able to do that, the raw access key serial number is always used.&#x20;

### Supported Access Key Types

The following types of access keys is currently supported:

| Type        | Description                                                                                                                                                                                                                       |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `proximity` | A contactless card or tag, using RFID-based technology as EM or Mifare.                                                                                                                                                           |
| `code`      | A code used to authorize a specific user instead of a card or tag. Should **not** to be mixed up with PIN (Personal Identification Number), that is often used in combination with a proximity access key for increased security. |

### Proximity Access Keys

Proximity identification numbers are typically expressed as fixed size decimal or hexdecimal (prefixed with 0x) values. The identification number **must** always be the **raw CSN** and always in **fixed size** format, regardless if expressed in decimal or hexdecimal.&#x20;

{% hint style="info" %}
Reading out the raw serial number from a proximity access key may require a RFID-desktop reader that supports output in a fixed size format.&#x20;
{% endhint %}

#### Proximity Format Specifiers

To support integrators transitioning FTP-based integrations to use IntServ Access API, there is also a set of format specifiers available to specify the key type. Using a format specifier does not require a fixed size serial number. Serial numbers can be expressed in either decimal or hexdecimal when a format specifier is used.

| Format specifier  | Example                  | Description                                                                    |
| ----------------- | ------------------------ | ------------------------------------------------------------------------------ |
| <p>EM:</p><p></p> | <p>EM:12345</p><p></p>   | <p>EM identification number.</p><p>1-13 digits / 40-bit CSN.</p>               |
| <p>MC:</p><p></p> | <p>MC:12345</p><p></p>   | <p>Mifare (Classic) identification number.</p><p>1-10 digits / 32-bit CSN.</p> |
| <p>MD:</p><p></p> | <p>MD:1234567</p><p></p> | <p>Mifare (DesFire) identification number.</p><p>1-17 digits / 56-bit CSN.</p> |

#### Composite Keys

Proximity access keys with multiple RFID technologies (typically EM and Mifare combined) is supported. These access keys if referred to as *composite* access keys. Identification numbers for a composite key is separated with `|` (pipe).

### Codes

Codes are **always** specified as a **decimal** value. It is recommended to allow IntServ Access to generate a code automatically, to ensure that it will be a unique code. If the code size is not supported by the targeted access control system, the code is truncated from the left in order to fit the targeted access control system.

### Examples

Specifying an EM proximity acccess key in fixed size decimal format (raw csn):

```
.
"key": 
{
    "identification": "0001234567890",
    "type": "proximity"
}
.
```

Specifying an EM proximity acccess key in fixed size hexdecimal format (raw csn):

```
.
"key": 
{
    "identification": "0x00499602d2",
    "type": "proximity"
}
.
```

Specifying a Mifare proximity acccess key in fixed size hexdecimal format (raw 32-bit csn):

```
.
"key": 
{
    "identification": "0x2ac7ee00",
    "type": "proximity"
}
.
```

Specifying a 6-digit code:

```
.
"key": 
{
    "identification": "334455",
    "type": "code"
}
.
```

Specifying a EM proximity access key with format specifiers in decimal format:

```
.
"key": 
{
    "identification": "EM:123456",
    "type": "proximity"
}
.
```

Specifying a composite access key (EM and Mifare combined) in fixed size hexdecimal format:

```
.
"key": 
{
    "identification": "0x00499602d2|0x2ac7ee00",
    "type": "proximity"
}
.
```


# Event Types

### Access Granted Event Types

| Event Type | Description                                           |
| ---------- | ----------------------------------------------------- |
| 100        | Generic event for unclassified access granted events. |
| 101        | Access granted using **code**.                        |
| 102        | Access granted using **proximity key**.               |
| 103        | Access granted using **proximity key** and **PIN**.   |
| 104        | Exit button.                                          |
| 105        | Access granted using a **common code**.               |

### Access Denied Event Types

| Event Type | Description                                                                      |
| ---------- | -------------------------------------------------------------------------------- |
| 200        | Generic event for unclassified access denied events.                             |
| 201        | Access denied due to the access key used is unknown.                             |
| 202        | Access denied due to the access key has expired (outside the validity period).   |
| 203        | Access denied due to the access key has been blacklisted.                        |
| 204        | Access denied due to the access key has been disabled.                           |
| 205        | Access denied due to an PIN has not been set for the access key.                 |
| 206        | Access denied due to the access key is not authorized.                           |
| 207        | Access denied due to the access key was used outside the expected time schedule. |


# Integration Request Flow


# Integration Request Event

Event emitted to an App when a new integration is requested and needs to be authorized. This event initiates the [Integration Request Flow](/integration-request-flow).

### Event Data

{% tabs %}
{% tab title="Sample Data" %}

```
{
    "appCode": "ABCDEF",
    "activationCode": "ABCDEF123456",
    "callbackUrl": ""
}
```

{% endtab %}

{% tab title="Data Schema" %}

{% endtab %}
{% endtabs %}


# Access Levels Sync Event

Event emitted to an App when there has been an change to the access levels for an integration. A change includes addition, removal or name change.


# /appflows/auth\_integration

<img src="/files/-M5VUbC0pXukjxeyjAz2" alt="" data-size="line">**`https://api.intserv.se/v1/appflows/auth_integration`**

Endpoint used by an App to authorize or reject a pending integration request.

> Authentication Type: App API Key


# /accesskeys/add

<img src="/files/-M5VUbC0pXukjxeyjAz2" alt="" data-size="line"> **`https://api.intserv.se/v1/accesskeys/add`**

Adds a new or updates an existing access key.

> Authentication Type: Integration API Key

### :envelope\_with\_arrow: Request Body Parameters

| Field             | Type                 | Description                                                                                                                                                                                                                                                                                                                       |
| ----------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`              | string(uuid)         | Identifier of the access key, if the intention is to update an existing one. Must be omitted if a new access key should be created.                                                                                                                                                                                               |
| `key`             | AccessKey            | Access key specification. Must be specified if a new access key should be created. For updates the access key specification is used to identify the access key, but only if the `id` field has been omitted. For more information about how access key are specified, read the [Access Keys](/api-overview/access-keys) overview. |
| `pin`             | string(4)            | *(optional)* 4-digit PIN.                                                                                                                                                                                                                                                                                                         |
| `valid_from_date` | string               | *(optional)* Time when the access key becomes valid. If omitted, the access key becomes valid right away.                                                                                                                                                                                                                         |
| `valid_to_date`   | string               | *(optional)* Time when the access key expires. If omitted, the access key will never expire.                                                                                                                                                                                                                                      |
| `access_levels`   | array\[string(uuid)] | *(optional)* A list of one or more access level identifiers that represent the access levels that should be assigned to the access key. Access levels can be fetched from the [/accesslevels/get\_levels](/api-endpoints/accesslevels-list) endpoint.                                                                             |
| `person`          | Person               | *(optional)* Specifies details about the person a new access key should be assigned to. If omitted, an person will be automatically created. This field is not used when updating an existing access key.                                                                                                                         |

### Responses

#### :white\_check\_mark: 200 OK Response Body Parameters

{% tabs %}
{% tab title="Sample Response" %}

```
{
    "id": "d698c2a4-9aae-470d-bc85-727a70cf8838",
    "key": 
    {
        "identification": "0001234567890",
        "type": "proximity",
    },
    "valid_from_date": "2020-09-01T00:00:00Z",
    "valid_to_date": "2020-10-01T14:00:00Z",
    "access_levels": 
    [
        "ce8e881e-1392-4f53-b7c2-35eeb3ecaf3b"
    ],
    "person": 
    {
        "id": "14f47083-3b38-4c80-bbcf-9404bd4c08c7",
        "first_name": "xk561bv",
        "last_name:" "s2mp6z"
    }
}
```

{% endtab %}

{% tab title="Model Schema" %}

```
AddAccessKeyResponse {
    id (string(uuid)),
    key (AccessKey),
    valid_from_date (string),
    valid_to_date (string),
    access_levels (array[string(uuid)]),
    person (Person)
}
```

{% endtab %}
{% endtabs %}

### Models

#### AccessKey Model

| Field            | Type   | Description                                                                                         |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------- |
| `identification` | string | Identification number. Read the [Access Keys](/api-overview/access-keys) overview for more details. |
| `type`           | string | Type of access key. Can be either `proximity` or `code`.                                            |

#### Person Model

| Field        | Type         | Description                                                                                                                            |
| ------------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| `id`         | string(uuid) | Identifier of an existing person to assign the access key to.                                                                          |
| `first_name` | string(32)   | *(optional)* The persons first name. If not specified, a name will be automatically generated. Only used when a new person is created. |
| `last_name`  | string(32)   | *(optional)* The persons last name. If not specified, a name will be automatically generated. Only used when a new person is created.  |

### Examples

Sample payload to create a new access key assigned to a new person:

```
{
    "key": 
    {
        "identification": "0x00499602d2",
        "type": "proximity"
    },
    "pin": "1234",
    "valid_from_date": "2020-09-01T00:00:00Z",
    "valid_to_date": "2020-10-01T14:00:00Z",
    "access_levels":
    [
        "ce8e881e-1392-4f53-b7c2-35eeb3ecaf3b"
    ],
    "person": 
    {
        "first_name": "firstname",
        "last_name": "lastname"
    }
}
```

Sample payload to update an existing access key by id:

```
{
    "id": "ae40a59c-8d52-4f2f-bb01-efa30325882c",
    "pin": null,
    "valid_from_date": "2020-11-01T00:00:00Z",
    "valid_to_date": "2020-12-01T14:00:00Z",
    "access_levels":
    [
        "a5129f41-ed44-4f3b-95a2-bec53dd3e1e3"
    ]
}
```


# /accesskeys/remove

<img src="/files/-M5VUbC0pXukjxeyjAz2" alt="" data-size="line"> **`https://api.intserv.se/v1/accesskeys/remove`**

Removes an access key.

> Authentication Type: Integration API Key

### :envelope\_with\_arrow: Request Body Parameters

| Field | Type         | Description                                                             |
| ----- | ------------ | ----------------------------------------------------------------------- |
| `id`  | string(uuid) | Identifier of the access key to remove.                                 |
| `key` | AccessKey    | Access key specification. Only used if the `id` field is not specified. |

### Responses

#### :white\_check\_mark: 204 No Content&#x20;

Indicates that the access key has been removed. No payload is included in the response.

### Models

#### AccessKey Model

| Field            | Type   | Description                                                                                         |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------- |
| `identification` | string | Identification number. Read the [Access Keys](/api-overview/access-keys) overview for more details. |
| `type`           | string | Type of access key. Can be either `proximity` or `code`.                                            |

### Examples

Remove an access key by id:

```
{
    "id": "8d5e391e-a8c1-4af4-b80a-3fb671235083"
}
```

Remove an access key by specification:

```
{
    "key":
    {
        "identification": "0x00499602d2",
        "type": "proximity"
    }
}
```


# /accesskeys/status

<img src="/files/-M5VUbC0pXukjxeyjAz2" alt="" data-size="line"> **`https://api.intserv.se/v1/accesskeys/status`**

Retrieves the current status of the latest change made on a given access key. This can be useful if tracking the propagation of a key to the affected access control systems is needed, after it has been created or updated. &#x20;

> Authentication Type: Integration API Key

### :envelope\_with\_arrow: Request Body Parameters

| Field | Type         | Description                                     |
| ----- | ------------ | ----------------------------------------------- |
| `id`  | string(uuid) | Identifier of the access key to get status for. |

### Responses

#### :white\_check\_mark: 200 OK Response Body Parameters

{% tabs %}
{% tab title="Sample Response" %}

```
{
    "id": "e18574c0-0fde-475c-951f-265f0c2232ea",
    "status": "Applied",
    "systems_where_applied": 
    [
        {
            "system_id": "abc123-001",
            "applied_at": "2020-09-01T14:00:12Z"
        }
    ],
    "systems_where_pending":
    [
        {
            "system_id": "tqok23-001"
        }
    ],
    "systems_where_failed":
    [
        {
            "system_id": "hy64qw-002",
            "error_type": "CodeNotEnabled"
        }
    ]
}
```

{% endtab %}

{% tab title="Model Schema" %}

```
StatusResponse {
    id (string(uuid)),
    status (string),
    systems_where_applied (array[AppliedSystem]),
    systems_where_pending (array[PendingSystem]),
    systems_where_failed (array[FailedSystem])
}

AppliedSystem {
    system_id (string),
    applied_at (string)
}

PendingSystem {
    system_id (string)
}

FailedSystem {
    system_id (string),
    error_type (string)
}
```

{% endtab %}
{% endtabs %}

#### StatusResponse Model

| Field                   | Type                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                    | string(uuid)          | Identifier of the access key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `status`                | string                | <p>Overall status. Can be one of the following values:</p><p></p><ul><li><code>NotApplied</code> The access key is <em>not</em> applied to any systems (as supposed to). This status typically indicates that the access key does not have any access levels assigned.</li><li><code>Applied</code> The access key has been applied to <em>all</em> applicable systems.</li><li><code>Pending</code> Application of the latest changes is pending and has not yet been applied to <em>any</em> of the applicable systems.</li><li><code>PartiallyApplied</code> Application of the latest changes has been applied to some of the applicable systems, but is still pending for one or more systems.</li><li><code>Failed</code> Application of the access key has failed to one or more systems, due to an error.</li></ul> |
| `systems_where_applied` | array\[AppliedSystem] | List of all systems where the access key has been applied, with related information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `systems_where_pending` | array\[PendingSystem] | List of all systems where the latest change on the access key is still pending.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `systems_where_failed`  | array\[FailedSystem]  | List of all systems where the latest change could not be applied due to an error, with related information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

#### AppliedSystem Model

| Field        | Type   | Description                                |
| ------------ | ------ | ------------------------------------------ |
| `system_id`  | string | Access control system identifier.          |
| `applied_at` | string | Point in time when the change was applied. |

#### PendingSystem Model

| Field       | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| `system_id` | string | Access control system identifier. |

#### FailedSystem Model

| Field        | Type   | Description                                                                                                                                                       |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `system_id`  | string | Access control system identifier.                                                                                                                                 |
| `error_type` | string | Indicates the reason of the failure. See the [error types](/api-endpoints/accesskeys-status#access-key-error-types) section for a description of possible errors. |

#### :x: 400 Bad Request

### Access Key Error Types

Most of the errors types listed below indicates that a mismatch between IntServ Access and the access control system has occured. This can happen for example if configuration changes has been done manually in the access control system that hasn't yet been synchronized, and an access key has been updated between this gap.

| Error Type            | Description                                                                                                                                                                                                           |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AccessKeyInUse`      | The access key is already in use. This can occur if there is a user in the access control system (that has been managed outside IntServ Access) that owns additional access keys which conflicts with the access key. |
| `AccessLevelNotFound` | One or more access levels assigned to the access key does not exist in the system.                                                                                                                                    |
| `CodeNotEnabled`      | Usage of codes is not enabled in the access control system, and could therefore not accept the access key.                                                                                                            |
| `InvalidCodeSize`     | The code size does not match the size configured in the access control system.                                                                                                                                        |

####


# /accesslevels/list

<img src="/files/-M5VUbC0pXukjxeyjAz2" alt="" data-size="line">**`https://api.intserv.se/v1/accesslevels/list`**

Retrieves all access levels as configured in each access control system that the integrator has access to.

> Authentication Type: Integration API Key

### :envelope\_with\_arrow: Request Body Parameters

There is no parameters for this request.

### Responses

#### :white\_check\_mark:200 OK Response Body Parameters

{% tabs %}
{% tab title="Sample Response" %}

```
{
    "levels": 
    [ 
        { 
            "id": "d344c359-9fd9-48ed-bb02-7426a831dfac",
            "name": "access-level-name", 
            "system_id": "abc123-001" 
        },
        { 
            "id": "e287a335-d082-4313-85ea-32f4291134ce",
            "name": "another level", 
            "system_id": "abc123-001" 
        }
    ]
}
```

{% endtab %}

{% tab title="Model Schema" %}

```
AccessLevelResponse {
    levels (array[AccessLevel])
}

AccessLevel {
    id (string),
    name (string),
    system_id (string)
}
```

{% endtab %}
{% endtabs %}

#### AccessLevelResponse Model

| Field    | Type                | Description             |
| -------- | ------------------- | ----------------------- |
| `levels` | array\[AccessLevel] | Array of access levels. |

#### AccessLevel Model

| Field       | Type   | Description                                                          |
| ----------- | ------ | -------------------------------------------------------------------- |
| `id`        | string | The id of the access level.                                          |
| `name`      | string | The name of the access level.                                        |
| `system_id` | string | Identifier of the access control system the access level belongs to. |


# /events/list

<img src="/files/-M5VUbC0pXukjxeyjAz2" alt="" data-size="line">**`https://api.intserv.se/v1/events/list`**

Fetches event history from the access control systems the integration has permission to. Events that indicates access granted and access denied is currenly supported.

> Authentication Type: Integration API Key

### :envelope\_with\_arrow:Request Body Parameters

| Field                                 | Type                  | Description                                                                                                                   |
| ------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| <p><code>from\_date</code></p><p></p> | <p>string</p><p> </p> | <p><em>(optional)</em> Start of time range of events to receive. </p><p>Default is 7 days from now.</p>                       |
| <p><code>to\_date</code></p><p></p>   | <p>string</p><p> </p> | <p><em>(optional)</em> End of time range of events to receive.</p><p>Default is now.</p>                                      |
| `systems`                             | string\[]             | *(optional)* An identifier for each access control system to filter on. If omitted, events from all systems will be included. |
| `include_access_granted`              | boolean               | *(optional)* `true` if events in the access granted category should be included, otherwise `false`.                           |
| `include_access_denied`               | boolean               | *(optional)* `true` if events in the access denied category should be included, otherwise `false`.                            |
| <p><code>limit</code></p><p></p>      | <p>int</p><p> </p>    | <p><em>(optional)</em> The maximum number of events to return.</p><p>Default and max allowed is 1000 events.</p>              |
| `continuation_key`                    | string                | *(optional)* Token returned in a previous response that can be used to return the next set of events.                         |

If both `include_access_granted` and `include_access_denied` fields is omitted or is set to `false` in the request, this will be eqvivalent to not filtering on a event category at all.&#x20;

### Responses

#### :white\_check\_mark:200 OK Response Body Parameters

{% tabs %}
{% tab title="Sample Response" %}

```
{
    "least_sync_time": "2020-03-01T00:00:00Z",
    "has_more": false,
    "continuation_key": null,
    "events": 
    [
        {
            "event_time": "2020-03-01T00:00:00Z",
            "sequence_id": 12345,
            "category": "accessgranted",
            "type": 101,
            "system_id": "abc123-001",
            "door_name": "entrance",
            "key_id": "47c73793-ac07-4180-b660-438ca589c0b6",
            "key": 
            {
                "identification": "0001234567890",
                "type": "proximity"
            },
            "person":
            {
                "id": "81bd075c-f97b-4576-96f5-9821c7d80e98",
                "first_name": "first name",
                "last_name": "last_name"
            },
            "subject": null
        }
    ]
}
```

{% endtab %}

{% tab title="Model Schema" %}

```
EventResponse {
    least_sync_time (string),
    has_more (boolean),
    continuation_key (string),
    events (array[Event])
}

Event {
    event_time (string),
    sequence_id (int),
    category (string),
    type (int),
    system_id (string),
    door_name (string),
    key_id (string(uuid)),
    key (AccessKey),
    person (Person),
    subject (Subject)
}

AccessKey {
    identification (string),
    type (string)
}

Person {
    id (string(uuid)),
    first_name (string),
    last_name (string)
}

Subject {
    name (string)
}
```

{% endtab %}
{% endtabs %}

#### Event Response Model

| Field                                                | Type                         | Description                                                                                                                                                                                |
| ---------------------------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><code>least\_sync\_time</code></p><p></p><p> </p> | <p>string</p><p></p><p> </p> | Indicates until which point in time it is guaranteed that events has been synchronized for the access control systems in scope for the request.                                            |
| `has_more`                                           | boolean                      | Is `true` if there is more events that has not been returned yet, otherwise false. If true the continuation\_key value can be used in subsequent requests to fetch the next set of events. |
| `continuation_key`                                   | string                       | Token that can be used to fetch the next set of events (if any). `null` if there is no more events to fetch.                                                                               |
| `events`                                             | array\[Event]                | Array of the requested events.                                                                                                                                                             |

#### Event Model

| Field                                                 | Type                            | Description                                                                                                                                                                                                                 |
| ----------------------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `event_time`                                          | string                          | The time of the event.                                                                                                                                                                                                      |
| <p><code>sequence\_id</code></p><p></p><p></p><p></p> | <p>int</p><p></p><p></p><p></p> | A sequence number that can be used to determine the order of the events originating from the same access control system. Guaranteed to be unique only in the scope of the same access control system and event\_time value. |
| `category`                                            | string                          | The category of events this event belongs to.                                                                                                                                                                               |
| `type`                                                | int                             | The type of event. See [event types](/api-overview/event-types) for more information.                                                                                                                                       |
| `system_id`                                           | string                          | Identifier of the access control system the event originates from.                                                                                                                                                          |
| `door_name`                                           | string                          | Name of the door.                                                                                                                                                                                                           |
| `key_id`                                              | string(uuid)                    | Identifier of the access key or `null`. A null value typically indicates that the access key has not been created or imported into IntServ Access, or the event is not associated to an access key.                         |
| `key`                                                 | AccessKey                       | The access key used or `null`if the event is not associated to an access key.                                                                                                                                               |
| `person`                                              | Person                          | The person associated to the event, or `null`.                                                                                                                                                                              |
| `subject`                                             | Subject                         | The subject (if the subject is not a person) associated to the event, or `null`.                                                                                                                                            |

#### AccessKey Model

| Field            | Type   | Description                                                                                |
| ---------------- | ------ | ------------------------------------------------------------------------------------------ |
| `identification` | string | The raw identification number (csn or code) of the access key.                             |
| `type`           | string | The type of access key. See [access keys](/api-overview/access-keys) for more information. |

#### Person Model

| Field        | Type         | Description                                                   |
| ------------ | ------------ | ------------------------------------------------------------- |
| `id`         | string(uuid) | Identifier of an existing person to assign the access key to. |
| `first_name` | string       | The first name of the person.                                 |
| `last_name`  | string       | The last name of the person.                                  |

#### Subject Model

| Field  | Type   | Description              |
| ------ | ------ | ------------------------ |
| `name` | string | The name of the subject. |


# Change Log

The IntServ Access platform if constantly evolved and improved to ensure a feature-rich and high quality integration platform. Here is a summary of the changes that has been made:

**2020-12-31**

Export of event history has been extended with a number of new event types including access denied events. Filtering options for the [/event/list](/api-endpoints/events-list) endpoint has been added, making it possible to filter by access control systems and event type category.

**2020-10-10**

Endpoint [/accesskeys/status](/api-endpoints/accesskeys-status) is now available, allowing integrators to track the status of a newly added or updated access key.

**2020-10-04**

Endpoint [/events/list](/api-endpoints/events-list) is now available. This endpoint allows integrators to fetch event history.

**2020-09-23**

Introduced [/accesskeys/add](/api-endpoints/accesskeys-add) and [/accesskeys/remove](/api-endpoints/accesskeys-remove) endpoints that let integrators manage accesskeys.

#### 2020-04-28

Introduced [/accesslevels/list](/api-endpoints/accesslevels-list) endpoint that let integrators to fetch access levels applicable for the integration.


