API Token
You need an API token to access Enapter EMS via HTTP API or enapter-cli.
Cloud
info
You must have the Enapter Cloud account.
- Go to Enapter Cloud.
- Click on Account Settings in the upper right corner.

- In API Tokens click on New Token

- Type in an informative token name and click Create Token

- Copy your token and save it somewhere (e.g. your password manager) to use it with API calls.

Gateway
- Set your Gateway up.
- Use your Gateway IP address as a server base address and
/apias a URL subdirectory. For example, if192.168.10.22is Gateway IPv4 address, all API URLs should start withhttps://192.168.10.22/api. If mDNS resolution works well,https://enapter-gateway.local/apiwill also work as an API address. - Go to System Settings -> API Token.

- Copy your token and save it somewhere (e.g. your password manager) to use it with API calls.

Usage
HTTP API
$ curl http://api.enapter.com/v3/sites/fecbbba0-79f2-4e9e-a6f0-69a310ab110b \
-H 'X-Enapter-Auth-Token: 25e9c17fcc7d360607f15ad1916755ed477034521282249ec948ecb7b1880eee'
Enapter CLI
1. Add connection
enapter3 connection add --name my-cloud --token 25e9c17fcc7d360607f15ad1916755ed477034521282249ec948ecb7b1880eee
2. Verify the connection
enapter3 connection list
API Base URL
Use the following base URLs to access this API:
- Enapter Cloud:
https://api.enapter.com - Enapter Gateway:
http://enapter-gateway.local/api
tip
When your devices are connected to the Enapter Cloud — even through the Enapter Gateway — you can remotely monitor and control them from anywhere in the world with an Internet connection.
For the offline Enapter Gateway, you must be on the same local network to enable remote control and monitoring.