{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coderpad/json-schema/coderpad-organization-response-schema.json",
  "title": "OrganizationResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coderpad-organization-api-openapi.yml#/components/schemas/OrganizationResponse",
  "allOf": [
    {
      "$ref": "#/$defs/Ok"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "organization_name": {
          "type": "string"
        },
        "child_organizations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "organization_name": {
                "type": "string"
              }
            }
          }
        },
        "user_count": {
          "type": "integer"
        },
        "users": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "format": "email"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "teams": {
                "type": "array",
                "description": "IDs of the teams the user belongs to.",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        },
        "organization_default_language": {
          "type": [
            "string",
            "null"
          ]
        },
        "single_sign_on_supported": {
          "type": "boolean"
        },
        "single_sign_in_url": {
          "type": "string",
          "description": "The organization's single sign-on domain. Only present when single sign-on is enabled."
        },
        "teams": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Team"
          }
        }
      }
    }
  ],
  "$defs": {
    "Ok": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "OK"
          ]
        }
      }
    },
    "Team": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}