Flowion Docs

Organizations

The top level of the Organization → Environment → ChargingStation hierarchy (see docs/architecture/tenancy.md) — create, rename, and look up organizations.

5 endpoints

Lists the organizations the caller belongs to, paginated.

get/v1/organizationsRequires a bearer token

Parameters

NameInTypeDescription
pagequeryinteger<int32>1-indexed page number. Defaults to 1.
per_pagequeryinteger<int32>Organizations per page, capped at 100. Defaults to 20.

Responses

StatusBodyDescription
200ListOrganizationsResponseA page of the organizations the caller belongs to
401ErrorBodyMissing, invalid, or expired bearer token

Creates an organization, its default "prod" environment, and makes the caller its Owner.

post/v1/organizationsRequires a bearer token

See db::organizations::create — this is the only way an organization comes into being with a member at all, since there's no invite flow yet (see docs/architecture/tenancy.md).

Request bodyCreateOrganizationRequest

FieldTypeDescription
name*string
slug*stringCaller-supplied rather than derived from name (see migrations/0017_organizations_slug.sql for its format rules).

Responses

StatusBodyDescription
201OrganizationSummaryThe newly created organization, with the caller as its Owner
401ErrorBodyMissing, invalid, or expired bearer token
409ErrorBodyAn organization with this slug already exists

Fetches a single organization the caller belongs to, by id.

get/v1/organizations/{organization_id}Requires a bearer token

Parameters

NameInTypeDescription
organization_id*pathstring<uuid>Organization id

Responses

StatusBodyDescription
200OrganizationSummaryThe organization
401ErrorBodyMissing, invalid, or expired bearer token
404ErrorBodyNo organization with this id exists, or the caller is not a member of it

Renames and/or re-slugs an organization.

patch/v1/organizations/{organization_id}Requires a bearer token

Requires the caller to be an Owner or Admin of the organization — renaming/re-slugging is an organization-settings action, the same bucket as environment management in docs/architecture/tenancy.md's proposed permission table.

Parameters

NameInTypeDescription
organization_id*pathstring<uuid>Organization id

Request bodyUpdateOrganizationRequest

FieldTypeDescription
name*string
slugstring | nullIf present, also changes the organization's slug (see migrations/0017_organizations_slug.sql for its format rules).

Responses

StatusBodyDescription
200OrganizationSummaryThe updated organization
401ErrorBodyMissing, invalid, or expired bearer token
403ErrorBodyThe caller is a member but not an Owner or Admin
404ErrorBodyNo organization with this id exists, or the caller is not a member of it
409ErrorBodyAn organization with this slug already exists

Fetches a single organization the caller belongs to, by slug.

get/v1/organizations/by-slug/{slug}Requires a bearer token

Parameters

NameInTypeDescription
slug*pathstringOrganization slug

Responses

StatusBodyDescription
200OrganizationSummaryThe organization
401ErrorBodyMissing, invalid, or expired bearer token
404ErrorBodyNo organization with this slug exists, or the caller is not a member of it