API reference
Integrations
Machine to machine integrations in your organisation and their secrets. Up to two secrets can be active per integration, so they can be rotated without downtime.
GET/v1/integrations
List Integrations
clients.read
List M2M integrations visible to the caller.
ebx admins get all integrations across all organisations; other users are scoped to their own organisation(s).
This endpoint takes no parameters.
curl "https://api.ebx.energy/v1/integrations" \
-H "Authorization: Bearer $EBX_TOKEN"import httpx
r = httpx.get(
"https://api.ebx.energy/v1/integrations",
headers={"Authorization": f"Bearer {token}"},
)
print(r.json())const res = await fetch("https://api.ebx.energy/v1/integrations", {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await res.json();[
{
"integration_id": "<string>",
"name": "<string>",
"organization_id": "<string>",
"created_at": "<string>"
}
]POST/v1/integrations
Create Integration
clients.write
Create a Cognito app client for M2M integration access.
The integration name must be unique within your organization. The internal Cognito client will be named with a format that prevents collisions.
Request body · required
- nameREQUIRED
- stringUser-facing display name for the integration (must be unique within your organization)
- scopesREQUIRED
- array[enum]OAuth scopes to grant this integration. Available scopes for M2M integrations: "asset.read", "asset.write", "alarm.read", "alarm.write", "market.read", "market.write", "report.read", "users.read", "users.write", "clients.read", "clients.write". You can only grant scopes you possess. Internal scopes (pool, dispatch, tso) are not grantable.
curl -X POST "https://api.ebx.energy/v1/integrations" \
-H "Authorization: Bearer $EBX_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"<string>","scopes":["asset.read"]}'import httpx
r = httpx.post(
"https://api.ebx.energy/v1/integrations",
headers={"Authorization": f"Bearer {token}"},
json={
"name": "<string>",
"scopes": [
"asset.read",
],
},
)
print(r.json())const res = await fetch("https://api.ebx.energy/v1/integrations", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"name":"<string>","scopes":["asset.read"]}),
});
const data = await res.json();{
"integration_id": "<string>",
"client_secret": "<string>",
"name": "<string>",
"organization_id": "<string>",
"scopes": [
"<string>"
]
}- 400malformed request
- 401no valid token
- 403scope missing
- 409state conflict
- 422validation failed
- 429rate limited
DELETE/v1/integrations/{integration_id}
Delete Integration
clients.write
Delete an M2M integration.
Path parameters
- integration_idREQUIRED
- string
curl -X DELETE "https://api.ebx.energy/v1/integrations/scada-primary" \
-H "Authorization: Bearer $EBX_TOKEN"import httpx
r = httpx.delete(
"https://api.ebx.energy/v1/integrations/scada-primary",
headers={"Authorization": f"Bearer {token}"},
)
print(r.status_code)const res = await fetch("https://api.ebx.energy/v1/integrations/scada-primary", {
method: "DELETE",
headers: {
Authorization: `Bearer ${token}`,
},
});Returns 204 with no body.
- 400malformed request
- 401no valid token
- 403scope missing
- 404unknown or not visible
- 409state conflict
- 429rate limited
GET/v1/integrations/{integration_id}/secrets
List Secrets
clients.read
List secret descriptors for an M2M integration (values are never returned).
Path parameters
- integration_idREQUIRED
- string
curl "https://api.ebx.energy/v1/integrations/scada-primary/secrets" \
-H "Authorization: Bearer $EBX_TOKEN"import httpx
r = httpx.get(
"https://api.ebx.energy/v1/integrations/scada-primary/secrets",
headers={"Authorization": f"Bearer {token}"},
)
print(r.json())const res = await fetch("https://api.ebx.energy/v1/integrations/scada-primary/secrets", {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await res.json();[
{
"secret_id": "<string>",
"creation_date": "<string>"
}
]POST/v1/integrations/{integration_id}/secrets
Add Secret
clients.write
Add a new secret to an M2M integration.
Cognito supports up to two active secrets per integration. To complete a rotation: add a new secret, migrate consumers, then delete the old one.
Path parameters
- integration_idREQUIRED
- string
curl -X POST "https://api.ebx.energy/v1/integrations/scada-primary/secrets" \
-H "Authorization: Bearer $EBX_TOKEN"import httpx
r = httpx.post(
"https://api.ebx.energy/v1/integrations/scada-primary/secrets",
headers={"Authorization": f"Bearer {token}"},
)
print(r.json())const res = await fetch("https://api.ebx.energy/v1/integrations/scada-primary/secrets", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await res.json();{
"integration_id": "<string>",
"secret_id": "<string>",
"secret_value": "<string>"
}- 400malformed request
- 401no valid token
- 403scope missing
- 404unknown or not visible
- 409state conflict
- 429rate limited
DELETE/v1/integrations/{integration_id}/secrets/{secret_id}
Delete Secret
clients.write
Delete a specific secret from an M2M integration.
Path parameters
- integration_idREQUIRED
- string
- secret_idREQUIRED
- string
curl -X DELETE "https://api.ebx.energy/v1/integrations/scada-primary/secrets/scada-primary-basic-auth" \
-H "Authorization: Bearer $EBX_TOKEN"import httpx
r = httpx.delete(
"https://api.ebx.energy/v1/integrations/scada-primary/secrets/scada-primary-basic-auth",
headers={"Authorization": f"Bearer {token}"},
)
print(r.status_code)const res = await fetch("https://api.ebx.energy/v1/integrations/scada-primary/secrets/scada-primary-basic-auth", {
method: "DELETE",
headers: {
Authorization: `Bearer ${token}`,
},
});Returns 204 with no body.
- 400malformed request
- 401no valid token
- 403scope missing
- 404unknown or not visible
- 409state conflict
- 429rate limited