---
title: Notehub JS Library Installation and Usage
description: Installation instructions, usage, and documentation for the Blues Notehub JS npm library.
source_url: https://dev.blues.io/tools-and-sdks/notehub-sdks/notehub-js-library/
canonical_url: https://dev.blues.io/tools-and-sdks/notehub-sdks/notehub-js-library/
markdown_url: https://dev.blues.io/tools-and-sdks/notehub-sdks/notehub-js-library.md
---

# Notehub JS Library Overview

The [Notehub JS library](https://www.npmjs.com/package/@blues-inc/notehub-js) is an npm package built for JavaScript applications. It provides a quick, JavaScript-friendly way to connect to the [Notehub API](https://dev.blues.io/api-reference/notehub-api.md), and perform Notehub API requests with a clean, intuitive interface.

## Installation

You can install the [Notehub JS library](https://www.npmjs.com/package/@blues-inc/notehub-js) in any JavaScript application using the steps below.

Start by installing the `@blues-inc/notehub-js` package in your project using your package manager of choice. The example below uses npm:

```bash
npm install @blues-inc/notehub-js
```

Once the package is installed, you can import the library using either `import` or `require`:

Using `import`:

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
```

> **Note:**
>
> Using `import` in a TypeScript project will currently cause an error because type definitions are not yet included. To resolve this, create a `.d.ts` file in your project (for example, `types/notehub-js.d.ts`) with the following declaration:
>
> ```js
> declare module "@blues-inc/notehub-js";
> ```

Using `require`:

```javascript
const NotehubJs = require("@blues-inc/notehub-js");
```

## Usage

### Authentication

The Notehub JS library authenticates using a [Personal Access Token (PAT)](https://dev.blues.io/api-reference/notehub-api.md#authentication-with-personal-access-tokens). Set your token once on the shared `ApiClient` instance before making any API calls:

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";

const defaultClient = NotehubJs.ApiClient.instance;
const auth = defaultClient.authentications["personalAccessToken"];
auth.accessToken = "YOUR_ACCESS_TOKEN";
```

### Finding Your Project UID

Most API methods require a [ProjectUID](https://dev.blues.io/api-reference/glossary.md#projectuid) — a unique identifier for your Notehub project in the format `app:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. You can find it on your project's **Settings** page in [Notehub](https://notehub.io).

### Example: Fetching Events

Here's a complete example that retrieves the most recent events from a project:

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";

const defaultClient = NotehubJs.ApiClient.instance;
const auth = defaultClient.authentications["personalAccessToken"];
auth.accessToken = "YOUR_ACCESS_TOKEN";

const projectUID = "app:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
const eventApi = new NotehubJs.EventApi();

eventApi.getEvents(projectUID, { pageSize: 10 }).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

// If you're using TypeScript you may need to add types to avoid
// compilation errors
// eventApi.getEvents(projectUID, { pageSize: 10 }).then(
//   (data: unknown) => console.log(data),
//   (error: unknown) => console.error(error)
// );
```

The library also supports `async/await`:

```javascript
try {
  const data = await eventApi.getEvents(projectUID, { pageSize: 10 });
  console.log(data);
} catch (error) {
  console.error(error);
}
```

### Usage Limits

The Notehub API has usage limits. Exceeding the request threshold may result in `429` responses. See [Notehub API Usage Limits](https://dev.blues.io/api-reference/notehub-api.md#usage-limits) for details.

## API Reference

| API                                         | Description                                                        |
| ------------------------------------------- | ------------------------------------------------------------------ |
| [Billing Account API](#billing-account-api) | Retrieve billing accounts accessible by your token                 |
| [Device API](#device-api)                   | Manage devices, environment variables, and Notefiles               |
| [Event API](#event-api)                     | Query project and fleet events, with cursor and filter support     |
| [Jobs API](#jobs-api)                       | Manage and run Notehub batch jobs                                  |
| [Monitor API](#monitor-api)                 | Create and manage monitors that trigger alerts on event data       |
| [Project API](#project-api)                 | Manage projects, fleets, firmware, environment variables, and more |
| [Route API](#route-api)                     | Create and manage routes for forwarding event data                 |
| [Usage API](#usage-api)                     | Query data, event, route log, and session usage by time range      |

### Billing Account API

All URIs are relative to *<https://api.notefile.net>*

| Method                                                                  | HTTP request                                                     | Description |
| ----------------------------------------------------------------------- | ---------------------------------------------------------------- | ----------- |
| [**getBillingAccount**](#getbillingaccount)                             | **GET** /v1/billing-accounts/{billingAccountUID}                 |             |
| [**getBillingAccountBalanceHistory**](#getbillingaccountbalancehistory) | **GET** /v1/billing-accounts/{billingAccountUID}/balance-history |             |
| [**getBillingAccounts**](#getbillingaccounts)                           | **GET** /v1/billing-accounts                                     |             |

#### getBillingAccount

`GetBillingAccount200Response getBillingAccount(billingAccountUID)`

Get Billing Account Information

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.BillingAccountApi();
let billingAccountUID = "00000000-0000-0000-000000000001"; // String |
apiInstance.getBillingAccount(billingAccountUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                  | Type       | Description | Notes |
| --------------------- | ---------- | ----------- | ----- |
| **billingAccountUID** | **String** |             |       |

##### Return type

[**GetBillingAccount200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetBillingAccount200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getBillingAccountBalanceHistory

`GetBillingAccountBalanceHistory200Response getBillingAccountBalanceHistory(billingAccountUID, opts)`

Get Billing Account Balance history

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.BillingAccountApi();
let billingAccountUID = "00000000-0000-0000-000000000001"; // String |
let opts = {
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
};
apiInstance.getBillingAccountBalanceHistory(billingAccountUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                  | Type       | Description                                                     | Notes       |
| --------------------- | ---------- | --------------------------------------------------------------- | ----------- |
| **billingAccountUID** | **String** |                                                                 |             |
| **startDate**         | **Number** | Start date for filtering results, specified as a Unix timestamp | \[optional] |
| **endDate**           | **Number** | End date for filtering results, specified as a Unix timestamp   | \[optional] |

##### Return type

[**GetBillingAccountBalanceHistory200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetBillingAccountBalanceHistory200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getBillingAccounts

`GetBillingAccounts200Response getBillingAccounts()`

Get Billing Accounts accessible by the api\_key

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.BillingAccountApi();
apiInstance.getBillingAccounts().then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

This endpoint does not need any parameter.

##### Return type

[**GetBillingAccounts200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetBillingAccounts200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### Device API

All URIs are relative to *<https://api.notefile.net>*

| Method                                                                        | HTTP request                                                                                   | Description                                     |
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| [**addDbNote**](#adddbnote)                                                   | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}    |                                                 |
| [**addQiNote**](#addqinote)                                                   | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}             |                                                 |
| [**createNotefile**](#createnotefile)                                         | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}         |                                                 |
| [**deleteDevice**](#deletedevice)                                             | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}                              |                                                 |
| [**deleteDeviceEnvironmentVariable**](#deletedeviceenvironmentvariable)       | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment\_variables/{key} |                                                 |
| [**deleteNote**](#deletenote)                                                 | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}  |                                                 |
| [**deleteNotefiles**](#deletenotefiles)                                       | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files                        |                                                 |
| [**disableDevice**](#disabledevice)                                           | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable                        |                                                 |
| [**enableDevice**](#enabledevice)                                             | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable                         |                                                 |
| [**getDbNote**](#getdbnote)                                                   | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}     |                                                 |
| [**getDevice**](#getdevice)                                                   | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}                                 |                                                 |
| [**getDeviceEnvironmentHierarchy**](#getdeviceenvironmenthierarchy)           | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment\_hierarchy          | Get environment variable hierarchy for a device |
| [**getDeviceEnvironmentVariables**](#getdeviceenvironmentvariables)           | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment\_variables          |                                                 |
| [**getDeviceEnvironmentVariablesByPin**](#getdeviceenvironmentvariablesbypin) | **GET** /v1/products/{productUID}/devices/{deviceUID}/environment\_variables\_with\_pin        |                                                 |
| [**getDeviceHealthLog**](#getdevicehealthlog)                                 | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log                      |                                                 |
| [**getDeviceJourney**](#getdevicejourney)                                     | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys/{journeyID}            |                                                 |
| [**getDeviceJourneys**](#getdevicejourneys)                                   | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys                        |                                                 |
| [**getDeviceLatestEvents**](#getdevicelatestevents)                           | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest                          |                                                 |
| [**getDevicePlans**](#getdeviceplans)                                         | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans                           |                                                 |
| [**getDevicePublicKey**](#getdevicepublickey)                                 | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key                      |                                                 |
| [**getDevicePublicKeys**](#getdevicepublickeys)                               | **GET** /v1/projects/{projectOrProductUID}/devices/public-keys                                 |                                                 |
| [**getDeviceSessions**](#getdevicesessions)                                   | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions                        |                                                 |
| [**getDevices**](#getdevices)                                                 | **GET** /v1/projects/{projectOrProductUID}/devices                                             |                                                 |
| [**getFleetDevices**](#getfleetdevices)                                       | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices                           |                                                 |
| [**getNotefile**](#getnotefile)                                               | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}              |                                                 |
| [**listNotefiles**](#listnotefiles)                                           | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files                           |                                                 |
| [**provisionDevice**](#provisiondevice)                                       | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision                      |                                                 |
| [**setDeviceEnvironmentVariables**](#setdeviceenvironmentvariables)           | **PUT** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment\_variables          |                                                 |
| [**setDeviceEnvironmentVariablesByPin**](#setdeviceenvironmentvariablesbypin) | **PUT** /v1/products/{productUID}/devices/{deviceUID}/environment\_variables\_with\_pin        |                                                 |
| [**signalDevice**](#signaldevice)                                             | **POST** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal                         |                                                 |
| [**updateDbNote**](#updatedbnote)                                             | **PUT** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}     |                                                 |

#### addDbNote

`addDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)`

Add a Note to a .db notefile. if noteID is '-' then payload is ignored and empty notefile is created

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let noteInput = new NotehubJs.NoteInput(); // NoteInput | Body or payload of note to be added to the device
apiInstance
  .addDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)
  .then(
    () => {
      console.log("API called successfully.");
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type                                                                                 | Description                                       | Notes |
| ----------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------- | ----- |
| **projectOrProductUID** | **String**                                                                           |                                                   |       |
| **deviceUID**           | **String**                                                                           |                                                   |       |
| **notefileID**          | **String**                                                                           |                                                   |       |
| **noteID**              | **String**                                                                           |                                                   |       |
| **noteInput**           | [**NoteInput**](https://github.com/blues/notehub-js/blob/main/src/docs/NoteInput.md) | Body or payload of note to be added to the device |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### addQiNote

`addQiNote(projectOrProductUID, deviceUID, notefileID, noteInput)`

Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteInput = new NotehubJs.NoteInput(); // NoteInput | Body or payload of note to be added to the device
apiInstance
  .addQiNote(projectOrProductUID, deviceUID, notefileID, noteInput)
  .then(
    () => {
      console.log("API called successfully.");
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type                                                                                 | Description                                       | Notes |
| ----------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------- | ----- |
| **projectOrProductUID** | **String**                                                                           |                                                   |       |
| **deviceUID**           | **String**                                                                           |                                                   |       |
| **notefileID**          | **String**                                                                           |                                                   |       |
| **noteInput**           | [**NoteInput**](https://github.com/blues/notehub-js/blob/main/src/docs/NoteInput.md) | Body or payload of note to be added to the device |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### createNotefile

`createNotefile(projectOrProductUID, deviceUID, notefileID)`

Creates an empty Notefile on the device.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
apiInstance.createNotefile(projectOrProductUID, deviceUID, notefileID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |
| **notefileID**          | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteDevice

`deleteDevice(projectOrProductUID, deviceUID)`

Delete Device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.deleteDevice(projectOrProductUID, deviceUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteDeviceEnvironmentVariable

`EnvironmentVariables deleteDeviceEnvironmentVariable(projectOrProductUID, deviceUID, key)`

Delete environment variable of a device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance
  .deleteDeviceEnvironmentVariable(projectOrProductUID, deviceUID, key)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type       | Description                             | Notes |
| ----------------------- | ---------- | --------------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                         |       |
| **deviceUID**           | **String** |                                         |       |
| **key**                 | **String** | The environment variable key to delete. |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteNote

`deleteNote(projectOrProductUID, deviceUID, notefileID, noteID)`

Delete a note from a .db or .qi notefile

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
apiInstance.deleteNote(projectOrProductUID, deviceUID, notefileID, noteID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |
| **notefileID**          | **String** |             |       |
| **noteID**              | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteNotefiles

`deleteNotefiles(projectOrProductUID, deviceUID, deleteNotefilesRequest)`

Deletes Notefiles and the Notes they contain.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let deleteNotefilesRequest = new NotehubJs.DeleteNotefilesRequest(); // DeleteNotefilesRequest |
apiInstance
  .deleteNotefiles(projectOrProductUID, deviceUID, deleteNotefilesRequest)
  .then(
    () => {
      console.log("API called successfully.");
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                       | Type                                                                                                           | Description | Notes |
| -------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------- | ----- |
| **projectOrProductUID**    | **String**                                                                                                     |             |       |
| **deviceUID**              | **String**                                                                                                     |             |       |
| **deleteNotefilesRequest** | [**DeleteNotefilesRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/DeleteNotefilesRequest.md) |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### disableDevice

`disableDevice(projectOrProductUID, deviceUID)`

Disable Device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.disableDevice(projectOrProductUID, deviceUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### enableDevice

`enableDevice(projectOrProductUID, deviceUID)`

Enable Device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.enableDevice(projectOrProductUID, deviceUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDbNote

`GetDbNote200Response getDbNote(projectOrProductUID, deviceUID, notefileID, noteID, opts)`

Get a note from a .db or .qi notefile

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let opts = {
  _delete: true, // Boolean | Whether to delete the note from the DB notefile
  deleted: true, // Boolean | Whether to return deleted notes
};
apiInstance
  .getDbNote(projectOrProductUID, deviceUID, notefileID, noteID, opts)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type        | Description                                     | Notes       |
| ----------------------- | ----------- | ----------------------------------------------- | ----------- |
| **projectOrProductUID** | **String**  |                                                 |             |
| **deviceUID**           | **String**  |                                                 |             |
| **notefileID**          | **String**  |                                                 |             |
| **noteID**              | **String**  |                                                 |             |
| **\_delete**            | **Boolean** | Whether to delete the note from the DB notefile | \[optional] |
| **deleted**             | **Boolean** | Whether to return deleted notes                 | \[optional] |

##### Return type

[**GetDbNote200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDbNote200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDevice

`Device getDevice(projectOrProductUID, deviceUID)`

Get Device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDevice(projectOrProductUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

[**Device**](https://github.com/blues/notehub-js/blob/main/src/docs/Device.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceEnvironmentHierarchy

`EnvTreeJsonNode getDeviceEnvironmentHierarchy(projectOrProductUID, deviceUID)`

Get environment variable hierarchy for a device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceEnvironmentHierarchy(projectOrProductUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

[**EnvTreeJsonNode**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvTreeJsonNode.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceEnvironmentVariables

`GetDeviceEnvironmentVariablesByPin200Response getDeviceEnvironmentVariables(projectOrProductUID, deviceUID)`

Get environment variables of a device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceEnvironmentVariables(projectOrProductUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

[**GetDeviceEnvironmentVariablesByPin200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceEnvironmentVariablesByPin200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceEnvironmentVariablesByPin

`GetDeviceEnvironmentVariablesByPin200Response getDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken)`

Get environment variables of a device with device pin authorization

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let productUID = "com.blues.bridge:sensors"; // String |
let deviceUID = "dev:000000000000000"; // String |
let xAuthToken = "xAuthToken_example"; // String | For accessing endpoints by Device pin.
apiInstance
  .getDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name           | Type       | Description                            | Notes |
| -------------- | ---------- | -------------------------------------- | ----- |
| **productUID** | **String** |                                        |       |
| **deviceUID**  | **String** |                                        |       |
| **xAuthToken** | **String** | For accessing endpoints by Device pin. |       |

##### Return type

[**GetDeviceEnvironmentVariablesByPin200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceEnvironmentVariablesByPin200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceHealthLog

`GetDeviceHealthLog200Response getDeviceHealthLog(projectOrProductUID, deviceUID, opts)`

Get Device Health Log

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let opts = {
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  logType: ["null"], // [String] | Return only specified log types
};
apiInstance.getDeviceHealthLog(projectOrProductUID, deviceUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                     | Notes       |
| ----------------------- | ------------- | --------------------------------------------------------------- | ----------- |
| **projectOrProductUID** | **String**    |                                                                 |             |
| **deviceUID**           | **String**    |                                                                 |             |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp | \[optional] |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp   | \[optional] |
| **logType**             | **\[String]** | Return only specified log types                                 | \[optional] |

##### Return type

[**GetDeviceHealthLog200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceHealthLog200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceJourney

`GetDeviceJourney200Response getDeviceJourney(projectOrProductUID, deviceUID, journeyID, opts)`

Get a single journey for a device along with its events. The events array is paginated via \`pageSize\` / \`pageNum\`; use \`journey.has\_more\` to detect additional pages.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let journeyID = 789; // Number | Identifier of the journey, taken from the numeric `journey` field in the event body (a Unix timestamp marking the start of the journey).
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
};
apiInstance
  .getDeviceJourney(projectOrProductUID, deviceUID, journeyID, opts)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type       | Description                                                                                                                                | Notes                        |
| ----------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------- |
| **projectOrProductUID** | **String** |                                                                                                                                            |                              |
| **deviceUID**           | **String** |                                                                                                                                            |                              |
| **journeyID**           | **Number** | Identifier of the journey, taken from the numeric \`journey\` field in the event body (a Unix timestamp marking the start of the journey). |                              |
| **pageSize**            | **Number** |                                                                                                                                            | \[optional] \[default to 50] |
| **pageNum**             | **Number** |                                                                                                                                            | \[optional] \[default to 1]  |

##### Return type

[**GetDeviceJourney200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceJourney200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceJourneys

`GetDeviceJourneys200Response getDeviceJourneys(projectOrProductUID, deviceUID, opts)`

Get the list of journeys for a device, derived from events whose body contains \`journey\` and \`jcount\` fields. Returns journey metadata only (no event payloads). Capped at 100 most recent journeys; \`has\_more\` is true when the cap is hit.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let opts = {
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
};
apiInstance.getDeviceJourneys(projectOrProductUID, deviceUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                                                     | Notes       |
| ----------------------- | ---------- | --------------------------------------------------------------- | ----------- |
| **projectOrProductUID** | **String** |                                                                 |             |
| **deviceUID**           | **String** |                                                                 |             |
| **startDate**           | **Number** | Start date for filtering results, specified as a Unix timestamp | \[optional] |
| **endDate**             | **Number** | End date for filtering results, specified as a Unix timestamp   | \[optional] |

##### Return type

[**GetDeviceJourneys200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceJourneys200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceLatestEvents

`GetDeviceLatestEvents200Response getDeviceLatestEvents(projectOrProductUID, deviceUID)`

Get Device Latest Events

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceLatestEvents(projectOrProductUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

[**GetDeviceLatestEvents200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceLatestEvents200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDevicePlans

`GetDevicePlans200Response getDevicePlans(projectOrProductUID, deviceUID)`

Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDevicePlans(projectOrProductUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

[**GetDevicePlans200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDevicePlans200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDevicePublicKey

`GetDevicePublicKey200Response getDevicePublicKey(projectOrProductUID, deviceUID)`

Get Device Public Key

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDevicePublicKey(projectOrProductUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

[**GetDevicePublicKey200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDevicePublicKey200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDevicePublicKeys

`GetDevicePublicKeys200Response getDevicePublicKeys(projectOrProductUID, opts)`

Get Device Public Keys of a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
};
apiInstance.getDevicePublicKeys(projectOrProductUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes                        |
| ----------------------- | ---------- | ----------- | ---------------------------- |
| **projectOrProductUID** | **String** |             |                              |
| **pageSize**            | **Number** |             | \[optional] \[default to 50] |
| **pageNum**             | **Number** |             | \[optional] \[default to 1]  |

##### Return type

[**GetDevicePublicKeys200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDevicePublicKeys200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceSessions

`GetDeviceSessions200Response getDeviceSessions(projectOrProductUID, deviceUID, opts)`

Get Device Sessions

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  firstSync: false, // Boolean | When true, filters results to only show first sync sessions
};
apiInstance.getDeviceSessions(projectOrProductUID, deviceUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type        | Description                                                     | Notes                           |
| ----------------------- | ----------- | --------------------------------------------------------------- | ------------------------------- |
| **projectOrProductUID** | **String**  |                                                                 |                                 |
| **deviceUID**           | **String**  |                                                                 |                                 |
| **pageSize**            | **Number**  |                                                                 | \[optional] \[default to 50]    |
| **pageNum**             | **Number**  |                                                                 | \[optional] \[default to 1]     |
| **startDate**           | **Number**  | Start date for filtering results, specified as a Unix timestamp | \[optional]                     |
| **endDate**             | **Number**  | End date for filtering results, specified as a Unix timestamp   | \[optional]                     |
| **firstSync**           | **Boolean** | When true, filters results to only show first sync sessions     | \[optional] \[default to false] |

##### Return type

[**GetDeviceSessions200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceSessions200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDevices

`GetDevices200Response getDevices(projectOrProductUID, opts)`

Get Devices of a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  tag: ["null"], // [String] | Tag filter
  serialNumber: ["null"], // [String] | Serial number filter
  fleetUID: ["null"], // [String] |
  notecardFirmware: ["null"], // [String] | Firmware version filter
  location: ["null"], // [String] | Location filter
  hostFirmware: ["null"], // [String] | Host firmware filter
  productUID: ["null"], // [String] |
  sku: ["null"], // [String] | SKU filter
};
apiInstance.getDevices(projectOrProductUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description             | Notes                        |
| ----------------------- | ------------- | ----------------------- | ---------------------------- |
| **projectOrProductUID** | **String**    |                         |                              |
| **pageSize**            | **Number**    |                         | \[optional] \[default to 50] |
| **pageNum**             | **Number**    |                         | \[optional] \[default to 1]  |
| **deviceUID**           | **\[String]** | A Device UID.           | \[optional]                  |
| **tag**                 | **\[String]** | Tag filter              | \[optional]                  |
| **serialNumber**        | **\[String]** | Serial number filter    | \[optional]                  |
| **fleetUID**            | **\[String]** |                         | \[optional]                  |
| **notecardFirmware**    | **\[String]** | Firmware version filter | \[optional]                  |
| **location**            | **\[String]** | Location filter         | \[optional]                  |
| **hostFirmware**        | **\[String]** | Host firmware filter    | \[optional]                  |
| **productUID**          | **\[String]** |                         | \[optional]                  |
| **sku**                 | **\[String]** | SKU filter              | \[optional]                  |

##### Return type

[**GetDevices200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDevices200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getFleetDevices

`GetDevices200Response getFleetDevices(projectOrProductUID, fleetUID, opts)`

Get Devices of a Fleet within a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  tag: ["null"], // [String] | Tag filter
  serialNumber: ["null"], // [String] | Serial number filter
  notecardFirmware: ["null"], // [String] | Firmware version filter
  location: ["null"], // [String] | Location filter
  hostFirmware: ["null"], // [String] | Host firmware filter
  productUID: ["null"], // [String] |
  sku: ["null"], // [String] | SKU filter
};
apiInstance.getFleetDevices(projectOrProductUID, fleetUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description             | Notes                        |
| ----------------------- | ------------- | ----------------------- | ---------------------------- |
| **projectOrProductUID** | **String**    |                         |                              |
| **fleetUID**            | **String**    |                         |                              |
| **pageSize**            | **Number**    |                         | \[optional] \[default to 50] |
| **pageNum**             | **Number**    |                         | \[optional] \[default to 1]  |
| **deviceUID**           | **\[String]** | A Device UID.           | \[optional]                  |
| **tag**                 | **\[String]** | Tag filter              | \[optional]                  |
| **serialNumber**        | **\[String]** | Serial number filter    | \[optional]                  |
| **notecardFirmware**    | **\[String]** | Firmware version filter | \[optional]                  |
| **location**            | **\[String]** | Location filter         | \[optional]                  |
| **hostFirmware**        | **\[String]** | Host firmware filter    | \[optional]                  |
| **productUID**          | **\[String]** |                         | \[optional]                  |
| **sku**                 | **\[String]** | SKU filter              | \[optional]                  |

##### Return type

[**GetDevices200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDevices200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getNotefile

`GetNotefile200Response getNotefile(projectOrProductUID, deviceUID, notefileID, opts)`

For .qi files, returns the queued up notes. For .db files, returns all notes in the notefile

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let opts = {
  max: 56, // Number | The maximum number of Notes to return in the request.
  deleted: true, // Boolean | true to return deleted notes.
  _delete: true, // Boolean | true to delete the notes returned by the request.
};
apiInstance.getNotefile(projectOrProductUID, deviceUID, notefileID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type        | Description                                           | Notes       |
| ----------------------- | ----------- | ----------------------------------------------------- | ----------- |
| **projectOrProductUID** | **String**  |                                                       |             |
| **deviceUID**           | **String**  |                                                       |             |
| **notefileID**          | **String**  |                                                       |             |
| **max**                 | **Number**  | The maximum number of Notes to return in the request. | \[optional] |
| **deleted**             | **Boolean** | true to return deleted notes.                         | \[optional] |
| **\_delete**            | **Boolean** | true to delete the notes returned by the request.     | \[optional] |

##### Return type

[**GetNotefile200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetNotefile200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### listNotefiles

`[Notefile] listNotefiles(projectOrProductUID, deviceUID, opts)`

Lists .qi and .db files for the device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let opts = {
  files: ["null"], // [String] | One or more files to obtain change information from.
  pending: true, // Boolean | show only files that are pending sync to the Notecard
};
apiInstance.listNotefiles(projectOrProductUID, deviceUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                           | Notes       |
| ----------------------- | ------------- | ----------------------------------------------------- | ----------- |
| **projectOrProductUID** | **String**    |                                                       |             |
| **deviceUID**           | **String**    |                                                       |             |
| **files**               | **\[String]** | One or more files to obtain change information from.  | \[optional] |
| **pending**             | **Boolean**   | show only files that are pending sync to the Notecard | \[optional] |

##### Return type

[**\[Notefile\]**](https://github.com/blues/notehub-js/blob/main/src/docs/Notefile.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### provisionDevice

`Object provisionDevice(projectOrProductUID, deviceUID, provisionDeviceRequest)`

Provision Device for a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let provisionDeviceRequest = new NotehubJs.ProvisionDeviceRequest(); // ProvisionDeviceRequest | Provision a device to a specific ProductUID
apiInstance
  .provisionDevice(projectOrProductUID, deviceUID, provisionDeviceRequest)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                       | Type                                                                                                           | Description                                 | Notes |
| -------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | ----- |
| **projectOrProductUID**    | **String**                                                                                                     |                                             |       |
| **deviceUID**              | **String**                                                                                                     |                                             |       |
| **provisionDeviceRequest** | [**ProvisionDeviceRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/ProvisionDeviceRequest.md) | Provision a device to a specific ProductUID |       |

##### Return type

**Object**

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### setDeviceEnvironmentVariables

`EnvironmentVariables setDeviceEnvironmentVariables(projectOrProductUID, deviceUID, environmentVariables)`

Set environment variables of a device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
  .setDeviceEnvironmentVariables(
    projectOrProductUID,
    deviceUID,
    environmentVariables
  )
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                     | Type                                                                                                       | Description                                     | Notes |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ----- |
| **projectOrProductUID**  | **String**                                                                                                 |                                                 |       |
| **deviceUID**            | **String**                                                                                                 |                                                 |       |
| **environmentVariables** | [**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md) | Environment variables to be added to the device |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### setDeviceEnvironmentVariablesByPin

`EnvironmentVariables setDeviceEnvironmentVariablesByPin(productUID, deviceUID, xAuthToken, environmentVariables)`

Set environment variables of a device with device pin authorization

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let productUID = "com.blues.bridge:sensors"; // String |
let deviceUID = "dev:000000000000000"; // String |
let xAuthToken = "xAuthToken_example"; // String | For accessing endpoints by Device pin.
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the device
apiInstance
  .setDeviceEnvironmentVariablesByPin(
    productUID,
    deviceUID,
    xAuthToken,
    environmentVariables
  )
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                     | Type                                                                                                       | Description                                     | Notes |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ----- |
| **productUID**           | **String**                                                                                                 |                                                 |       |
| **deviceUID**            | **String**                                                                                                 |                                                 |       |
| **xAuthToken**           | **String**                                                                                                 | For accessing endpoints by Device pin.          |       |
| **environmentVariables** | [**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md) | Environment variables to be added to the device |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### signalDevice

`SignalDevice200Response signalDevice(projectOrProductUID, deviceUID, body)`

Send a signal from Notehub to a Notecard.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let body = new NotehubJs.Body(); // Body | Body or payload of signal to be sent to the device
apiInstance.signalDevice(projectOrProductUID, deviceUID, body).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                       | Description                                        | Notes |
| ----------------------- | -------------------------------------------------------------------------- | -------------------------------------------------- | ----- |
| **projectOrProductUID** | **String**                                                                 |                                                    |       |
| **deviceUID**           | **String**                                                                 |                                                    |       |
| **body**                | [**Body**](https://github.com/blues/notehub-js/blob/main/src/docs/Body.md) | Body or payload of signal to be sent to the device |       |

##### Return type

[**SignalDevice200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/SignalDevice200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### updateDbNote

`updateDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)`

Update a note in a .db or .qi notefile

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.DeviceApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let notefileID = "notefileID_example"; // String |
let noteID = "noteID_example"; // String |
let noteInput = new NotehubJs.NoteInput(); // NoteInput | Body or payload of note to be added to the device
apiInstance
  .updateDbNote(projectOrProductUID, deviceUID, notefileID, noteID, noteInput)
  .then(
    () => {
      console.log("API called successfully.");
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type                                                                                 | Description                                       | Notes |
| ----------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------- | ----- |
| **projectOrProductUID** | **String**                                                                           |                                                   |       |
| **deviceUID**           | **String**                                                                           |                                                   |       |
| **notefileID**          | **String**                                                                           |                                                   |       |
| **noteID**              | **String**                                                                           |                                                   |       |
| **noteInput**           | [**NoteInput**](https://github.com/blues/notehub-js/blob/main/src/docs/NoteInput.md) | Body or payload of note to be added to the device |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### Event API

All URIs are relative to *<https://api.notefile.net>*

| Method                                                | HTTP request                                                               | Description |
| ----------------------------------------------------- | -------------------------------------------------------------------------- | ----------- |
| [**getEvents**](#getevents)                           | **GET** /v1/projects/{projectOrProductUID}/events                          |             |
| [**getEventsByCursor**](#geteventsbycursor)           | **GET** /v1/projects/{projectOrProductUID}/events-cursor                   |             |
| [**getFleetEvents**](#getfleetevents)                 | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events        |             |
| [**getFleetEventsByCursor**](#getfleeteventsbycursor) | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor |             |
| [**getRouteLogsByEvent**](#getroutelogsbyevent)       | **GET** /v1/projects/{projectOrProductUID}/events/{eventUID}/route-logs    |             |

#### getEvents

`GetEvents200Response getEvents(projectOrProductUID, opts)`

Get Events of a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  sensorUID: ["null"], // [String] | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.
  sortBy: "'captured'", // String |
  sortOrder: "'asc'", // String |
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  dateType: "uploaded", // String | Which date to filter on, either 'captured' or 'uploaded'.  This will apply to the startDate and endDate parameters
  systemFilesOnly: true, // Boolean |
  files: "_health.qo, data.qo", // String |
  format: "'json'", // String | Response format (JSON or CSV)
  serialNumber: ["null"], // [String] | Filter by Serial Number
  fleetUID: ["null"], // [String] | Filter by Fleet UID
  sessionUID: ["null"], // [String] | Filter by Session UID
  eventUID: ["null"], // [String] | Filter by Event UID
  selectFields: "selectFields_example", // String | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output.
};
apiInstance.getEvents(projectOrProductUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                                                                                                                      | Notes                                |
| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| **projectOrProductUID** | **String**    |                                                                                                                                                                  |                                      |
| **pageSize**            | **Number**    |                                                                                                                                                                  | \[optional] \[default to 50]         |
| **pageNum**             | **Number**    |                                                                                                                                                                  | \[optional] \[default to 1]          |
| **deviceUID**           | **\[String]** | A Device UID.                                                                                                                                                    | \[optional]                          |
| **sensorUID**           | **\[String]** | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.                                                | \[optional]                          |
| **sortBy**              | **String**    |                                                                                                                                                                  | \[optional] \[default to 'captured'] |
| **sortOrder**           | **String**    |                                                                                                                                                                  | \[optional] \[default to 'asc']      |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp                                                                                                  | \[optional]                          |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp                                                                                                    | \[optional]                          |
| **dateType**            | **String**    | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters                                                | \[optional] \[default to 'captured'] |
| **systemFilesOnly**     | **Boolean**   |                                                                                                                                                                  | \[optional]                          |
| **files**               | **String**    |                                                                                                                                                                  | \[optional]                          |
| **format**              | **String**    | Response format (JSON or CSV)                                                                                                                                    | \[optional] \[default to 'json']     |
| **serialNumber**        | **\[String]** | Filter by Serial Number                                                                                                                                          | \[optional]                          |
| **fleetUID**            | **\[String]** | Filter by Fleet UID                                                                                                                                              | \[optional]                          |
| **sessionUID**          | **\[String]** | Filter by Session UID                                                                                                                                            | \[optional]                          |
| **eventUID**            | **\[String]** | Filter by Event UID                                                                                                                                              | \[optional]                          |
| **selectFields**        | **String**    | Comma-separated list of fields to select from JSON payload (e.g., \&quot;field1,field2.subfield,field3\&quot;), this will reflect the columns in the CSV output. | \[optional]                          |

##### Return type

[**GetEvents200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetEvents200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json, text/csv

#### getEventsByCursor

`GetEventsByCursor200Response getEventsByCursor(projectOrProductUID, opts)`

Get Events of a Project by cursor

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  limit: 50, // Number |
  cursor: "cursor_example", // String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.
  sortOrder: "'asc'", // String |
  systemFilesOnly: true, // Boolean |
  files: "_health.qo, data.qo", // String |
  fleetUID: "fleetUID_example", // String |
  deviceUID: ["null"], // [String] | A Device UID.
  sensorUID: ["null"], // [String] | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.
};
apiInstance.getEventsByCursor(projectOrProductUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                                                                                                                                                                                                                                                                                                                         | Notes                           |
| ----------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| **projectOrProductUID** | **String**    |                                                                                                                                                                                                                                                                                                                                                                     |                                 |
| **limit**               | **Number**    |                                                                                                                                                                                                                                                                                                                                                                     | \[optional] \[default to 50]    |
| **cursor**              | **String**    | A cursor, which can be obtained from the \`next\_cursor\` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. | \[optional]                     |
| **sortOrder**           | **String**    |                                                                                                                                                                                                                                                                                                                                                                     | \[optional] \[default to 'asc'] |
| **systemFilesOnly**     | **Boolean**   |                                                                                                                                                                                                                                                                                                                                                                     | \[optional]                     |
| **files**               | **String**    |                                                                                                                                                                                                                                                                                                                                                                     | \[optional]                     |
| **fleetUID**            | **String**    |                                                                                                                                                                                                                                                                                                                                                                     | \[optional]                     |
| **deviceUID**           | **\[String]** | A Device UID.                                                                                                                                                                                                                                                                                                                                                       | \[optional]                     |
| **sensorUID**           | **\[String]** | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.                                                                                                                                                                                                                                                   | \[optional]                     |

##### Return type

[**GetEventsByCursor200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetEventsByCursor200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getFleetEvents

`GetEvents200Response getFleetEvents(projectOrProductUID, fleetUID, opts)`

Get Events of a Fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  sensorUID: ["null"], // [String] | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.
  sortBy: "'captured'", // String |
  sortOrder: "'asc'", // String |
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  dateType: "uploaded", // String | Which date to filter on, either 'captured' or 'uploaded'.  This will apply to the startDate and endDate parameters
  systemFilesOnly: true, // Boolean |
  files: "_health.qo, data.qo", // String |
  format: "'json'", // String | Response format (JSON or CSV)
  serialNumber: ["null"], // [String] | Filter by Serial Number
  sessionUID: ["null"], // [String] | Filter by Session UID
  eventUID: ["null"], // [String] | Filter by Event UID
  selectFields: "selectFields_example", // String | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output.
};
apiInstance.getFleetEvents(projectOrProductUID, fleetUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                                                                                                                      | Notes                                |
| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| **projectOrProductUID** | **String**    |                                                                                                                                                                  |                                      |
| **fleetUID**            | **String**    |                                                                                                                                                                  |                                      |
| **pageSize**            | **Number**    |                                                                                                                                                                  | \[optional] \[default to 50]         |
| **pageNum**             | **Number**    |                                                                                                                                                                  | \[optional] \[default to 1]          |
| **deviceUID**           | **\[String]** | A Device UID.                                                                                                                                                    | \[optional]                          |
| **sensorUID**           | **\[String]** | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.                                                | \[optional]                          |
| **sortBy**              | **String**    |                                                                                                                                                                  | \[optional] \[default to 'captured'] |
| **sortOrder**           | **String**    |                                                                                                                                                                  | \[optional] \[default to 'asc']      |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp                                                                                                  | \[optional]                          |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp                                                                                                    | \[optional]                          |
| **dateType**            | **String**    | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters                                                | \[optional] \[default to 'captured'] |
| **systemFilesOnly**     | **Boolean**   |                                                                                                                                                                  | \[optional]                          |
| **files**               | **String**    |                                                                                                                                                                  | \[optional]                          |
| **format**              | **String**    | Response format (JSON or CSV)                                                                                                                                    | \[optional] \[default to 'json']     |
| **serialNumber**        | **\[String]** | Filter by Serial Number                                                                                                                                          | \[optional]                          |
| **sessionUID**          | **\[String]** | Filter by Session UID                                                                                                                                            | \[optional]                          |
| **eventUID**            | **\[String]** | Filter by Event UID                                                                                                                                              | \[optional]                          |
| **selectFields**        | **String**    | Comma-separated list of fields to select from JSON payload (e.g., \&quot;field1,field2.subfield,field3\&quot;), this will reflect the columns in the CSV output. | \[optional]                          |

##### Return type

[**GetEvents200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetEvents200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json, text/csv

#### getFleetEventsByCursor

`GetEventsByCursor200Response getFleetEventsByCursor(projectOrProductUID, fleetUID, opts)`

Get Events of a Fleet by cursor

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let opts = {
  limit: 50, // Number |
  cursor: "cursor_example", // String | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included.
  sortOrder: "'asc'", // String |
  systemFilesOnly: true, // Boolean |
  files: "_health.qo, data.qo", // String |
  deviceUID: ["null"], // [String] | A Device UID.
  sensorUID: ["null"], // [String] | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
};
apiInstance.getFleetEventsByCursor(projectOrProductUID, fleetUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                                                                                                                                                                                                                                                                                                                         | Notes                           |
| ----------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| **projectOrProductUID** | **String**    |                                                                                                                                                                                                                                                                                                                                                                     |                                 |
| **fleetUID**            | **String**    |                                                                                                                                                                                                                                                                                                                                                                     |                                 |
| **limit**               | **Number**    |                                                                                                                                                                                                                                                                                                                                                                     | \[optional] \[default to 50]    |
| **cursor**              | **String**    | A cursor, which can be obtained from the \`next\_cursor\` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. | \[optional]                     |
| **sortOrder**           | **String**    |                                                                                                                                                                                                                                                                                                                                                                     | \[optional] \[default to 'asc'] |
| **systemFilesOnly**     | **Boolean**   |                                                                                                                                                                                                                                                                                                                                                                     | \[optional]                     |
| **files**               | **String**    |                                                                                                                                                                                                                                                                                                                                                                     | \[optional]                     |
| **deviceUID**           | **\[String]** | A Device UID.                                                                                                                                                                                                                                                                                                                                                       | \[optional]                     |
| **sensorUID**           | **\[String]** | A sensor UID to filter events by, matched exactly against the event sensor field. The value may carry any prefix.                                                                                                                                                                                                                                                   | \[optional]                     |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp                                                                                                                                                                                                                                                                                                     | \[optional]                     |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp                                                                                                                                                                                                                                                                                                       | \[optional]                     |

##### Return type

[**GetEventsByCursor200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetEventsByCursor200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getRouteLogsByEvent

`[RouteLog] getRouteLogsByEvent(projectOrProductUID, eventUID)`

Get Route Logs by Event UID

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.EventApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let eventUID = "4506f411-dea6-44a0-9743-1130f57d7747"; // String |
apiInstance.getRouteLogsByEvent(projectOrProductUID, eventUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **eventUID**            | **String** |             |       |

##### Return type

[**\[RouteLog\]**](https://github.com/blues/notehub-js/blob/main/src/docs/RouteLog.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### Jobs API

All URIs are relative to *<https://api.notefile.net>*

| Method                            | HTTP request                                                             | Description |
| --------------------------------- | ------------------------------------------------------------------------ | ----------- |
| [**cancelJobRun**](#canceljobrun) | **POST** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel |             |
| [**createJob**](#createjob)       | **POST** /v1/projects/{projectOrProductUID}/jobs                         |             |
| [**deleteJob**](#deletejob)       | **DELETE** /v1/projects/{projectOrProductUID}/jobs/{jobUID}              |             |
| [**deleteJobRun**](#deletejobrun) | **DELETE** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}      |             |
| [**getJob**](#getjob)             | **GET** /v1/projects/{projectOrProductUID}/jobs/{jobUID}                 |             |
| [**getJobRun**](#getjobrun)       | **GET** /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}         |             |
| [**getJobRuns**](#getjobruns)     | **GET** /v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs            |             |
| [**getJobs**](#getjobs)           | **GET** /v1/projects/{projectOrProductUID}/jobs                          |             |
| [**runJob**](#runjob)             | **POST** /v1/projects/{projectOrProductUID}/jobs/{jobUID}/run            |             |

#### cancelJobRun

`CancelJobRun200Response cancelJobRun(projectOrProductUID, reportUID)`

Cancel a running job execution

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let reportUID = "my-reconciliation-job-1707654321000"; // String | Unique identifier for a job run report
apiInstance.cancelJobRun(projectOrProductUID, reportUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                            | Notes |
| ----------------------- | ---------- | -------------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                        |       |
| **reportUID**           | **String** | Unique identifier for a job run report |       |

##### Return type

[**CancelJobRun200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/CancelJobRun200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### createJob

`CreateJob201Response createJob(projectOrProductUID, name, jobDefinition)`

Create a new batch job with an optional name

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let name = "name_example"; // String | Name for the job
let jobDefinition = new NotehubJs.JobDefinition(); // JobDefinition | The batch job definition
apiInstance.createJob(projectOrProductUID, name, jobDefinition).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                                         | Description              | Notes |
| ----------------------- | -------------------------------------------------------------------------------------------- | ------------------------ | ----- |
| **projectOrProductUID** | **String**                                                                                   |                          |       |
| **name**                | **String**                                                                                   | Name for the job         |       |
| **jobDefinition**       | [**JobDefinition**](https://github.com/blues/notehub-js/blob/main/src/docs/JobDefinition.md) | The batch job definition |       |

##### Return type

[**CreateJob201Response**](https://github.com/blues/notehub-js/blob/main/src/docs/CreateJob201Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### deleteJob

`DeleteJob200Response deleteJob(projectOrProductUID, jobUID)`

Delete a batch job

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
apiInstance.deleteJob(projectOrProductUID, jobUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                       | Notes |
| ----------------------- | ---------- | --------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                   |       |
| **jobUID**              | **String** | Unique identifier for a batch job |       |

##### Return type

[**DeleteJob200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/DeleteJob200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteJobRun

`deleteJobRun(projectOrProductUID, reportUID)`

Delete the results of a job run

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let reportUID = "my-reconciliation-job-1707654321000"; // String | Unique identifier for a job run report
apiInstance.deleteJobRun(projectOrProductUID, reportUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                            | Notes |
| ----------------------- | ---------- | -------------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                        |       |
| **reportUID**           | **String** | Unique identifier for a job run report |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getJob

`JobDetail getJob(projectOrProductUID, jobUID)`

Get a specific batch job definition

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
apiInstance.getJob(projectOrProductUID, jobUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                       | Notes |
| ----------------------- | ---------- | --------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                   |       |
| **jobUID**              | **String** | Unique identifier for a batch job |       |

##### Return type

[**JobDetail**](https://github.com/blues/notehub-js/blob/main/src/docs/JobDetail.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getJobRun

`JobRun getJobRun(projectOrProductUID, reportUID, opts)`

Get the result of a job execution

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let reportUID = "my-reconciliation-job-1707654321000"; // String | Unique identifier for a job run report
let opts = {
  view: "'summary'", // String | Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload
};
apiInstance.getJobRun(projectOrProductUID, reportUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                                                                                                      | Notes                               |
| ----------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| **projectOrProductUID** | **String** |                                                                                                                  |                                     |
| **reportUID**           | **String** | Unique identifier for a job run report                                                                           |                                     |
| **view**                | **String** | Controls the level of detail returned: 'summary' returns metadata only, 'detail' returns the full result payload | \[optional] \[default to 'summary'] |

##### Return type

[**JobRun**](https://github.com/blues/notehub-js/blob/main/src/docs/JobRun.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getJobRuns

`GetJobRuns200Response getJobRuns(projectOrProductUID, jobUID, opts)`

List all runs for a specific job

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
let opts = {
  status: "status_example", // String | Filter runs by status
  dryRun: true, // Boolean | Filter runs by dry run flag
};
apiInstance.getJobRuns(projectOrProductUID, jobUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type        | Description                       | Notes       |
| ----------------------- | ----------- | --------------------------------- | ----------- |
| **projectOrProductUID** | **String**  |                                   |             |
| **jobUID**              | **String**  | Unique identifier for a batch job |             |
| **status**              | **String**  | Filter runs by status             | \[optional] |
| **dryRun**              | **Boolean** | Filter runs by dry run flag       | \[optional] |

##### Return type

[**GetJobRuns200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetJobRuns200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getJobs

`GetJobs200Response getJobs(projectOrProductUID)`

List all batch jobs for a project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getJobs(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**GetJobs200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetJobs200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### runJob

`RunJob200Response runJob(projectOrProductUID, jobUID, opts)`

Execute a batch job

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.JobsApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let jobUID = "my-reconciliation-job"; // String | Unique identifier for a batch job
let opts = {
  dryRun: false, // Boolean | Run job in dry-run mode without making actual changes
};
apiInstance.runJob(projectOrProductUID, jobUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type        | Description                                           | Notes                           |
| ----------------------- | ----------- | ----------------------------------------------------- | ------------------------------- |
| **projectOrProductUID** | **String**  |                                                       |                                 |
| **jobUID**              | **String**  | Unique identifier for a batch job                     |                                 |
| **dryRun**              | **Boolean** | Run job in dry-run mode without making actual changes | \[optional] \[default to false] |

##### Return type

[**RunJob200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/RunJob200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### Monitor API

All URIs are relative to *<https://api.notefile.net>*

| Method                              | HTTP request                                                        | Description |
| ----------------------------------- | ------------------------------------------------------------------- | ----------- |
| [**createMonitor**](#createmonitor) | **POST** /v1/projects/{projectOrProductUID}/monitors                |             |
| [**deleteMonitor**](#deletemonitor) | **DELETE** /v1/projects/{projectOrProductUID}/monitors/{monitorUID} |             |
| [**getMonitor**](#getmonitor)       | **GET** /v1/projects/{projectOrProductUID}/monitors/{monitorUID}    |             |
| [**getMonitors**](#getmonitors)     | **GET** /v1/projects/{projectOrProductUID}/monitors                 |             |
| [**updateMonitor**](#updatemonitor) | **PUT** /v1/projects/{projectOrProductUID}/monitors/{monitorUID}    |             |

#### createMonitor

`Monitor createMonitor(projectOrProductUID, createMonitor)`

Create a new Monitor

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createMonitor = new NotehubJs.CreateMonitor(); // CreateMonitor | Body or payload of monitor to be created
apiInstance.createMonitor(projectOrProductUID, createMonitor).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                                         | Description                              | Notes |
| ----------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------- | ----- |
| **projectOrProductUID** | **String**                                                                                   |                                          |       |
| **createMonitor**       | [**CreateMonitor**](https://github.com/blues/notehub-js/blob/main/src/docs/CreateMonitor.md) | Body or payload of monitor to be created |       |

##### Return type

[**Monitor**](https://github.com/blues/notehub-js/blob/main/src/docs/Monitor.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### deleteMonitor

`Monitor deleteMonitor(projectOrProductUID, monitorUID)`

Delete Monitor

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let monitorUID = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad"; // String |
apiInstance.deleteMonitor(projectOrProductUID, monitorUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **monitorUID**          | **String** |             |       |

##### Return type

[**Monitor**](https://github.com/blues/notehub-js/blob/main/src/docs/Monitor.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getMonitor

`Monitor getMonitor(projectOrProductUID, monitorUID)`

Get Monitor

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let monitorUID = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad"; // String |
apiInstance.getMonitor(projectOrProductUID, monitorUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **monitorUID**          | **String** |             |       |

##### Return type

[**Monitor**](https://github.com/blues/notehub-js/blob/main/src/docs/Monitor.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getMonitors

`[Monitor] getMonitors(projectOrProductUID)`

Get list of defined Monitors

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getMonitors(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**\[Monitor\]**](https://github.com/blues/notehub-js/blob/main/src/docs/Monitor.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### updateMonitor

`Monitor updateMonitor(projectOrProductUID, monitorUID, monitor)`

Update Monitor

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.MonitorApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let monitorUID = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad"; // String |
let monitor = new NotehubJs.Monitor(); // Monitor | Body or payload of monitor to be created
apiInstance.updateMonitor(projectOrProductUID, monitorUID, monitor).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                             | Description                              | Notes |
| ----------------------- | -------------------------------------------------------------------------------- | ---------------------------------------- | ----- |
| **projectOrProductUID** | **String**                                                                       |                                          |       |
| **monitorUID**          | **String**                                                                       |                                          |       |
| **monitor**             | [**Monitor**](https://github.com/blues/notehub-js/blob/main/src/docs/Monitor.md) | Body or payload of monitor to be created |       |

##### Return type

[**Monitor**](https://github.com/blues/notehub-js/blob/main/src/docs/Monitor.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### Project API

All URIs are relative to *<https://api.notefile.net>*

| Method                                                                    | HTTP request                                                                                 | Description                                              |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [**addDeviceToFleets**](#adddevicetofleets)                               | **PUT** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets                        |                                                          |
| [**cloneProject**](#cloneproject)                                         | **POST** /v1/projects/{projectOrProductUID}/clone                                            |                                                          |
| [**createFleet**](#createfleet)                                           | **POST** /v1/projects/{projectOrProductUID}/fleets                                           |                                                          |
| [**createProduct**](#createproduct)                                       | **POST** /v1/projects/{projectOrProductUID}/products                                         |                                                          |
| [**createProject**](#createproject)                                       | **POST** /v1/projects                                                                        |                                                          |
| [**createProjectSecret**](#createprojectsecret)                           | **POST** /v1/projects/{projectOrProductUID}/secrets                                          |                                                          |
| [**deleteDeviceFromFleets**](#deletedevicefromfleets)                     | **DELETE** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets                     |                                                          |
| [**deleteFirmware**](#deletefirmware)                                     | **DELETE** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}             |                                                          |
| [**deleteFleet**](#deletefleet)                                           | **DELETE** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}                              |                                                          |
| [**deleteFleetEnvironmentVariable**](#deletefleetenvironmentvariable)     | **DELETE** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment\_variables/{key} |                                                          |
| [**deleteProduct**](#deleteproduct)                                       | **DELETE** /v1/projects/{projectOrProductUID}/products/{productUID}                          |                                                          |
| [**deleteProject**](#deleteproject)                                       | **DELETE** /v1/projects/{projectOrProductUID}                                                |                                                          |
| [**deleteProjectEnvironmentVariable**](#deleteprojectenvironmentvariable) | **DELETE** /v1/projects/{projectOrProductUID}/environment\_variables/{key}                   |                                                          |
| [**deleteProjectSecret**](#deleteprojectsecret)                           | **DELETE** /v1/projects/{projectOrProductUID}/secrets/{secretName}                           |                                                          |
| [**disableGlobalEventTransformation**](#disableglobaleventtransformation) | **POST** /v1/projects/{projectOrProductUID}/global-transformation/disable                    |                                                          |
| [**downloadFirmware**](#downloadfirmware)                                 | **GET** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}                |                                                          |
| [**enableGlobalEventTransformation**](#enableglobaleventtransformation)   | **POST** /v1/projects/{projectOrProductUID}/global-transformation/enable                     |                                                          |
| [**getAWSRoleConfig**](#getawsroleconfig)                                 | **GET** /v1/projects/{projectOrProductUID}/aws-role-config                                   | Get AWS role configuration for role-based authentication |
| [**getDeviceDfuHistory**](#getdevicedfuhistory)                           | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history    |                                                          |
| [**getDeviceDfuStatus**](#getdevicedfustatus)                             | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status     |                                                          |
| [**getDeviceFleets**](#getdevicefleets)                                   | **GET** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets                        |                                                          |
| [**getDevicesDfuHistory**](#getdevicesdfuhistory)                         | **GET** /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/history                        |                                                          |
| [**getDevicesDfuStatus**](#getdevicesdfustatus)                           | **GET** /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status                         |                                                          |
| [**getFirmwareInfo**](#getfirmwareinfo)                                   | **GET** /v1/projects/{projectOrProductUID}/firmware                                          |                                                          |
| [**getFleet**](#getfleet)                                                 | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}                                 |                                                          |
| [**getFleetEnvironmentHierarchy**](#getfleetenvironmenthierarchy)         | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment\_hierarchy          | Get environment variable hierarchy for a device          |
| [**getFleetEnvironmentVariables**](#getfleetenvironmentvariables)         | **GET** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment\_variables          |                                                          |
| [**getFleets**](#getfleets)                                               | **GET** /v1/projects/{projectOrProductUID}/fleets                                            |                                                          |
| [**getNotefileSchemas**](#getnotefileschemas)                             | **GET** /v1/projects/{projectOrProductUID}/schemas                                           | Get variable format for a notefile                       |
| [**getProducts**](#getproducts)                                           | **GET** /v1/projects/{projectOrProductUID}/products                                          |                                                          |
| [**getProject**](#getproject)                                             | **GET** /v1/projects/{projectOrProductUID}                                                   |                                                          |
| [**getProjectByProduct**](#getprojectbyproduct)                           | **GET** /v1/products/{productUID}/project                                                    |                                                          |
| [**getProjectEnvironmentHierarchy**](#getprojectenvironmenthierarchy)     | **GET** /v1/projects/{projectOrProductUID}/environment\_hierarchy                            | Get environment variable hierarchy for a device          |
| [**getProjectEnvironmentVariables**](#getprojectenvironmentvariables)     | **GET** /v1/projects/{projectOrProductUID}/environment\_variables                            |                                                          |
| [**getProjectMembers**](#getprojectmembers)                               | **GET** /v1/projects/{projectOrProductUID}/members                                           |                                                          |
| [**getProjectSecrets**](#getprojectsecrets)                               | **GET** /v1/projects/{projectOrProductUID}/secrets                                           |                                                          |
| [**getProjects**](#getprojects)                                           | **GET** /v1/projects                                                                         |                                                          |
| [**performDfuAction**](#performdfuaction)                                 | **POST** /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action}                      |                                                          |
| [**setFleetEnvironmentVariables**](#setfleetenvironmentvariables)         | **PUT** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment\_variables          |                                                          |
| [**setGlobalEventTransformation**](#setglobaleventtransformation)         | **POST** /v1/projects/{projectOrProductUID}/global-transformation                            |                                                          |
| [**setProjectEnvironmentVariables**](#setprojectenvironmentvariables)     | **PUT** /v1/projects/{projectOrProductUID}/environment\_variables                            |                                                          |
| [**updateFirmware**](#updatefirmware)                                     | **POST** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}               |                                                          |
| [**updateFleet**](#updatefleet)                                           | **PUT** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}                                 |                                                          |
| [**updateProjectSecret**](#updateprojectsecret)                           | **PUT** /v1/projects/{projectOrProductUID}/secrets/{secretName}                              |                                                          |
| [**uploadFirmware**](#uploadfirmware)                                     | **PUT** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}                |                                                          |

#### addDeviceToFleets

`GetDeviceFleets200Response addDeviceToFleets(projectOrProductUID, deviceUID, addDeviceToFleetsRequest)`

Add Device to Fleets

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let addDeviceToFleetsRequest = new NotehubJs.AddDeviceToFleetsRequest(); // AddDeviceToFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance
  .addDeviceToFleets(projectOrProductUID, deviceUID, addDeviceToFleetsRequest)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                         | Type                                                                                                               | Description                                                                                                                                                                                                                                                                                      | Notes |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
| **projectOrProductUID**      | **String**                                                                                                         |                                                                                                                                                                                                                                                                                                  |       |
| **deviceUID**                | **String**                                                                                                         |                                                                                                                                                                                                                                                                                                  |       |
| **addDeviceToFleetsRequest** | [**AddDeviceToFleetsRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/AddDeviceToFleetsRequest.md) | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |       |

##### Return type

[**GetDeviceFleets200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceFleets200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### cloneProject

`Project cloneProject(projectOrProductUID, cloneProjectRequest)`

Clone a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let cloneProjectRequest = new NotehubJs.CloneProjectRequest(); // CloneProjectRequest | Project to be cloned
apiInstance.cloneProject(projectOrProductUID, cloneProjectRequest).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                                                     | Description          | Notes |
| ----------------------- | -------------------------------------------------------------------------------------------------------- | -------------------- | ----- |
| **projectOrProductUID** | **String**                                                                                               |                      |       |
| **cloneProjectRequest** | [**CloneProjectRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/CloneProjectRequest.md) | Project to be cloned |       |

##### Return type

[**Project**](https://github.com/blues/notehub-js/blob/main/src/docs/Project.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### createFleet

`Fleet createFleet(projectOrProductUID, createFleetRequest)`

Create Fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createFleetRequest = new NotehubJs.CreateFleetRequest(); // CreateFleetRequest | Fleet to be added
apiInstance.createFleet(projectOrProductUID, createFleetRequest).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                                                   | Description       | Notes |
| ----------------------- | ------------------------------------------------------------------------------------------------------ | ----------------- | ----- |
| **projectOrProductUID** | **String**                                                                                             |                   |       |
| **createFleetRequest**  | [**CreateFleetRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/CreateFleetRequest.md) | Fleet to be added |       |

##### Return type

[**Fleet**](https://github.com/blues/notehub-js/blob/main/src/docs/Fleet.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### createProduct

`Product createProduct(projectOrProductUID, createProductRequest)`

Create Product within a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createProductRequest = new NotehubJs.CreateProductRequest(); // CreateProductRequest | Product to be created
apiInstance.createProduct(projectOrProductUID, createProductRequest).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                     | Type                                                                                                       | Description           | Notes |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | --------------------- | ----- |
| **projectOrProductUID**  | **String**                                                                                                 |                       |       |
| **createProductRequest** | [**CreateProductRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/CreateProductRequest.md) | Product to be created |       |

##### Return type

[**Product**](https://github.com/blues/notehub-js/blob/main/src/docs/Product.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### createProject

`Project createProject(createProjectRequest)`

Create a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let createProjectRequest = new NotehubJs.CreateProjectRequest(); // CreateProjectRequest | Project to be created
apiInstance.createProject(createProjectRequest).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                     | Type                                                                                                       | Description           | Notes |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | --------------------- | ----- |
| **createProjectRequest** | [**CreateProjectRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/CreateProjectRequest.md) | Project to be created |       |

##### Return type

[**Project**](https://github.com/blues/notehub-js/blob/main/src/docs/Project.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### createProjectSecret

`ProjectSecret createProjectSecret(projectOrProductUID, createProjectSecretRequest)`

Create a new project secret

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let createProjectSecretRequest = new NotehubJs.CreateProjectSecretRequest(); // CreateProjectSecretRequest |
apiInstance
  .createProjectSecret(projectOrProductUID, createProjectSecretRequest)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                           | Type                                                                                                                   | Description | Notes |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | ----------- | ----- |
| **projectOrProductUID**        | **String**                                                                                                             |             |       |
| **createProjectSecretRequest** | [**CreateProjectSecretRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/CreateProjectSecretRequest.md) |             |       |

##### Return type

[**ProjectSecret**](https://github.com/blues/notehub-js/blob/main/src/docs/ProjectSecret.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### deleteDeviceFromFleets

`GetDeviceFleets200Response deleteDeviceFromFleets(projectOrProductUID, deviceUID, deleteDeviceFromFleetsRequest)`

Remove Device from Fleets

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let deleteDeviceFromFleetsRequest =
  new NotehubJs.DeleteDeviceFromFleetsRequest(); // DeleteDeviceFromFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
apiInstance
  .deleteDeviceFromFleets(
    projectOrProductUID,
    deviceUID,
    deleteDeviceFromFleetsRequest
  )
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                              | Type                                                                                                                         | Description                                                                                                                                                                                                                                                                                           | Notes |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **projectOrProductUID**           | **String**                                                                                                                   |                                                                                                                                                                                                                                                                                                       |       |
| **deviceUID**                     | **String**                                                                                                                   |                                                                                                                                                                                                                                                                                                       |       |
| **deleteDeviceFromFleetsRequest** | [**DeleteDeviceFromFleetsRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/DeleteDeviceFromFleetsRequest.md) | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |       |

##### Return type

[**GetDeviceFleets200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceFleets200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### deleteFirmware

`deleteFirmware(projectOrProductUID, firmwareType, filename)`

Delete a host firmware binary. The filename must be the full stored filename including the timestamp suffix (e.g. test$20260324190911.bin) as returned by the firmware upload or list endpoints.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let filename = "filename_example"; // String |
apiInstance.deleteFirmware(projectOrProductUID, firmwareType, filename).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **firmwareType**        | **String** |             |       |
| **filename**            | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteFleet

`deleteFleet(projectOrProductUID, fleetUID)`

Delete Fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.deleteFleet(projectOrProductUID, fleetUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **fleetUID**            | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteFleetEnvironmentVariable

`EnvironmentVariables deleteFleetEnvironmentVariable(projectOrProductUID, fleetUID, key)`

Delete environment variables of a fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance
  .deleteFleetEnvironmentVariable(projectOrProductUID, fleetUID, key)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type       | Description                             | Notes |
| ----------------------- | ---------- | --------------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                         |       |
| **fleetUID**            | **String** |                                         |       |
| **key**                 | **String** | The environment variable key to delete. |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteProduct

`deleteProduct(projectOrProductUID, productUID)`

Delete a product

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let productUID = "com.blues.bridge:sensors"; // String |
apiInstance.deleteProduct(projectOrProductUID, productUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **productUID**          | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteProject

`deleteProject(projectOrProductUID)`

Delete a Project by ProjectUID

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.deleteProject(projectOrProductUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteProjectEnvironmentVariable

`EnvironmentVariables deleteProjectEnvironmentVariable(projectOrProductUID, key)`

Delete an environment variable of a project by key

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let key = "key_example"; // String | The environment variable key to delete.
apiInstance.deleteProjectEnvironmentVariable(projectOrProductUID, key).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                             | Notes |
| ----------------------- | ---------- | --------------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                         |       |
| **key**                 | **String** | The environment variable key to delete. |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### deleteProjectSecret

`deleteProjectSecret(projectOrProductUID, secretName)`

Delete a project secret by name

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let secretName = "secretName_example"; // String | The name of the secret.
apiInstance.deleteProjectSecret(projectOrProductUID, secretName).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description             | Notes |
| ----------------------- | ---------- | ----------------------- | ----- |
| **projectOrProductUID** | **String** |                         |       |
| **secretName**          | **String** | The name of the secret. |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### disableGlobalEventTransformation

`disableGlobalEventTransformation(projectOrProductUID)`

Disable the project-level event JSONata transformation

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.disableGlobalEventTransformation(projectOrProductUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### downloadFirmware

`File downloadFirmware(projectOrProductUID, firmwareType, filename)`

Download firmware binary

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let filename = "filename_example"; // String |
apiInstance.downloadFirmware(projectOrProductUID, firmwareType, filename).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **firmwareType**        | **String** |             |       |
| **filename**            | **String** |             |       |

##### Return type

**File**

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/octet-stream, application/json

#### enableGlobalEventTransformation

`enableGlobalEventTransformation(projectOrProductUID)`

Enable the project-level event JSONata transformation

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.enableGlobalEventTransformation(projectOrProductUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getAWSRoleConfig

`AWSRoleConfig getAWSRoleConfig(projectOrProductUID)`

Get AWS role configuration for role-based authentication

Returns the AWS Account ID and External ID needed to configure an IAM role trust policy for role-based authentication on AWS routes.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getAWSRoleConfig(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**AWSRoleConfig**](https://github.com/blues/notehub-js/blob/main/src/docs/AWSRoleConfig.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceDfuHistory

`DeviceDfuHistory getDeviceDfuHistory(projectOrProductUID, deviceUID, firmwareType)`

Get device DFU history for host or Notecard firmware

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let firmwareType = "firmwareType_example"; // String |
apiInstance
  .getDeviceDfuHistory(projectOrProductUID, deviceUID, firmwareType)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |
| **firmwareType**        | **String** |             |       |

##### Return type

[**DeviceDfuHistory**](https://github.com/blues/notehub-js/blob/main/src/docs/DeviceDfuHistory.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceDfuStatus

`DeviceDfuStatus getDeviceDfuStatus(projectOrProductUID, deviceUID, firmwareType)`

Get device DFU history for host or Notecard firmware

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
let firmwareType = "firmwareType_example"; // String |
apiInstance
  .getDeviceDfuStatus(projectOrProductUID, deviceUID, firmwareType)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |
| **firmwareType**        | **String** |             |       |

##### Return type

[**DeviceDfuStatus**](https://github.com/blues/notehub-js/blob/main/src/docs/DeviceDfuStatus.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDeviceFleets

`GetDeviceFleets200Response getDeviceFleets(projectOrProductUID, deviceUID)`

Get Device Fleets

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let deviceUID = "dev:000000000000000"; // String |
apiInstance.getDeviceFleets(projectOrProductUID, deviceUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **deviceUID**           | **String** |             |       |

##### Return type

[**GetDeviceFleets200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceFleets200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDevicesDfuHistory

`DeviceDfuHistoryPage getDevicesDfuHistory(projectOrProductUID, firmwareType, opts)`

Get host or Notecard DFU history for all devices that match the filter criteria

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  sortBy: "'captured'", // String |
  sortOrder: "'asc'", // String |
  deviceUID: ["null"], // [String] | A Device UID.
  tag: ["null"], // [String] | Tag filter
  serialNumber: ["null"], // [String] | Serial number filter
  fleetUID: "fleetUID_example", // String |
  notecardFirmware: ["null"], // [String] | Firmware version filter
  location: ["null"], // [String] | Location filter
  hostFirmware: ["null"], // [String] | Host firmware filter
  productUID: ["null"], // [String] |
  sku: ["null"], // [String] | SKU filter
};
apiInstance.getDevicesDfuHistory(projectOrProductUID, firmwareType, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description             | Notes                                |
| ----------------------- | ------------- | ----------------------- | ------------------------------------ |
| **projectOrProductUID** | **String**    |                         |                                      |
| **firmwareType**        | **String**    |                         |                                      |
| **pageSize**            | **Number**    |                         | \[optional] \[default to 50]         |
| **pageNum**             | **Number**    |                         | \[optional] \[default to 1]          |
| **sortBy**              | **String**    |                         | \[optional] \[default to 'captured'] |
| **sortOrder**           | **String**    |                         | \[optional] \[default to 'asc']      |
| **deviceUID**           | **\[String]** | A Device UID.           | \[optional]                          |
| **tag**                 | **\[String]** | Tag filter              | \[optional]                          |
| **serialNumber**        | **\[String]** | Serial number filter    | \[optional]                          |
| **fleetUID**            | **String**    |                         | \[optional]                          |
| **notecardFirmware**    | **\[String]** | Firmware version filter | \[optional]                          |
| **location**            | **\[String]** | Location filter         | \[optional]                          |
| **hostFirmware**        | **\[String]** | Host firmware filter    | \[optional]                          |
| **productUID**          | **\[String]** |                         | \[optional]                          |
| **sku**                 | **\[String]** | SKU filter              | \[optional]                          |

##### Return type

[**DeviceDfuHistoryPage**](https://github.com/blues/notehub-js/blob/main/src/docs/DeviceDfuHistoryPage.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getDevicesDfuStatus

`DeviceDfuStatusPage getDevicesDfuStatus(projectOrProductUID, firmwareType, opts)`

Get host or Notecard DFU history for all devices that match the filter criteria

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  sortBy: "'captured'", // String |
  sortOrder: "'asc'", // String |
  deviceUID: ["null"], // [String] | A Device UID.
  tag: ["null"], // [String] | Tag filter
  serialNumber: ["null"], // [String] | Serial number filter
  fleetUID: "fleetUID_example", // String |
  notecardFirmware: ["null"], // [String] | Firmware version filter
  location: ["null"], // [String] | Location filter
  hostFirmware: ["null"], // [String] | Host firmware filter
  productUID: ["null"], // [String] |
  sku: ["null"], // [String] | SKU filter
};
apiInstance.getDevicesDfuStatus(projectOrProductUID, firmwareType, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description             | Notes                                |
| ----------------------- | ------------- | ----------------------- | ------------------------------------ |
| **projectOrProductUID** | **String**    |                         |                                      |
| **firmwareType**        | **String**    |                         |                                      |
| **pageSize**            | **Number**    |                         | \[optional] \[default to 50]         |
| **pageNum**             | **Number**    |                         | \[optional] \[default to 1]          |
| **sortBy**              | **String**    |                         | \[optional] \[default to 'captured'] |
| **sortOrder**           | **String**    |                         | \[optional] \[default to 'asc']      |
| **deviceUID**           | **\[String]** | A Device UID.           | \[optional]                          |
| **tag**                 | **\[String]** | Tag filter              | \[optional]                          |
| **serialNumber**        | **\[String]** | Serial number filter    | \[optional]                          |
| **fleetUID**            | **String**    |                         | \[optional]                          |
| **notecardFirmware**    | **\[String]** | Firmware version filter | \[optional]                          |
| **location**            | **\[String]** | Location filter         | \[optional]                          |
| **hostFirmware**        | **\[String]** | Host firmware filter    | \[optional]                          |
| **productUID**          | **\[String]** |                         | \[optional]                          |
| **sku**                 | **\[String]** | SKU filter              | \[optional]                          |

##### Return type

[**DeviceDfuStatusPage**](https://github.com/blues/notehub-js/blob/main/src/docs/DeviceDfuStatusPage.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getFirmwareInfo

`[FirmwareInfo] getFirmwareInfo(projectOrProductUID, opts)`

Get Available Firmware Information

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  product: "product_example", // String |
  firmwareType: "firmwareType_example", // String |
  version: "version_example", // String |
  target: "target_example", // String |
  filename: "notecard-7.2.2.16518$20240410043100.bin", // String |
  md5: "md5_example", // String |
  unpublished: true, // Boolean |
  sortBy: "'created'", // String | Field to sort by
  sortOrder: "'desc'", // String | Sort order (asc for ascending, desc for descending)
};
apiInstance.getFirmwareInfo(projectOrProductUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type        | Description                                         | Notes                               |
| ----------------------- | ----------- | --------------------------------------------------- | ----------------------------------- |
| **projectOrProductUID** | **String**  |                                                     |                                     |
| **product**             | **String**  |                                                     | \[optional]                         |
| **firmwareType**        | **String**  |                                                     | \[optional]                         |
| **version**             | **String**  |                                                     | \[optional]                         |
| **target**              | **String**  |                                                     | \[optional]                         |
| **filename**            | **String**  |                                                     | \[optional]                         |
| **md5**                 | **String**  |                                                     | \[optional]                         |
| **unpublished**         | **Boolean** |                                                     | \[optional]                         |
| **sortBy**              | **String**  | Field to sort by                                    | \[optional] \[default to 'created'] |
| **sortOrder**           | **String**  | Sort order (asc for ascending, desc for descending) | \[optional] \[default to 'desc']    |

##### Return type

[**\[FirmwareInfo\]**](https://github.com/blues/notehub-js/blob/main/src/docs/FirmwareInfo.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getFleet

`Fleet getFleet(projectOrProductUID, fleetUID)`

Get Fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleet(projectOrProductUID, fleetUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **fleetUID**            | **String** |             |       |

##### Return type

[**Fleet**](https://github.com/blues/notehub-js/blob/main/src/docs/Fleet.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getFleetEnvironmentHierarchy

`EnvTreeJsonNode getFleetEnvironmentHierarchy(projectOrProductUID, fleetUID)`

Get environment variable hierarchy for a device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleetEnvironmentHierarchy(projectOrProductUID, fleetUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **fleetUID**            | **String** |             |       |

##### Return type

[**EnvTreeJsonNode**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvTreeJsonNode.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getFleetEnvironmentVariables

`EnvironmentVariables getFleetEnvironmentVariables(projectOrProductUID, fleetUID)`

Get environment variables of a fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
apiInstance.getFleetEnvironmentVariables(projectOrProductUID, fleetUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **fleetUID**            | **String** |             |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getFleets

`GetDeviceFleets200Response getFleets(projectOrProductUID)`

Get Project Fleets

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getFleets(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**GetDeviceFleets200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDeviceFleets200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getNotefileSchemas

`[NotefileSchema] getNotefileSchemas(projectOrProductUID)`

Get variable format for a notefile

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getNotefileSchemas(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**\[NotefileSchema\]**](https://github.com/blues/notehub-js/blob/main/src/docs/NotefileSchema.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProducts

`GetProducts200Response getProducts(projectOrProductUID)`

Get Products within a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProducts(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**GetProducts200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetProducts200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProject

`Project getProject(projectOrProductUID)`

Get a Project by ProjectUID

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProject(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**Project**](https://github.com/blues/notehub-js/blob/main/src/docs/Project.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProjectByProduct

`Project getProjectByProduct(productUID)`

Get a Project by ProductUID

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let productUID = com.blues.airnote; // String |
apiInstance.getProjectByProduct(productUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name           | Type       | Description | Notes |
| -------------- | ---------- | ----------- | ----- |
| **productUID** | **String** |             |       |

##### Return type

[**Project**](https://github.com/blues/notehub-js/blob/main/src/docs/Project.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProjectEnvironmentHierarchy

`EnvTreeJsonNode getProjectEnvironmentHierarchy(projectOrProductUID)`

Get environment variable hierarchy for a device

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectEnvironmentHierarchy(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**EnvTreeJsonNode**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvTreeJsonNode.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProjectEnvironmentVariables

`EnvironmentVariables getProjectEnvironmentVariables(projectOrProductUID)`

Get environment variables of a project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectEnvironmentVariables(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProjectMembers

`GetProjectMembers200Response getProjectMembers(projectOrProductUID)`

Get Project Members

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectMembers(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**GetProjectMembers200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetProjectMembers200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProjectSecrets

`GetProjectSecretsResponse getProjectSecrets(projectOrProductUID)`

Get all secrets for a project (metadata only, values are never returned)

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getProjectSecrets(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**GetProjectSecretsResponse**](https://github.com/blues/notehub-js/blob/main/src/docs/GetProjectSecretsResponse.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getProjects

`GetProjects200Response getProjects()`

Get Projects accessible by the api\_key

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
apiInstance.getProjects().then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

This endpoint does not need any parameter.

##### Return type

[**GetProjects200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetProjects200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### performDfuAction

`performDfuAction(projectOrProductUID, firmwareType, action, opts)`

Update/cancel host or notecard firmware updates

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let action = "action_example"; // String |
let opts = {
  deviceUID: ["null"], // [String] | A Device UID.
  tag: ["null"], // [String] | Tag filter
  serialNumber: ["null"], // [String] | Serial number filter
  fleetUID: "fleetUID_example", // String |
  notecardFirmware: ["null"], // [String] | Firmware version filter
  location: ["null"], // [String] | Location filter
  hostFirmware: ["null"], // [String] | Host firmware filter
  productUID: ["null"], // [String] |
  sku: ["null"], // [String] | SKU filter
  dfuActionRequest: new NotehubJs.DfuActionRequest(), // DfuActionRequest | Which firmware in the case of an update action
};
apiInstance
  .performDfuAction(projectOrProductUID, firmwareType, action, opts)
  .then(
    () => {
      console.log("API called successfully.");
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type                                                                                               | Description                                    | Notes       |
| ----------------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------- |
| **projectOrProductUID** | **String**                                                                                         |                                                |             |
| **firmwareType**        | **String**                                                                                         |                                                |             |
| **action**              | **String**                                                                                         |                                                |             |
| **deviceUID**           | **\[String]**                                                                                      | A Device UID.                                  | \[optional] |
| **tag**                 | **\[String]**                                                                                      | Tag filter                                     | \[optional] |
| **serialNumber**        | **\[String]**                                                                                      | Serial number filter                           | \[optional] |
| **fleetUID**            | **String**                                                                                         |                                                | \[optional] |
| **notecardFirmware**    | **\[String]**                                                                                      | Firmware version filter                        | \[optional] |
| **location**            | **\[String]**                                                                                      | Location filter                                | \[optional] |
| **hostFirmware**        | **\[String]**                                                                                      | Host firmware filter                           | \[optional] |
| **productUID**          | **\[String]**                                                                                      |                                                | \[optional] |
| **sku**                 | **\[String]**                                                                                      | SKU filter                                     | \[optional] |
| **dfuActionRequest**    | [**DfuActionRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/DfuActionRequest.md) | Which firmware in the case of an update action | \[optional] |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### setFleetEnvironmentVariables

`EnvironmentVariables setFleetEnvironmentVariables(projectOrProductUID, fleetUID, environmentVariables)`

Set environment variables of a fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let environmentVariables = new NotehubJs.EnvironmentVariables(); // EnvironmentVariables | Environment variables to be added to the fleet
apiInstance
  .setFleetEnvironmentVariables(
    projectOrProductUID,
    fleetUID,
    environmentVariables
  )
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                     | Type                                                                                                       | Description                                    | Notes |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ----- |
| **projectOrProductUID**  | **String**                                                                                                 |                                                |       |
| **fleetUID**             | **String**                                                                                                 |                                                |       |
| **environmentVariables** | [**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md) | Environment variables to be added to the fleet |       |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### setGlobalEventTransformation

`setGlobalEventTransformation(projectOrProductUID, body)`

Set the project-level event JSONata transformation

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let body = "body_example"; // String | JSONata expression which will be applied to each event before it is persisted and routed
apiInstance.setGlobalEventTransformation(projectOrProductUID, body).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description                                                                              | Notes |
| ----------------------- | ---------- | ---------------------------------------------------------------------------------------- | ----- |
| **projectOrProductUID** | **String** |                                                                                          |       |
| **body**                | **String** | JSONata expression which will be applied to each event before it is persisted and routed |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: text/plain
- **Accept**: application/json

#### setProjectEnvironmentVariables

`EnvironmentVariables setProjectEnvironmentVariables(projectOrProductUID, opts)`

Set environment variables of a project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let opts = {
  environmentVariables: new NotehubJs.EnvironmentVariables(), // EnvironmentVariables |
};
apiInstance.setProjectEnvironmentVariables(projectOrProductUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                     | Type                                                                                                       | Description | Notes       |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | ----------- | ----------- |
| **projectOrProductUID**  | **String**                                                                                                 |             |             |
| **environmentVariables** | [**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md) |             | \[optional] |

##### Return type

[**EnvironmentVariables**](https://github.com/blues/notehub-js/blob/main/src/docs/EnvironmentVariables.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### updateFirmware

`FirmwareInfo updateFirmware(projectOrProductUID, firmwareType, filename, updateHostFirmwareRequest)`

Update the metadata of an existing host firmware entry. The filename must be the full stored filename including the timestamp suffix (e.g. test$20260324190911.bin) as returned by the firmware upload or list endpoints.

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let filename = "filename_example"; // String |
let updateHostFirmwareRequest = new NotehubJs.UpdateHostFirmwareRequest(); // UpdateHostFirmwareRequest | Firmware metadata fields to update. All fields are optional; only provided fields will be updated.
apiInstance
  .updateFirmware(
    projectOrProductUID,
    firmwareType,
    filename,
    updateHostFirmwareRequest
  )
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                          | Type                                                                                                                 | Description                                                                                        | Notes |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----- |
| **projectOrProductUID**       | **String**                                                                                                           |                                                                                                    |       |
| **firmwareType**              | **String**                                                                                                           |                                                                                                    |       |
| **filename**                  | **String**                                                                                                           |                                                                                                    |       |
| **updateHostFirmwareRequest** | [**UpdateHostFirmwareRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/UpdateHostFirmwareRequest.md) | Firmware metadata fields to update. All fields are optional; only provided fields will be updated. |       |

##### Return type

[**FirmwareInfo**](https://github.com/blues/notehub-js/blob/main/src/docs/FirmwareInfo.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### updateFleet

`Fleet updateFleet(projectOrProductUID, fleetUID, updateFleetRequest)`

Update Fleet

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let fleetUID = "fleetUID_example"; // String |
let updateFleetRequest = new NotehubJs.UpdateFleetRequest(); // UpdateFleetRequest | Fleet details to update
apiInstance.updateFleet(projectOrProductUID, fleetUID, updateFleetRequest).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                                                   | Description             | Notes |
| ----------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------- | ----- |
| **projectOrProductUID** | **String**                                                                                             |                         |       |
| **fleetUID**            | **String**                                                                                             |                         |       |
| **updateFleetRequest**  | [**UpdateFleetRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/UpdateFleetRequest.md) | Fleet details to update |       |

##### Return type

[**Fleet**](https://github.com/blues/notehub-js/blob/main/src/docs/Fleet.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### updateProjectSecret

`ProjectSecret updateProjectSecret(projectOrProductUID, secretName, updateProjectSecretRequest)`

Update the value of an existing project secret

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let secretName = "secretName_example"; // String | The name of the secret.
let updateProjectSecretRequest = new NotehubJs.UpdateProjectSecretRequest(); // UpdateProjectSecretRequest |
apiInstance
  .updateProjectSecret(
    projectOrProductUID,
    secretName,
    updateProjectSecretRequest
  )
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                           | Type                                                                                                                   | Description             | Notes |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | ----------------------- | ----- |
| **projectOrProductUID**        | **String**                                                                                                             |                         |       |
| **secretName**                 | **String**                                                                                                             | The name of the secret. |       |
| **updateProjectSecretRequest** | [**UpdateProjectSecretRequest**](https://github.com/blues/notehub-js/blob/main/src/docs/UpdateProjectSecretRequest.md) |                         |       |

##### Return type

[**ProjectSecret**](https://github.com/blues/notehub-js/blob/main/src/docs/ProjectSecret.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### uploadFirmware

`FirmwareInfo uploadFirmware(projectOrProductUID, firmwareType, filename, body, opts)`

Upload firmware binary

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.ProjectApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let firmwareType = "firmwareType_example"; // String |
let filename = "filename_example"; // String |
let body = "/path/to/file"; // File | contents of the firmware binary
let opts = {
  version: "version_example", // String | Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty
  notes: "notes_example", // String | Optional notes describing what's different about this firmware version
};
apiInstance
  .uploadFirmware(projectOrProductUID, firmwareType, filename, body, opts)
  .then(
    (data) => {
      console.log(
        "API called successfully. Returned data: " + JSON.stringify(data)
      );
    },
    (error) => {
      console.error(error);
    }
  );
```

##### Parameters

| Name                    | Type       | Description                                                                                                                         | Notes       |
| ----------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| **projectOrProductUID** | **String** |                                                                                                                                     |             |
| **firmwareType**        | **String** |                                                                                                                                     |             |
| **filename**            | **String** |                                                                                                                                     |             |
| **body**                | **File**   | contents of the firmware binary                                                                                                     |             |
| **version**             | **String** | Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty | \[optional] |
| **notes**               | **String** | Optional notes describing what's different about this firmware version                                                              | \[optional] |

##### Return type

[**FirmwareInfo**](https://github.com/blues/notehub-js/blob/main/src/docs/FirmwareInfo.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/octet-stream
- **Accept**: application/json

### Route API

All URIs are relative to *<https://api.notefile.net>*

| Method                                          | HTTP request                                                            | Description |
| ----------------------------------------------- | ----------------------------------------------------------------------- | ----------- |
| [**createRoute**](#createroute)                 | **POST** /v1/projects/{projectOrProductUID}/routes                      |             |
| [**deleteRoute**](#deleteroute)                 | **DELETE** /v1/projects/{projectOrProductUID}/routes/{routeUID}         |             |
| [**getRoute**](#getroute)                       | **GET** /v1/projects/{projectOrProductUID}/routes/{routeUID}            |             |
| [**getRouteLogsByRoute**](#getroutelogsbyroute) | **GET** /v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs |             |
| [**getRoutes**](#getroutes)                     | **GET** /v1/projects/{projectOrProductUID}/routes                       |             |
| [**updateRoute**](#updateroute)                 | **PUT** /v1/projects/{projectOrProductUID}/routes/{routeUID}            |             |

#### createRoute

`NotehubRoute createRoute(projectOrProductUID, notehubRoute)`

Create Route within a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let notehubRoute = {
  http: {
    disable_http_headers: false,
    filter: {},
    fleets: ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
    http_headers: { "X-My-Header": "value" },
    throttle_ms: 100,
    timeout: 5000,
    transform: {},
    url: "https://example.com/ingest",
  },
  label: "Route Label",
}; // NotehubRoute | Route to be created
apiInstance.createRoute(projectOrProductUID, notehubRoute).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type                                                                                       | Description         | Notes |
| ----------------------- | ------------------------------------------------------------------------------------------ | ------------------- | ----- |
| **projectOrProductUID** | **String**                                                                                 |                     |       |
| **notehubRoute**        | [**NotehubRoute**](https://github.com/blues/notehub-js/blob/main/src/docs/NotehubRoute.md) | Route to be created |       |

##### Return type

[**NotehubRoute**](https://github.com/blues/notehub-js/blob/main/src/docs/NotehubRoute.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

#### deleteRoute

`deleteRoute(projectOrProductUID, routeUID)`

Delete single route within a project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.deleteRoute(projectOrProductUID, routeUID).then(
  () => {
    console.log("API called successfully.");
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **routeUID**            | **String** |             |       |

##### Return type

null (empty response body)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getRoute

`NotehubRoute getRoute(projectOrProductUID, routeUID)`

Get single route within a project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
apiInstance.getRoute(projectOrProductUID, routeUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |
| **routeUID**            | **String** |             |       |

##### Return type

[**NotehubRoute**](https://github.com/blues/notehub-js/blob/main/src/docs/NotehubRoute.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getRouteLogsByRoute

`[RouteLog] getRouteLogsByRoute(projectOrProductUID, routeUID, opts)`

Get Route Logs by Route UID

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let opts = {
  pageSize: 50, // Number |
  pageNum: 1, // Number |
  deviceUID: ["null"], // [String] | A Device UID.
  sortBy: "'date'", // String |
  sortOrder: "'desc'", // String |
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  systemFilesOnly: true, // Boolean |
  mostRecentOnly: true, // Boolean |
  files: "_health.qo, data.qo", // String |
  routingStatus: failure, // [String] |
  responseStatus: 500, // [String] |
};
apiInstance.getRouteLogsByRoute(projectOrProductUID, routeUID, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                     | Notes                            |
| ----------------------- | ------------- | --------------------------------------------------------------- | -------------------------------- |
| **projectOrProductUID** | **String**    |                                                                 |                                  |
| **routeUID**            | **String**    |                                                                 |                                  |
| **pageSize**            | **Number**    |                                                                 | \[optional] \[default to 50]     |
| **pageNum**             | **Number**    |                                                                 | \[optional] \[default to 1]      |
| **deviceUID**           | **\[String]** | A Device UID.                                                   | \[optional]                      |
| **sortBy**              | **String**    |                                                                 | \[optional] \[default to 'date'] |
| **sortOrder**           | **String**    |                                                                 | \[optional] \[default to 'desc'] |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp | \[optional]                      |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp   | \[optional]                      |
| **systemFilesOnly**     | **Boolean**   |                                                                 | \[optional]                      |
| **mostRecentOnly**      | **Boolean**   |                                                                 | \[optional]                      |
| **files**               | **String**    |                                                                 | \[optional]                      |
| **routingStatus**       | **\[String]** |                                                                 | \[optional]                      |
| **responseStatus**      | **\[String]** |                                                                 | \[optional]                      |

##### Return type

[**\[RouteLog\]**](https://github.com/blues/notehub-js/blob/main/src/docs/RouteLog.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getRoutes

`[NotehubRouteSummary] getRoutes(projectOrProductUID)`

Get all Routes within a Project

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
apiInstance.getRoutes(projectOrProductUID).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type       | Description | Notes |
| ----------------------- | ---------- | ----------- | ----- |
| **projectOrProductUID** | **String** |             |       |

##### Return type

[**\[NotehubRouteSummary\]**](https://github.com/blues/notehub-js/blob/main/src/docs/NotehubRouteSummary.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### updateRoute

`NotehubRoute updateRoute(projectOrProductUID, routeUID, notehubRoute)`

Update route by UID

##### Example

```javascript
import * as NotehubJs from '@blues-inc/notehub-js';
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications['personalAccessToken'];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN"

let apiInstance = new NotehubJs.RouteApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let routeUID = "route:cbd20093cba58392c9f9bbdd0cdeb1a0"; // String |
let notehubRoute = {
  "http" {
    "filter": {
      "type": "include",
      "system_notefiles": true,
      "files": ["somefile.qo"],
    },
    "throttle_ms": 50,
    "url": "http://new-route.url",
  },
}
; // NotehubRoute | Route settings to be updated
apiInstance.updateRoute(projectOrProductUID, routeUID, notehubRoute).then((data) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
  console.error(error);
});
```

##### Parameters

| Name                    | Type                                                                                       | Description                  | Notes |
| ----------------------- | ------------------------------------------------------------------------------------------ | ---------------------------- | ----- |
| **projectOrProductUID** | **String**                                                                                 |                              |       |
| **routeUID**            | **String**                                                                                 |                              |       |
| **notehubRoute**        | [**NotehubRoute**](https://github.com/blues/notehub-js/blob/main/src/docs/NotehubRoute.md) | Route settings to be updated |       |

##### Return type

[**NotehubRoute**](https://github.com/blues/notehub-js/blob/main/src/docs/NotehubRoute.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### Usage API

All URIs are relative to *<https://api.notefile.net>*

| Method                                      | HTTP request                                                | Description |
| ------------------------------------------- | ----------------------------------------------------------- | ----------- |
| [**getDataUsage**](#getdatausage)           | **GET** /v1/projects/{projectOrProductUID}/usage/data       |             |
| [**getEventsUsage**](#geteventsusage)       | **GET** /v1/projects/{projectOrProductUID}/usage/events     |             |
| [**getRouteLogsUsage**](#getroutelogsusage) | **GET** /v1/projects/{projectOrProductUID}/usage/route-logs |             |
| [**getSessionsUsage**](#getsessionsusage)   | **GET** /v1/projects/{projectOrProductUID}/usage/sessions   |             |

#### getDataUsage

`GetDataUsage200Response getDataUsage(projectOrProductUID, period, opts)`

Get data usage in bytes for a project with time range and period aggregation

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  deviceUID: ["null"], // [String] | A Device UID.
  fleetUID: ["null"], // [String] | Filter by Fleet UID
  limit: 200000, // Number | Limit the number of data points returned
  aggregate: "'device'", // String | Aggregation level for results
};
apiInstance.getDataUsage(projectOrProductUID, period, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                     | Notes                              |
| ----------------------- | ------------- | --------------------------------------------------------------- | ---------------------------------- |
| **projectOrProductUID** | **String**    |                                                                 |                                    |
| **period**              | **String**    | Period type for aggregation                                     |                                    |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp | \[optional]                        |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp   | \[optional]                        |
| **deviceUID**           | **\[String]** | A Device UID.                                                   | \[optional]                        |
| **fleetUID**            | **\[String]** | Filter by Fleet UID                                             | \[optional]                        |
| **limit**               | **Number**    | Limit the number of data points returned                        | \[optional] \[default to 200000]   |
| **aggregate**           | **String**    | Aggregation level for results                                   | \[optional] \[default to 'device'] |

##### Return type

[**GetDataUsage200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetDataUsage200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getEventsUsage

`UsageEventsResponse getEventsUsage(projectOrProductUID, period, opts)`

Get events usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  deviceUID: ["null"], // [String] | A Device UID.
  fleetUID: ["null"], // [String] | Filter by Fleet UID
  limit: 200000, // Number | Limit the number of data points returned
  aggregate: "'device'", // String | Aggregation level for results
  notefile: ["null"], // [String] | Filter to specific notefiles
  skipRecentData: false, // Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.
  includeNotefiles: false, // Boolean | Include per-notefile event counts in the response
};
apiInstance.getEventsUsage(projectOrProductUID, period, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                                                                                                               | Notes                              |
| ----------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **projectOrProductUID** | **String**    |                                                                                                                                                           |                                    |
| **period**              | **String**    | Period type for aggregation                                                                                                                               |                                    |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp                                                                                           | \[optional]                        |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp                                                                                             | \[optional]                        |
| **deviceUID**           | **\[String]** | A Device UID.                                                                                                                                             | \[optional]                        |
| **fleetUID**            | **\[String]** | Filter by Fleet UID                                                                                                                                       | \[optional]                        |
| **limit**               | **Number**    | Limit the number of data points returned                                                                                                                  | \[optional] \[default to 200000]   |
| **aggregate**           | **String**    | Aggregation level for results                                                                                                                             | \[optional] \[default to 'device'] |
| **notefile**            | **\[String]** | Filter to specific notefiles                                                                                                                              | \[optional]                        |
| **skipRecentData**      | **Boolean**   | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | \[optional] \[default to false]    |
| **includeNotefiles**    | **Boolean**   | Include per-notefile event counts in the response                                                                                                         | \[optional] \[default to false]    |

##### Return type

[**UsageEventsResponse**](https://github.com/blues/notehub-js/blob/main/src/docs/UsageEventsResponse.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getRouteLogsUsage

`GetRouteLogsUsage200Response getRouteLogsUsage(projectOrProductUID, period, opts)`

Get route logs usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  routeUID: ["null"], // [String] | A Route UID.
  limit: 200000, // Number | Limit the number of data points returned
  aggregate: "'route'", // String | Aggregation level for results
  skipRecentData: false, // Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.
};
apiInstance.getRouteLogsUsage(projectOrProductUID, period, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                                                                                                               | Notes                             |
| ----------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| **projectOrProductUID** | **String**    |                                                                                                                                                           |                                   |
| **period**              | **String**    | Period type for aggregation                                                                                                                               |                                   |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp                                                                                           | \[optional]                       |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp                                                                                             | \[optional]                       |
| **routeUID**            | **\[String]** | A Route UID.                                                                                                                                              | \[optional]                       |
| **limit**               | **Number**    | Limit the number of data points returned                                                                                                                  | \[optional] \[default to 200000]  |
| **aggregate**           | **String**    | Aggregation level for results                                                                                                                             | \[optional] \[default to 'route'] |
| **skipRecentData**      | **Boolean**   | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | \[optional] \[default to false]   |

##### Return type

[**GetRouteLogsUsage200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetRouteLogsUsage200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

#### getSessionsUsage

`GetSessionsUsage200Response getSessionsUsage(projectOrProductUID, period, opts)`

Get sessions usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied

##### Example

```javascript
import * as NotehubJs from "@blues-inc/notehub-js";
let defaultClient = NotehubJs.ApiClient.instance;
let personalAccessToken = defaultClient.authentications["personalAccessToken"];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN";

let apiInstance = new NotehubJs.UsageApi();
let projectOrProductUID = "app:2606f411-dea6-44a0-9743-1130f57d77d8"; // String |
let period = "period_example"; // String | Period type for aggregation
let opts = {
  startDate: 1628631763, // Number | Start date for filtering results, specified as a Unix timestamp
  endDate: 1657894210, // Number | End date for filtering results, specified as a Unix timestamp
  deviceUID: ["null"], // [String] | A Device UID.
  fleetUID: ["null"], // [String] | Filter by Fleet UID
  limit: 200000, // Number | Limit the number of data points returned
  aggregate: "'device'", // String | Aggregation level for results
  skipRecentData: false, // Boolean | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects.
};
apiInstance.getSessionsUsage(projectOrProductUID, period, opts).then(
  (data) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  },
  (error) => {
    console.error(error);
  }
);
```

##### Parameters

| Name                    | Type          | Description                                                                                                                                               | Notes                              |
| ----------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **projectOrProductUID** | **String**    |                                                                                                                                                           |                                    |
| **period**              | **String**    | Period type for aggregation                                                                                                                               |                                    |
| **startDate**           | **Number**    | Start date for filtering results, specified as a Unix timestamp                                                                                           | \[optional]                        |
| **endDate**             | **Number**    | End date for filtering results, specified as a Unix timestamp                                                                                             | \[optional]                        |
| **deviceUID**           | **\[String]** | A Device UID.                                                                                                                                             | \[optional]                        |
| **fleetUID**            | **\[String]** | Filter by Fleet UID                                                                                                                                       | \[optional]                        |
| **limit**               | **Number**    | Limit the number of data points returned                                                                                                                  | \[optional] \[default to 200000]   |
| **aggregate**           | **String**    | Aggregation level for results                                                                                                                             | \[optional] \[default to 'device'] |
| **skipRecentData**      | **Boolean**   | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | \[optional] \[default to false]    |

##### Return type

[**GetSessionsUsage200Response**](https://github.com/blues/notehub-js/blob/main/src/docs/GetSessionsUsage200Response.md)

##### Authorization

[personalAccessToken](https://github.com/blues/notehub-js/blob/main/README.md#personalAccessToken)

##### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json
