# @openremote/rest

> OpenRemote 3.x REST API

Latest version **1.30.0** (published 2026-09-02) · AGPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @openremote/rest
pnpm add @openremote/rest
yarn add @openremote/rest
bun add @openremote/rest
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.30.0 |
| Published | 2026-09-02 |
| First published | 2019-01-25 |
| Weekly downloads | 0 |
| License | AGPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 295.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | OpenRemote |
| Maintainers | openremotedeveloper, wborn |

## Links

- npm: https://www.npmjs.com/package/@openremote/rest
- npm.io page: https://npm.io/package/@openremote/rest

## Dependencies (2)

- [qs](https://npm.io/package/qs.md) ^6.8.0
- [axios](https://npm.io/package/axios.md) 1.18.1

## Recent versions

- 1.30.0 (latest) — 2026-09-02
- 1.31.0-snapshot.20260916144308 (snapshot) — 2026-09-16
- 1.31.0-snapshot.20260916130646 — 2026-09-16
- 1.31.0-snapshot.20260915122244 — 2026-09-15
- 1.31.0-snapshot.20260911091633 — 2026-09-11
- 1.31.0-snapshot.20260910125057 — 2026-09-10
- 1.31.0-snapshot.20260910120754 — 2026-09-10
- 1.31.0-snapshot.20260908130403 — 2026-09-08
- 1.31.0-snapshot.20260907094218 — 2026-09-07
- 1.31.0-snapshot.20260904133325 — 2026-09-04
- 1.31.0-snapshot.20260904115341 — 2026-09-04
- 1.31.0-snapshot.20260904102436 — 2026-09-04
- 1.31.0-snapshot.20260903144735 — 2026-09-03
- 1.31.0-snapshot.20260903142507 — 2026-09-03
- 1.31.0-snapshot.20260903135821 — 2026-09-03
- … 814 more at https://npm.io/package/@openremote/rest/versions

## README

# @openremote/rest

[![NPM Version][npm-image]][npm-url]

ES6 modules for connecting to an OpenRemote Manager as well as utilities for performing common tasks.

The default export is a singleton of type `RestApi` that can be used to communicate with the OpenRemote Manager REST API.
It uses an [axios](https://github.com/axios/axios) client to perform the requests and it contains strongly typed
definitions for each OpenRemote Manager REST API endpoint (JAX-RS resource).

## Install

```bash
npm i @openremote/rest
yarn add @openremote/rest
```

## Usage

For a full list of properties, methods and options refer to the TypeDoc generated [documentation](<>).

If used in conjunction with `@openremote/core` and the `Manager` `init` method has been called then the default export
will be ready to use, the endpoints can be accessed via the `RestApi` `api` property and each JAX-RS resource defined
in the OpenRemote Manager is also defined with the same name in the `RestApi` object.

```$typescript
import openremote from "@openremote/core";
import rest from "@openremote/rest";

openremote.init({
    ...
}).then((success) => {
    if (success) {
        let assetQuery = ...;
        let response = await rest.api.AssetResource.queryAssets(assetQuery);
        let assets = response.data;

        // Do something with the assets
    } else {
        // Something has gone wrong
    }
});
```

It is possible to add additional request interceptors by calling the `addRequestInterceptor` method, it is also possible
to access the `AxiosInstance` by calling the `axiosInstance` property.

It is also possible to instantiate the `RestApi` object on demand but note you will need to ensure the Authorization
header is correctly set if calling secure endpoints on the OpenRemote Manager REST API.

```$typescript
import {RestApi} from "@openremote/rest";

let rest = new RestApi();
rest.setTimeout(10000);
rest.addRequestInterceptor(...);
rest.initialise();
```

## Supported Browsers

The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
Internet Explorer 11 is also supported.

## License

[GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)

[npm-image]: https://img.shields.io/npm/v/@openremote/rest.svg
[npm-url]: https://www.npmjs.com/package/@openremote/rest

---
_Source: https://npm.io/package/@openremote/rest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
