{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/autodesk/json-schema/autodesk-command-payload-schema.json",
  "title": "CommandPayload",
  "description": "Command Payload",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/autodesk-commands-api-openapi.yml#/components/schemas/CommandPayload",
  "type": "object",
  "properties": {
    "jsonapi": {
      "$ref": "#/$defs/JsonApiVersion"
    },
    "data": {
      "oneOf": [
        {
          "$ref": "#/$defs/CheckPermissionPayload"
        },
        {
          "$ref": "#/$defs/PublishModelPayload"
        },
        {
          "$ref": "#/$defs/PublishWithoutLinksPayload"
        },
        {
          "$ref": "#/$defs/PublishModelJobPayload"
        },
        {
          "$ref": "#/$defs/ListRefsPayload"
        },
        {
          "$ref": "#/$defs/ListItemsPayload"
        }
      ],
      "description": "Pick one of the following data objects to capture the input data for the command you want to execute."
    }
  },
  "$defs": {
    "CheckPermissionPayload": {
      "type": "object",
      "title": "CheckPermission Command",
      "description": "An object that contains the input data required to execute the CheckPermission command.\n\nThe CheckPermission command checks if a user has permission to perform specified actions on specified resources.\nThe user’s identity is derived from the ``x-user-id`` header (in a 2-Legged call), or from the access token (in a 3-Legged call). \n\nSee the [Developer's Guide topic on the CheckPermission command](/en/docs/data/v2/developers_guide/commands/checkpermission/) for more information.\n",
      "required": [
        "type",
        "attributes"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/TypeCommands"
        },
        "attributes": {
          "type": "object",
          "description": "A container of the inputs for the command.",
          "required": [
            "extension"
          ],
          "properties": {
            "extension": {
              "type": "object",
              "description": "An object that contains properties\nspecific to the CheckPermission command,\nextending the default properties of a command.",
              "required": [
                "type",
                "version"
              ],
              "properties": {
                "type": {
                  "$ref": "#/$defs/TypeCommandTypeCheckPermission"
                },
                "version": {
                  "type": "string",
                  "description": "The version of the command."
                },
                "data": {
                  "type": "object",
                  "description": "Contains the properties specific to the\nCheckPermission command.",
                  "properties": {
                    "requiredActions": {
                      "type": "array",
                      "description": "An array of keywords where each keyword\nis an action that permission must be checked\nfor. Possible values:\n\n- ``read`` - Download and view specified resource.\n- ``view`` - View specified resource without downloading.\n- ``download`` - Download and view specified resource.\n- ``collaborate`` - Add comments for the specified resource.\n- ``write`` - Write to the specified resource.\n- ``upload`` - Upload to the specified resource.\n- ``updateMetaData`` - Update metadata of the specified resource.\n- ``create`` - Write and upload to the specified resource.\n- ``delete`` - Delete the specified resource.\n- ``admin`` - Perform administrative operations on specified resource.\n- ``share``- Share the specified resource.",
                      "items": {
                        "type": "string",
                        "enum": [
                          "read",
                          "view",
                          "download",
                          "collaborate",
                          "write",
                          "upload",
                          "updateMetaData",
                          "create",
                          "delete",
                          "admin",
                          "share"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "relationships": {
          "type": "object",
          "description": "Contains a list of resources required for execution of the command.",
          "required": [
            "resources"
          ],
          "properties": {
            "resources": {
              "type": "object",
              "description": "Contains the list of resources\nthat permission must be checked for.",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "type": "array",
                  "description": "An array of objects, where each object\nrepresents a resource.",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "$ref": "#/$defs/TypeEntity"
                      },
                      "id": {
                        "type": "string",
                        "description": "The URN of the resource to check."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "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"
      ]
    },
    "ListItemsPayload": {
      "type": "object",
      "description": "An object that contains the input data required to execute the ListItems command.\n\nThe ListItems command retrieves metadata for up to 50 specified items. For example, an item name, or the date it was created. It also returns the tip (latest) version of the items.",
      "title": "ListItems Command",
      "required": [
        "type",
        "attributes"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/TypeCommands"
        },
        "attributes": {
          "type": "object",
          "description": "A container of the inputs for the command.",
          "required": [
            "extension"
          ],
          "properties": {
            "extension": {
              "type": "object",
              "description": "An object that contains properties\nspecific to the ListItems command,\nextending the default properties of a command.",
              "required": [
                "type",
                "version"
              ],
              "properties": {
                "type": {
                  "$ref": "#/$defs/TypeCommandTypeListItems"
                },
                "version": {
                  "type": "string",
                  "description": "The version of the command."
                },
                "data": {
                  "type": "object",
                  "description": "Contains the custom properties specific to the\nListItems command.",
                  "properties": {
                    "includePathInProject": {
                      "type": "boolean",
                      "description": "Specify whether to return the\n``pathInProject`` attribute in response\nfor BIM 360 Docs projects.\n``pathInProject`` is the path to\nthe item relative to the project’s root folder.\n\n- ``true``: Response will contain the ``pathInProject`` attribute for BIM 360 Docs projects.\n- ``false``: (Default) response will not contain the ``pathInProject`` attribute for BIM 360 Docs projects.\n\nSetting this parameter to ``true`` on a\nnon-BIM 360 Docs project results in an error."
                    }
                  }
                }
              }
            }
          }
        },
        "relationships": {
          "type": "object",
          "description": "Contains a list of resources required for execution of the command.",
          "required": [
            "resources"
          ],
          "properties": {
            "resources": {
              "type": "object",
              "description": "Contains the list of items\nto check. The list can contain up to\n50 versions.",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "type": "array",
                  "description": "An array of objects, where each object\nrepresents an item to check.",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "$ref": "#/$defs/TypeItem"
                      },
                      "id": {
                        "type": "string",
                        "description": "The URN of the item to check. Use the\n[Get an Item](/en/docs/data/v2/reference/http/projects-project_id-items-item_id-GET/)\noperation to verify the URN."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "ListRefsPayload": {
      "type": "object",
      "title": "ListRefs Command",
      "description": "An object that contains the input data required to execute the ListRefs command.\n\nThe ListRefs command retrieves the custom relationships between specified versions of items and other resources in the data domain service (folders, items, and versions). You can retrieve the relationships of up to 50 versions.",
      "required": [
        "type",
        "attributes"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/TypeCommands"
        },
        "attributes": {
          "type": "object",
          "description": "A container of the inputs for the command.",
          "required": [
            "extension"
          ],
          "properties": {
            "extension": {
              "type": "object",
              "description": "An object that contains properties\nspecific to the ListRefs command,\nextending the default properties of a command.",
              "required": [
                "type",
                "version"
              ],
              "properties": {
                "type": {
                  "$ref": "#/$defs/TypeCommandTypeListRefs"
                },
                "version": {
                  "type": "string",
                  "description": "The version of the command."
                }
              }
            }
          }
        },
        "relationships": {
          "type": "object",
          "description": "Contains a list of resources required for execution of the command.",
          "required": [
            "resources"
          ],
          "properties": {
            "resources": {
              "type": "object",
              "description": "Contains the list of versions\nto check. The list can contain up to\n50 versions.",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "type": "array",
                  "description": "An array of objects, where each object\nrepresents a version to check.",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "$ref": "#/$defs/TypeVersion"
                      },
                      "id": {
                        "type": "string",
                        "description": "The URN of the version to check. Use the\n[List all Versions of an Item](/en/docs/data/v2/reference/http/projects-project_id-items-item_id-versions-GET/)\noperation to verify the URN."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "PublishModelJobPayload": {
      "type": "object",
      "description": "An object that contains the input data required to execute the GetPublishModelJob command.\n\nThe GetPublishModelJob command verifies whether a Collaboration for Revit (C4R) model needs to be published to BIM 360 Docs. For more information, see the [GetPublishModelJob topic in the overview section](/en/docs/data/v2/developers_guide/commands/getpublishmodeljob).",
      "title": "GetPublishModelJob Command",
      "required": [
        "type",
        "attributes",
        "relationships"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/TypeCommands"
        },
        "attributes": {
          "type": "object",
          "description": "A container of the inputs for the command.",
          "required": [
            "extension"
          ],
          "properties": {
            "extension": {
              "type": "object",
              "description": "An object that contains properties\nspecific to the GetPublishModelJob command,\nextending the default properties of a command.",
              "required": [
                "type",
                "version"
              ],
              "properties": {
                "type": {
                  "$ref": "#/$defs/TypeCommandTypeGetPublishModelJob"
                },
                "version": {
                  "type": "string",
                  "description": "The version of the schema. Must be ``1.0.0``\nfor the GetPublishModelJob command."
                }
              }
            }
          }
        },
        "relationships": {
          "type": "object",
          "description": "Contains a list of resources required for execution of the command.",
          "required": [
            "resources"
          ],
          "properties": {
            "resources": {
              "type": "object",
              "description": "Contains the list of items to check.",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "type": "array",
                  "description": "An array of objects, where each object\nrepresents an item to check.",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "$ref": "#/$defs/TypeItem"
                      },
                      "id": {
                        "type": "string",
                        "description": "The URN of the item to check. Use the\n[Get an Item](/en/docs/data/v2/reference/http/projects-project_id-items-item_id-GET/)\noperation to verify the URN."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "PublishModelPayload": {
      "type": "object",
      "description": "An object that contains the input required to execute the PublishModel command.\n\nThe PublishModel Command publishes the latest version of a Collaboration for Revit (C4R) model to BIM 360 Docs.  See the [Developer's Guide topic on the PublishModel command](/en/docs/data/v2/developers_guide/commands/publishmodel/) for more information.\n",
      "title": "PublishModel Command",
      "required": [
        "type",
        "attributes"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/TypeCommands"
        },
        "attributes": {
          "type": "object",
          "description": "A container of the inputs for the command.",
          "required": [
            "extension"
          ],
          "properties": {
            "extension": {
              "type": "object",
              "description": "An object that contains properties\nspecific to the PublishModel command,\nextending the default properties of a command.",
              "required": [
                "type",
                "version"
              ],
              "properties": {
                "type": {
                  "$ref": "#/$defs/TypeCommandTypePublishModel"
                },
                "version": {
                  "type": "string",
                  "description": "The version of the schema. Must be ``1.0.0``\nfor the PublishModel command."
                }
              }
            }
          }
        },
        "relationships": {
          "type": "object",
          "description": "Contains a list of resources required for execution of the command.",
          "required": [
            "resources"
          ],
          "properties": {
            "resources": {
              "type": "object",
              "description": "Contains the list of resources to be published.",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "type": "array",
                  "description": "An array of objects where each object\nrepresents a resource that must be\npublished.",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "$ref": "#/$defs/TypeItem"
                      },
                      "id": {
                        "type": "string",
                        "description": "The URN of the resource. For information about\nfinding the URN, see the initial steps\nof the\n[Publish a C4R Model to BIM 360 Docs](/en/docs/data/v2/tutorials/publish-model/)\ntutorial."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "PublishWithoutLinksPayload": {
      "type": "object",
      "description": "An object that contains the input data to execute the PublishWithoutLinks command.\n\nThe PublishWithoutLinks command publishes the latest version of a Collaboration for Revit (C4R) model without the links it contains to BIM 360 Docs. See the [Developer's Guide topic on the PublishWithoutLinks command](/en/docs/data/v2/developers_guide/commands/publishwithoutlinks/) for more information.\n",
      "title": "PublishWithoutLinks Command",
      "required": [
        "type",
        "attributes"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/TypeCommands"
        },
        "attributes": {
          "type": "object",
          "description": "A container of the inputs for the command.",
          "required": [
            "extension"
          ],
          "properties": {
            "extension": {
              "type": "object",
              "description": "An object that contains properties\nspecific to the PublishWithoutLinks command,\nextending the default properties of a command.",
              "required": [
                "type",
                "version"
              ],
              "properties": {
                "type": {
                  "$ref": "#/$defs/TypeCommandTypePublishWithoutLinks"
                },
                "version": {
                  "type": "string",
                  "description": "The version of the schema. Must be ``1.0.0``\nfor the PublishWithoutLinks command."
                }
              }
            }
          }
        },
        "relationships": {
          "type": "object",
          "description": "Contains a list of resources required for execution of the command.",
          "required": [
            "resources"
          ],
          "properties": {
            "resources": {
              "type": "object",
              "description": "Contains the list of resources to be published.",
              "required": [
                "data"
              ],
              "properties": {
                "data": {
                  "type": "array",
                  "description": "An array of objects where each object\nrepresents a resource that must be\npublished.",
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "$ref": "#/$defs/TypeItem"
                      },
                      "id": {
                        "type": "string",
                        "description": "The URN of the resource. For information about\nfinding the URN, see the initial steps\nof the\n[Publish a C4R Model to BIM 360 Docs](/en/docs/data/v2/tutorials/publish-model/)\ntutorial."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "TypeCommandTypeCheckPermission": {
      "type": "string",
      "enum": [
        "commands:autodesk.core:CheckPermission"
      ],
      "description": "The Type ID of the schema used for extending properties. Must be ``commands:autodesk.core:CheckPermission`` for the CheckPermission command.",
      "title": ""
    },
    "TypeCommandTypeGetPublishModelJob": {
      "type": "string",
      "enum": [
        "commands:autodesk.bim360:C4RModelGetPublishJob"
      ],
      "description": "The Type ID of the schema used for extending properties. Must be ``commands:autodesk.bim360:C4RModelGetPublishJob`` for the GetPublishModelJob command.",
      "title": ""
    },
    "TypeCommandTypeListItems": {
      "type": "string",
      "enum": [
        "commands:autodesk.core:ListItems"
      ],
      "description": "The Type ID of the schema used for extending properties. Must be ``commands:autodesk.core:ListItems`` for the ListItems command.",
      "title": ""
    },
    "TypeCommandTypeListRefs": {
      "type": "string",
      "enum": [
        "commands:autodesk.core:ListRefs"
      ],
      "description": "The Type ID of the schema used for extending properties. Must be ``commands:autodesk.core:ListRefs`` for the ListRefs command.",
      "title": ""
    },
    "TypeCommandTypePublishModel": {
      "type": "string",
      "enum": [
        "commands:autodesk.bim360:C4RModelPublish"
      ],
      "description": "The Type ID of the schema used for extending properties. Must be ``commands:autodesk.bim360:C4RModelPublish`` for the PublishModel command.",
      "title": ""
    },
    "TypeCommandTypePublishWithoutLinks": {
      "type": "string",
      "enum": [
        "commands:autodesk.bim360:C4RPublishWithoutLinks"
      ],
      "description": "The Type ID of the schema used for extending properties. Must be ``commands:autodesk.bim360:C4RPublishWithoutLinks`` for the PublishWithoutLinks command.",
      "title": ""
    },
    "TypeCommands": {
      "type": "string",
      "enum": [
        "commands"
      ],
      "description": "The type of this resource. Possible values are ``commands``.",
      "title": ""
    },
    "TypeEntity": {
      "type": "string",
      "enum": [
        "folders",
        "items",
        "versions"
      ],
      "description": "The type of the resource. Possible values are ``folders``, ``items``, ``versions``."
    },
    "TypeItem": {
      "type": "string",
      "enum": [
        "items"
      ],
      "description": "The type of the resource. Possible values are ``items``."
    },
    "TypeVersion": {
      "type": "string",
      "enum": [
        "versions"
      ],
      "description": "The type of the resource. Possible values are ``versions``."
    }
  }
}