{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eurobase-dev/json-schema/eurobase-dev-organizations-response-schema.json",
  "title": "OrganizationsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eurobase-dev-organizations-api-openapi.yml#/components/schemas/OrganizationsResponse",
  "type": "object",
  "required": [
    "organizations"
  ],
  "properties": {
    "organizations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OrganizationSummary"
      }
    }
  },
  "$defs": {
    "OrganizationMembership": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "id",
        "organizationId",
        "userId",
        "status",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "organizationId": {
          "type": "string"
        },
        "userId": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "invited",
            "suspended"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "OrganizationSummary": {
      "type": "object",
      "required": [
        "id",
        "name",
        "projectCount",
        "membership",
        "createdByUserId",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "projectCount": {
          "type": "integer"
        },
        "membership": {
          "$ref": "#/$defs/OrganizationMembership"
        },
        "createdByUserId": {
          "type": "string"
        },
        "canRename": {
          "type": "boolean",
          "description": "Whether the caller is the billing owner and may rename it. Present on organization reads, not on the session workspace."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}