{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/autodesk/json-schema/autodesk-version-payload-schema.json",
  "title": "VersionPayload",
  "description": "Describe the version to be created.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/autodesk-aps-data-management-openapi.yml#/components/schemas/VersionPayload",
  "type": "object",
  "properties": {
    "jsonapi": {
      "$ref": "#/$defs/JsonApiVersion"
    },
    "data": {
      "type": "object",
      "description": "The data that describes the version to be created.",
      "required": [
        "type",
        "attributes",
        "relationships"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/TypeVersion"
        },
        "attributes": {
          "type": "object",
          "description": "The properties of the version to be created.",
          "required": [
            "name",
            "extension"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "The file name to be used when synced to local disk (1-255 characters). \n\nAvoid using the following reserved characters in the name: ``<``, ``>``, ``:``, ``\"``, ``/``, ``\\``, ``|``, ``?``, ``*``, `, ``\\n``, ``\\r``, ``\\t``, ``\\0``, ``\\f``, ``¢``, ``™``, ``$``, ``®``.\n\nIf you are creating the new version by copying an existing version of another item, the system uses the name of the source by default. However, if you specify a name, it will override the default name.",
              "minLength": 1
            },
            "extension": {
              "type": "object",
              "description": "A container of additional properties that extends the default properties of the version to be created.",
              "required": [
                "type",
                "version"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The Type ID of the schema that defines the structure of the ``extension.data`` object."
                },
                "version": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The version of the schema that applies to the ``extension.data`` object."
                },
                "data": {
                  "type": "object",
                  "description": "The container of additional properties.\n\nThe additional properties must follow the schema specified by ``extensions.type`` and ``extensions.version``. Properties that don't follow the schema will be ignored.\n"
                }
              }
            },
            "displayName": {
              "type": "string",
              "description": "Reserved for future use. Use ``data.attributes.name`` for the name."
            }
          }
        },
        "relationships": {
          "type": "object",
          "description": "A container of links to resources that are related to the version to be created.",
          "required": [
            "item"
          ],
          "properties": {
            "item": {
              "type": "object",
              "description": "Contains information about the item this is a version of.",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "type": "object",
                  "description": "A container of data on the item.",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "$ref": "#/$defs/TypeItem"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "description": "The ID that uniquely identifies the item."
                    }
                  }
                }
              }
            },
            "storage": {
              "type": "object",
              "description": "Contains the information about the storage location that contains the binary data of this version.",
              "properties": {
                "data": {
                  "type": "object",
                  "description": "A container of data on the storage location.",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "$ref": "#/$defs/TypeObject"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "description": "The ID that uniquely identifies the storage location."
                    }
                  }
                }
              },
              "required": [
                "data"
              ]
            },
            "refs": {
              "type": "object",
              "description": "Information on other resources that will share a custom relationship with the version being created.",
              "properties": {
                "data": {
                  "type": "array",
                  "description": "An array of object, where each object represents a reference.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "$ref": "#/$defs/TypeVersion"
                      },
                      "id": {
                        "type": "string",
                        "description": "The URN (Version ID) of the referenced version."
                      },
                      "meta": {
                        "type": "object",
                        "description": "Contains meta information about the reference.",
                        "required": [
                          "refType",
                          "direction",
                          "extension"
                        ],
                        "properties": {
                          "refType": {
                            "$ref": "#/$defs/RefTypesXref"
                          },
                          "direction": {
                            "$ref": "#/$defs/MetaRefsDirection"
                          },
                          "extension": {
                            "type": "object",
                            "description": "Contains additional properties that extend the default properties of the relationship.",
                            "properties": {
                              "type": {
                                "$ref": "#/$defs/ExtensionTypeCoreXref"
                              },
                              "version": {
                                "type": "string",
                                "description": "The version of the xref type. Currently must be ``1.1.0``."
                              },
                              "data": {
                                "type": "object",
                                "properties": {
                                  "nestedType": {
                                    "$ref": "#/$defs/NestedXref"
                                  }
                                },
                                "required": [
                                  "nestedType"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "required": [
                      "type",
                      "id",
                      "meta"
                    ]
                  }
                }
              },
              "required": [
                "data"
              ]
            }
          }
        }
      }
    },
    "meta": {
      "$ref": "#/$defs/MetaForWebhooks"
    }
  },
  "required": [
    "jsonapi",
    "data"
  ],
  "$defs": {
    "JsonApiVersion": {
      "title": "json_api_version",
      "type": "object",
      "description": "The JSON API object.",
      "properties": {
        "version": {
          "$ref": "#/$defs/JsonApiVersionValue"
        }
      },
      "required": [
        "version"
      ]
    },
    "JsonApiVersionValue": {
      "description": "The version of JSON API. Will always be ``1.0``.",
      "type": "string",
      "enum": [
        "1.0"
      ]
    },
    "MetaForWebhooks": {
      "title": "metaForWebhooks",
      "type": "object",
      "description": "Meta information required for webhooks.",
      "properties": {
        "workflow": {
          "type": "string",
          "description": "The Workflow ID of a webhook that listens to Model Derivative events. It needs to be no more than 36 chars, and only ASCII, decimal and hyphen are accepted.\nSee the [Creating a Webhook and Listening to Events](/en/docs/webhooks/v1/tutorials/create-a-hook-model-derivative) tutorial for more information.\n\n**Note**: This attribute applies to BIM 360 Docs only.\n"
        },
        "workflowAttribute": {
          "type": "object",
          "description": "A user defined JSON object containing custom workflow information for the specified webhook event. Must be less than 1KB.\n\n**Note**: Applicable only if a valid value has been specified for ``meta.workflow``.\n"
        }
      },
      "required": [
        "workflow"
      ]
    },
    "TypeItem": {
      "type": "string",
      "enum": [
        "items"
      ],
      "description": "The type of the resource. Possible values are ``items``."
    },
    "TypeObject": {
      "type": "string",
      "enum": [
        "objects"
      ],
      "description": "The type of this resource. Possible values are ``objects``."
    },
    "TypeVersion": {
      "type": "string",
      "enum": [
        "versions"
      ],
      "description": "The type of the resource. Possible values are ``versions``."
    }
  }
}