Organizations
Manage the organizations of the Krenalis instance.
All these endpoints require an organizations API key instead of the standard API key.
List organizations
Returns the organizations, sorted by name.
Request
-
first
intThe number of organizations to skip before starting to return results. The default value is 0.
-
limit
intThe maximum number of organizations to return. If not provided, the default value is 100.
It must be between 1 and 1000.
Response
-
organizations
array of objectThe list of organizations.
-
id
stringThe organization's unique identifier.
-
name
stringThe organization's name.
-
enabled
booleanIndicates if the organization is enabled. Use the Set status endpoint to change the organization's status.
-
curl -G https://example.com/v1/organizations \ -H "Authorization: Bearer org_xxxxxxx" \ -d "limit=100" {
"organizations": [
{
"id": "3nV8kQ5wA6pT",
"name": "Acme Corp",
"enabled": true
}
]
}Get organization
Returns a single organization by its identifier.
Request
-
:id
string RequiredThe organization's identifier.
Response
-
id
stringThe organization's unique identifier.
-
name
stringThe organization's name.
-
enabled
booleanIndicates if the organization is enabled. Use the Set status endpoint to change the organization's status.
curl https://example.com/v1/organizations/3nV8kQ5wA6pT \ -H "Authorization: Bearer org_xxxxxxx" {
"id": "3nV8kQ5wA6pT",
"name": "Acme Corp",
"enabled": true
}Create organization
Creates a new organization.
Request
-
name
string RequiredThe organization's name.
Must be a non-empty string with a maximum of 45 characters. -
enabled
booleanIndicates if the organization is enabled once created. Logins to workspaces of a disabled organization, as well as calls made with API and MCP keys to its workspaces, return an
OrganizationDisablederror. The only exception is event ingestion authenticated with an event write key, which fails with aServiceUnavailableerror instead. Calls with Organizations API keys are unaffected. Use the Set status endpoint to change the organization's status.
Response
-
id
stringThe identifier of the created organization.
curl https://example.com/v1/organizations \ -H "Authorization: Bearer org_xxxxxxx" \ --json '{ "name": "Acme Corp", "enabled": true }' {
"id": "3nV8kQ5wA6pT"
}Update organization
Updates the name of an organization.
Request
-
:id
string RequiredThe organization's identifier.
-
name
string RequiredThe organization's name.
Must be a non-empty string with a maximum of 45 characters.
Response
No response.curl -X PUT https://example.com/v1/organizations/3nV8kQ5wA6pT \ -H "Authorization: Bearer org_xxxxxxx" \ --json '{ "name": "Acme Corp" }' Set status
Sets the status of an organization, which can be enabled or disabled.
Logins to workspaces of a disabled organization, as well as calls made with API and MCP keys to its workspaces, return an OrganizationDisabled error. The only exception is event ingestion authenticated with an event write key, which fails with a ServiceUnavailable error instead. Calls with Organizations API keys are unaffected.
The organization's data and configuration are preserved and can be restored by enabling the organization again.
Request
-
:id
string RequiredThe organization's identifier.
-
enabled
boolean RequiredIndicates if the organization is enabled.
Response
No response.curl -X PUT https://example.com/v1/organizations/3nV8kQ5wA6pT/status \ -H "Authorization: Bearer org_xxxxxxx" \ --json '{ "enabled": true }' Delete organization
Deletes an organization and all its data.
Request
-
:id
string RequiredThe organization's identifier.
Response
No response.curl -X DELETE https://example.com/v1/organizations/3nV8kQ5wA6pT \ -H "Authorization: Bearer org_xxxxxxx"