client.org
client.org
client.org wraps /api/v1/org/* — the calling organization's profile, its locations and its email-notification settings. See the matching REST documentation at Organizations API.
HTTP-level failures surface as EBonApiError — see Errors and /en/api/errors.
client.org.get()
Get the current organization.
async get(): Promise<Organization>
No parameters. Returns the current Organization.
const org = await client.org.get();
client.org.update(body)
Update organization properties.
async update(body: UpdateOrgBody): Promise<Organization>
| Name | Type | Required | Notes |
|---|---|---|---|
name | string | no | Rename the organization. |
billingAddress | BillingAddress | no | Replace the full billing address. |
Returns the updated Organization.
await client.org.update({ name: 'ACME SRL' });
client.org.listLocations()
List all locations.
async listLocations(): Promise<Location[]>
No parameters. Returns an array of Location.
const locations = await client.org.listLocations();
client.org.createLocation(body)
Create a new location.
async createLocation(body: CreateLocationBody): Promise<Location>
| Name | Type | Required | Notes |
|---|---|---|---|
name | string | yes | Human-readable label. |
address | string | yes | Postal address (single string). |
Returns the created Location.
await client.org.createLocation({ name: 'Cluj HQ', address: 'Strada Memorandumului 1' });
client.org.updateLocation(id, body)
Update a location.
async updateLocation(id: string, body: UpdateLocationBody): Promise<Location>
| Name | Type | Required | Notes |
|---|---|---|---|
name | string | no | Rename the location. |
address | string | no | Replace the postal address. |
Returns the updated Location.
await client.org.updateLocation('loc_01HZ...', { name: 'Cluj HQ' });
client.org.deleteLocation(id)
Delete a location.
async deleteLocation(id: string): Promise<undefined>
| Name | Type | Required | Notes |
|---|---|---|---|
id | string | yes | Location identifier. |
Returns undefined on success.
await client.org.deleteLocation('loc_01HZ...');
client.org.getNotificationSettings()
Get notification settings.
async getNotificationSettings(): Promise<NotificationSettings>
No parameters. Returns { subscribers: NotificationSubscriber[] } — every email and the categories they receive.
const { subscribers } = await client.org.getNotificationSettings();
client.org.updateNotificationSettings(body)
Update notification settings.
async updateNotificationSettings(body: UpdateNotificationSettingsBody): Promise<NotificationSettings>
| Name | Type | Required | Notes |
|---|---|---|---|
subscribers | NotificationSubscriber[] | yes | Full replacement list — each entry is { email, categories: NotificationCategory[] }. |
Returns the updated NotificationSettings. NotificationCategory is one of 'reports' | 'alerts' | 'billing' | 'device_events' | 'analytics'.
await client.org.updateNotificationSettings({
subscribers: [
{ email: 'ops@example.com', categories: ['alerts', 'device_events'] },
{ email: 'finance@example.com', categories: ['reports', 'billing'] },
],
});