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

    int

    The number of organizations to skip before starting to return results. The default value is 0.

  • limit

    int

    The maximum number of organizations to return. It can be any value between 1 and 1,000. If not provided, the default value is 100.

Response

  • organizations

    array of object

    The list of organizations.

    • id

      uuid

      The organization's unique identifier.

    • name

      string

      The organization's name.

GET /v1/organizations
curl -G https://example.com/v1/organizations \
-H "Authorization: Bearer org_xxxxxxx" \
-d "limit=100"
Response
{
  "organizations": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Acme Corp"
    }
  ]
}

Get organization

Returns a single organization by its identifier.

Request

  • :id

    uuid Required

    The organization's identifier.

Response

  • id

    uuid

    The organization's unique identifier.

  • name

    string

    The organization's name.

GET /v1/organizations/:id
curl https://example.com/v1/organizations/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer org_xxxxxxx"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Acme Corp"
}
Errors
404
organization does not exist

Create organization

Creates a new organization.

Request

  • name

    string Required

    The organization's name.

    Must be a non-empty string with a maximum of 45 characters.

Response

  • id

    uuid

    The identifier of the created organization.

POST /v1/organizations
curl https://example.com/v1/organizations \
-H "Authorization: Bearer org_xxxxxxx" \
--json '{
"name": "Acme Corp"
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000"
}

Update organization

Updates the name of an organization.

Request

  • :id

    uuid Required

    The organization's identifier.

  • name

    string Required

    It can be 1 to 45 Unicode characters long.

    Must be a non-empty string with a maximum of 45 characters.

Response

No response.
PUT /v1/organizations/:id
curl -X PUT https://example.com/v1/organizations/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer org_xxxxxxx" \
--json '{
"name": "Acme Corp"
}'
Errors
404
organization does not exist

Delete organization

Deletes an organization and all its data.

Request

  • :id

    uuid Required

    The organization's identifier.

Response

No response.
DELETE /v1/organizations/:id
curl -X DELETE https://example.com/v1/organizations/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer org_xxxxxxx"
Errors
404
organization does not exist