{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eightfold-ai/json-schema/eightfold-ai-org-unit-schema-schema.json",
  "title": "OrgUnitSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eightfold-ai-org-unit-api-openapi.yml#/components/schemas/OrgUnitSchema",
  "type": "object",
  "properties": {
    "status": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Org unit status"
    },
    "updatedBy": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Updated by"
    },
    "orgUnitId": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "Org unit id"
    },
    "userGroups": {
      "readOnly": true,
      "description": "User groups associated with the org unit",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/RmUserGroup"
      }
    },
    "extOrgUnitId": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "External org unit id"
    },
    "endDate": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "End date timestamp"
    },
    "createdBy": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Created by"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Org unit description"
    },
    "parentExtId": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Parent external id"
    },
    "startDate": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "Start date timestamp"
    },
    "systemId": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Org unit system id"
    },
    "type": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Org unit type"
    },
    "updatedAt": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "Updated at timestamp"
    },
    "customFields": {
      "type": [
        "object",
        "null"
      ],
      "readOnly": true,
      "description": "Custom fields"
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Org unit title"
    },
    "tags": {
      "readOnly": true,
      "description": "Tags associated with the org unit",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/EntityTag"
      }
    }
  },
  "required": [
    "title",
    "type"
  ],
  "$defs": {
    "EntityTag": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "user",
            "system"
          ],
          "description": "Type of the tag (user/system)"
        },
        "name": {
          "type": "string",
          "description": "Name of the tag"
        },
        "category": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "inherited_tag",
            null
          ],
          "description": "Category of the tag (e.g. inherited_tag)"
        }
      },
      "required": [
        "name",
        "type"
      ]
    },
    "RmUserGroup": {
      "type": "object",
      "properties": {
        "userGroupId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique identifier for the user group"
        }
      }
    }
  }
}