REST API
Call the REST API with an API key and curl.
Authenticate
Every call needs an API key. Create one on the API keys page in the app. A key acts as the person who created it, inside that organization, so it can do what the catalog allows and nothing more.
curl -X POST https://your-app.example.com/api/v1/org.current \
-H "Authorization: Bearer $SEAWATTS_API_KEY"Call an operation
Each operation is a POST to /api/v1/ followed by its name, with the input as a JSON body. The answer has the result under "data". A read that takes no input also answers a plain GET.
curl -X POST https://your-app.example.com/api/v1/org.updateName \
-H "Authorization: Bearer $SEAWATTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"acme"}'Handle errors
A failed call returns an "error" with a code and a message you can show. 400 means the input was wrong and says how, 401 means the key is missing or inactive, 404 means the operation does not exist.
{ "error": { "code": "BAD_REQUEST", "message": "Name can only contain lowercase letters, numbers, and hyphens" } }OpenAPI
The full list of operations is served as an OpenAPI 3.1 document at /api/v1/openapi.json. Import it into an API client or generate a client in another language from it.