{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eightfold-ai/json-schema/eightfold-ai-ext-demand-data-schema-schema.json",
  "title": "ExtDemandDataSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eightfold-ai-ext-demand-api-openapi.yml#/components/schemas/ExtDemandDataSchema",
  "type": "object",
  "properties": {
    "createdAt": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "creation timestamp in epoch format"
    },
    "locationCountry": {
      "type": [
        "string",
        "null"
      ],
      "description": "location country"
    },
    "workLocationOption": {
      "type": [
        "string",
        "null"
      ],
      "description": "Indicates the option for working location e.g. onsite, remote_global, remote_local, hybrid"
    },
    "skillDetails": {
      "description": "skill details of the demand",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ATSSkillDetail"
      }
    },
    "demandManager": {
      "description": "Demand Manager",
      "allOf": [
        {
          "$ref": "#/$defs/PersonSchema"
        }
      ]
    },
    "skills": {
      "type": [
        "array",
        "null"
      ],
      "description": "skills",
      "items": {
        "type": "string"
      }
    },
    "locationCity": {
      "type": [
        "string",
        "null"
      ],
      "description": "location city"
    },
    "lastUpdated": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "last modified date time in epoch format"
    },
    "demandBand": {
      "type": [
        "string",
        "null"
      ],
      "description": "Demand Band"
    },
    "rmUserGroups": {
      "description": "User groups associated with the demand",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/RmUserGroup"
      }
    },
    "openings": {
      "description": "demand openings data",
      "allOf": [
        {
          "$ref": "#/$defs/ExtDemandOpeningsData"
        }
      ]
    },
    "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/DemandPublishSettingsSchema"
        }
      ]
    },
    "followers": {
      "description": "all the followers of the demand such as resource manager etc.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/PersonSchema"
      }
    },
    "restrictAccess": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "restrict access"
    },
    "tags": {
      "description": "Tags associated with the demand",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExtEntityTag"
      }
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "demand title"
    },
    "demandOrgUnits": {
      "description": "demand org units data",
      "allOf": [
        {
          "$ref": "#/$defs/ExtDemandOrgUnitsData"
        }
      ]
    },
    "demandId": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "readOnly": true,
      "description": "Internal demand ID"
    },
    "locationFlexibility": {
      "type": [
        "string",
        "null"
      ],
      "description": "Indicates the flexibility on location e.g. not_flexible, flexible_within_country, flexible_global"
    },
    "extDemandId": {
      "type": [
        "string",
        "null"
      ],
      "description": "demand id in the external system"
    },
    "maxExperience": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Maximum experience in years"
    },
    "customFields": {
      "type": [
        "object",
        "null"
      ],
      "description": "custom fields"
    },
    "resourceManager": {
      "description": "Resource Manager",
      "allOf": [
        {
          "$ref": "#/$defs/PersonSchema"
        }
      ]
    },
    "workflowTemplateId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Indicates which workflow this demand belongs to"
    },
    "displayDemandId": {
      "type": [
        "string",
        "null"
      ],
      "description": "display demand id"
    },
    "open": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "status of the demand: open or not"
    },
    "minExperience": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Minimum experience in years"
    },
    "requiredSkills": {
      "type": [
        "array",
        "null"
      ],
      "description": "required skills",
      "items": {
        "type": "string"
      }
    },
    "locationState": {
      "type": [
        "string",
        "null"
      ],
      "description": "location state"
    },
    "demandCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Demand Code"
    },
    "locations": {
      "type": [
        "array",
        "null"
      ],
      "description": "locations",
      "items": {
        "type": "string"
      }
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "demand description"
    }
  },
  "required": [
    "createdAt",
    "extDemandId",
    "lastUpdated",
    "open",
    "title"
  ],
  "$defs": {
    "ATSSkillDetail": {
      "type": "object",
      "properties": {
        "skillGroups": {
          "description": "Skill groups",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/ATSSkillGroup"
          }
        },
        "proficiency": {
          "type": [
            "string",
            "null"
          ],
          "description": "Proficiency. Note: proficiency must be specified only for each skill group when skill groups are present"
        },
        "evaluationTimestamp": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "Evaluation timestamp"
        },
        "dataSource": {
          "type": [
            "string",
            "null"
          ],
          "description": "Data source of the skill"
        },
        "skill": {
          "type": [
            "string",
            "null"
          ],
          "description": "Skill"
        }
      }
    },
    "ATSSkillGroup": {
      "type": "object",
      "properties": {
        "proficiency": {
          "type": [
            "string",
            "null"
          ],
          "description": "Proficiency"
        },
        "skillGroup": {
          "type": [
            "string",
            "null"
          ],
          "description": "Skill Group"
        }
      }
    },
    "DemandPublishSettingsSchema": {
      "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"
          }
        }
      }
    },
    "ExtDemandOpeningsData": {
      "type": "object",
      "properties": {
        "numOpenings": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "Number of openings"
        },
        "numOpeningsFilled": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "Number of openings filled"
        }
      },
      "required": [
        "numOpenings"
      ]
    },
    "ExtDemandOrgUnitsData": {
      "type": "object",
      "properties": {
        "programId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Program id"
        },
        "projectId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Project id"
        }
      },
      "required": [
        "projectId"
      ]
    },
    "ExtEntityTag": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "user",
            "system"
          ],
          "description": "Type of the tag (user/system)"
        },
        "name": {
          "type": "string",
          "description": "Name of the 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"
        }
      }
    }
  }
}