{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eightfold-ai/json-schema/eightfold-ai-demand-schema-schema.json",
  "title": "DemandSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eightfold-ai-demand-api-openapi.yml#/components/schemas/DemandSchema",
  "type": "object",
  "properties": {
    "isArchived": {
      "type": [
        "boolean",
        "null"
      ],
      "readOnly": true,
      "description": "Whether the demand has been archived or not"
    },
    "demandManager": {
      "description": "Demand Manager",
      "allOf": [
        {
          "$ref": "#/$defs/PersonSchema"
        }
      ]
    },
    "capacity": {
      "type": [
        "number",
        "null"
      ],
      "format": "float",
      "description": "Capacity of the demand"
    },
    "serviceLine": {
      "type": [
        "string",
        "null"
      ],
      "description": "Service Line of the demand"
    },
    "rmUserGroups": {
      "description": "User groups associated with the demand",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/RmUserGroup"
      }
    },
    "publishSettings": {
      "readOnly": true,
      "description": "Publish mode and the user groups the demand is published to. Only applicable when RM user groups are enabled.",
      "allOf": [
        {
          "$ref": "#/$defs/DemandPublishSettings"
        }
      ]
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Title of the Demand"
    },
    "userId": {
      "type": [
        "string",
        "null"
      ],
      "description": "User who created the demand"
    },
    "followers": {
      "type": [
        "array",
        "null"
      ],
      "description": "all the followers of the demand",
      "items": {
        "type": "string"
      }
    },
    "startDate": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Start date of the demand"
    },
    "demandOrgUnits": {
      "readOnly": true,
      "description": "Org units (program, project) associated with the demand",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/DemandOrgUnit"
      }
    },
    "demandId": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "Demand id"
    },
    "endDate": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "End date of the demand"
    },
    "demandStatus": {
      "type": [
        "string",
        "null"
      ],
      "description": "Status of the demand"
    },
    "numOpenings": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "The number of openings for this demand"
    },
    "calibrationConfirmedBy": {
      "type": [
        "string",
        "null"
      ],
      "description": "User who confirmed the calibration"
    },
    "resourceManager": {
      "description": "Resource Manager",
      "allOf": [
        {
          "$ref": "#/$defs/PersonSchema"
        }
      ]
    },
    "calibrationConfirmedAt": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Confirmed timestamp for the calibration"
    },
    "calibrationData": {
      "description": "calibration data of the demand",
      "allOf": [
        {
          "$ref": "#/$defs/DemandCalibrationData"
        }
      ]
    },
    "subServiceLine": {
      "type": [
        "string",
        "null"
      ],
      "description": "Sub service line of the demand"
    },
    "role": {
      "readOnly": true,
      "description": "role associated with the demand",
      "allOf": [
        {
          "$ref": "#/$defs/RoleSchema"
        }
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Detailed Description in a text format"
    }
  },
  "required": [
    "capacity",
    "demandStatus",
    "endDate",
    "startDate"
  ],
  "$defs": {
    "CalibrationTemplate": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "readOnly": true,
          "description": "id of the calibration template"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the calibration template"
        }
      }
    },
    "DemandCalibrationData": {
      "type": "object",
      "properties": {
        "flags": {
          "type": [
            "array",
            "null"
          ],
          "description": "flags",
          "items": {
            "type": "string"
          }
        },
        "skillProficiencies": {
          "writeOnly": true,
          "description": "skill proficiencies",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/SkillProficiency"
          }
        },
        "minExperience": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "min experience"
        },
        "workCategories": {
          "type": [
            "array",
            "null"
          ],
          "description": "work categories",
          "items": {
            "type": "string"
          }
        },
        "demandTitle": {
          "type": [
            "string",
            "null"
          ],
          "description": "demand title"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ],
          "description": "notes"
        },
        "numOpenings": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "number of openings"
        },
        "relocation": {
          "type": [
            "array",
            "null"
          ],
          "description": "relocation",
          "items": {
            "type": "string"
          }
        },
        "skills": {
          "type": [
            "array",
            "null"
          ],
          "description": "skills",
          "items": {
            "type": "string"
          }
        },
        "seniorities": {
          "type": [
            "array",
            "null"
          ],
          "description": "seniorities",
          "items": {
            "type": "string"
          }
        },
        "titles": {
          "type": [
            "array",
            "null"
          ],
          "description": "alternative demand titles",
          "items": {
            "type": "string"
          }
        },
        "idealResources": {
          "type": [
            "array",
            "null"
          ],
          "description": "ideal resources",
          "items": {
            "type": "string"
          }
        },
        "locations": {
          "type": [
            "array",
            "null"
          ],
          "description": "locations",
          "items": {
            "type": "string"
          }
        },
        "maxExperience": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "max experience"
        },
        "customFields": {
          "type": [
            "object",
            "null"
          ],
          "description": "custom fields"
        },
        "idealResourceUrls": {
          "type": [
            "array",
            "null"
          ],
          "description": "ideal resources url",
          "items": {
            "type": "string"
          }
        },
        "tags": {
          "description": "Tags associated with the demand",
          "type": "array",
          "items": {
            "$ref": "#/$defs/EntityTag"
          }
        }
      }
    },
    "DemandOrgUnit": {
      "type": "object",
      "properties": {
        "externalId": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "external id"
        },
        "id": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "readOnly": true,
          "description": "id"
        },
        "isArchived": {
          "type": [
            "boolean",
            "null"
          ],
          "readOnly": true,
          "description": "is archived"
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "status"
        },
        "userGroups": {
          "readOnly": true,
          "description": "User groups associated with the demand",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/RmUserGroup"
          }
        },
        "mainOwner": {
          "readOnly": true,
          "description": "main owner",
          "allOf": [
            {
              "$ref": "#/$defs/PersonSchema"
            }
          ]
        },
        "endDate": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "readOnly": true,
          "description": "end date in epoch timestamp"
        },
        "otherOwners": {
          "readOnly": true,
          "description": "other owners",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/PersonSchema"
          }
        },
        "parentExtId": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "parent external id"
        },
        "startDate": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "readOnly": true,
          "description": "start date in epoch timestamp"
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "org unit type"
        },
        "customFields": {
          "type": [
            "object",
            "null"
          ],
          "readOnly": true,
          "description": "custom fields"
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "title"
        },
        "tags": {
          "readOnly": true,
          "description": "Tags associated with the demand org unit",
          "type": "array",
          "items": {
            "$ref": "#/$defs/EntityTag"
          }
        }
      }
    },
    "DemandPublishSettings": {
      "type": "object",
      "properties": {
        "publishMode": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "Publish mode (local, custom, local_and_custom)"
        },
        "publishedToUserGroups": {
          "readOnly": true,
          "description": "User groups the demand is published to",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/RmUserGroup"
          }
        }
      }
    },
    "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"
      ]
    },
    "PersonSchema": {
      "type": "object",
      "properties": {
        "email": {
          "type": [
            "string",
            "null"
          ],
          "description": "email"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name"
        }
      },
      "required": [
        "name"
      ]
    },
    "RmUserGroup": {
      "type": "object",
      "properties": {
        "userGroupId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique identifier for the user group"
        }
      }
    },
    "RoleSchema": {
      "type": "object",
      "properties": {
        "templates": {
          "readOnly": true,
          "description": "all calibration templates associated with the role",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/CalibrationTemplate"
          }
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "name of the role"
        }
      }
    },
    "SkillGroupList": {
      "type": "object",
      "properties": {
        "proficiency": {
          "type": [
            "number",
            "null"
          ],
          "format": "float",
          "description": "group proficiency of the skill group"
        },
        "groupName": {
          "type": [
            "string",
            "null"
          ],
          "description": "name of the skill group"
        },
        "level": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "level of the role"
        },
        "skillCategory": {
          "type": [
            "string",
            "null"
          ],
          "description": "skill category of the skill group"
        }
      }
    },
    "SkillProficiency": {
      "type": "object",
      "properties": {
        "proficiency": {
          "type": [
            "number",
            "null"
          ],
          "format": "float",
          "description": "proficiency of the role"
        },
        "skillGroupList": {
          "description": "skill group list of a role",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/SkillGroupList"
          }
        },
        "level": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "level of the role"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "name of the role"
        }
      }
    }
  }
}