Hanzo

Organizations API

Create, read, update, and delete organizations

The Organizations API manages the top-level entity in Hanzo Platform. Every cluster, project, and team member belongs to an organization.

Endpoints

ProcedureMethodDescription
organization.allGETList all organizations for the authenticated user
organization.oneGETGet a single organization by ID
organization.createPOSTCreate a new organization
organization.updatePATCHUpdate organization settings
organization.removeDELETEDelete an organization

List Organizations

GET /api/organization.all

Returns all organizations the authenticated user is a member of.

curl https://app.platform.hanzo.ai/api/organization.all \
  -H "Authorization: Bearer YOUR_TOKEN"

Response:

{
  "result": {
    "data": [
      {
        "id": "org_abc123",
        "name": "Acme Corp",
        "description": "Production infrastructure",
        "createdAt": "2025-01-15T10:00:00Z",
        "memberCount": 12,
        "clusterCount": 3
      },
      {
        "id": "org_def456",
        "name": "Staging",
        "description": "Development and testing",
        "createdAt": "2025-03-20T14:30:00Z",
        "memberCount": 5,
        "clusterCount": 1
      }
    ]
  }
}

Get Organization

GET /api/organization.one?organizationId=org_abc123

curl "https://app.platform.hanzo.ai/api/organization.one?organizationId=org_abc123" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response:

{
  "result": {
    "data": {
      "id": "org_abc123",
      "name": "Acme Corp",
      "description": "Production infrastructure",
      "createdAt": "2025-01-15T10:00:00Z",
      "memberCount": 12,
      "clusterCount": 3,
      "members": [
        {
          "userId": "user_abc",
          "email": "alice@acme.com",
          "role": "owner",
          "joinedAt": "2025-01-15T10:00:00Z"
        }
      ]
    }
  }
}

Create Organization

POST /api/organization.create

curl -X POST https://app.platform.hanzo.ai/api/organization.create \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "description": "Production infrastructure"
  }'

Parameters:

FieldTypeRequiredDescription
namestringYesOrganization name (2-50 characters)
descriptionstringNoShort description

Response: 201 Created

{
  "result": {
    "data": {
      "id": "org_new789",
      "name": "Acme Corp",
      "description": "Production infrastructure",
      "createdAt": "2026-02-26T10:00:00Z"
    }
  }
}

The authenticated user is automatically assigned the Owner role.

Update Organization

PATCH /api/organization.update

curl -X PATCH https://app.platform.hanzo.ai/api/organization.update \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org_abc123",
    "name": "Acme Corporation",
    "description": "Updated description"
  }'

Parameters:

FieldTypeRequiredDescription
organizationIdstringYesOrganization ID
namestringNoNew name
descriptionstringNoNew description

Requires Owner or Admin role.

Delete Organization

DELETE /api/organization.remove

curl -X DELETE https://app.platform.hanzo.ai/api/organization.remove \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org_abc123"
  }'

Response: 204 No Content

Deleting an organization permanently removes all clusters, projects, environments, and data. This action cannot be undone. Requires the Owner role.

Team Management

Team members are managed via the orgTeam router:

ProcedureMethodDescription
orgTeam.allGETList all members of an organization
orgTeam.updatePATCHChange a member's role
orgTeam.removeDELETERemove a member
# List members
curl "https://app.platform.hanzo.ai/api/orgTeam.all?organizationId=org_abc123" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Change role
curl -X PATCH https://app.platform.hanzo.ai/api/orgTeam.update \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org_abc123",
    "userId": "user_def456",
    "role": "admin"
  }'

# Remove member
curl -X DELETE https://app.platform.hanzo.ai/api/orgTeam.remove \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org_abc123",
    "userId": "user_def456"
  }'

How is this guide?

Last updated on

On this page