{
  "openapi": "3.0.1",
  "info": {
    "description": "The public APIs to create and manage custom business process configurations.",
    "version": "v1",
    "title": "Custom Business Process Config"
  },
  "tags": [
    {
      "name": "Types",
      "description": "A collection of custom business process types defined in Workday."
    },
    {
      "name": "Event Task Definitions",
      "description": "A collection of Event Task Definitions for custom business process defined in Workday."
    }
  ],
  "paths": {
    "/types": {
      "post": {
        "tags": [
          "Types"
        ],
        "description": "Creates a new custom business process type, including initiating actions.",
        "operationId": "create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createCustomBusinessProcessTypeDetail"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Creates a new custom business process type instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customBusinessProcessTypeDetail"
                }
              }
            }
          },
          "400": {
            "description": "Possible Validations:\n\n- The name for custom business process type is required and must be unique across all custom business process types.\n\n- The name for initiating actions is required and must be unique within a custom business process type.\n\n- The referenceIdValue must be unique across all custom business process types.\n\n- The referenceIdValue for initiatingActions must be unique across all initiating actions.\n\n- Custom object is not valid for target business object.\n\n- You are not allowed to set more than one initiating allowed action as default.\n\n- The Custom Task cannot be used by more than one initiating allowed action.\n\n- The Event Task Definition is required for the Event Action Task Configuration\n\n- The Event Action is required for the Event Action Task Configuration\n"
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      },
      "get": {
        "tags": [
          "Types"
        ],
        "description": "Returns summary of all custom business process types",
        "operationId": "get",
        "responses": {
          "200": {
            "description": "Returns summary of all custom business process types",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/allCustomBusinessProcessTypeDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      }
    },
    "/types/{id}": {
      "get": {
        "tags": [
          "Types"
        ],
        "description": "Returns a custom business process type",
        "operationId": "view",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Workday Id of the custom business process type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a custom business process type for the Id supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customBusinessProcessTypeDetail"
                }
              }
            }
          },
          "404": {
            "description": "Not Found."
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Types"
        ],
        "description": "Updates a custom business process type",
        "operationId": "update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Workday Id of the custom business process type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/editCustomBusinessProcessTypeDetail"
              }
            }
          },
          "description": "Custom business process type data to be updated.",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updates a custom business process type for the Id supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customBusinessProcessTypeDetail"
                }
              }
            }
          },
          "400": {
            "description": "Possible Validations:\n\n-The referenceIdValue must be unique across all custom business process types.\n\n-The name for custom business process type must be unique across all custom business process types.\n\n-Custom object is not valid for target business object.\n\n-Changes to the custom object are not allowed once an event exists for this custom business process.\n\n-Changes to the business object are not allowed once an event exists for this custom business process.\n\n-Changes to the Name are not allowed once an event exists for this custom business process.\n\n-Changes to the ID are not allowed once an event exists for this custom business process.\n"
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Types"
        ],
        "description": "Deletes a custom business process type",
        "operationId": "delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Workday Id of the custom business process type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deletes a custom business process type for the Id supplied"
          },
          "400": {
            "description": "Possible Validations:\n- The custom business process type cannot be deleted because it has references.\n- You cannot delete a custom business process type that has been used by a business process event."
          },
          "404": {
            "description": "Not Found."
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      }
    },
    "/eventTaskDefinitions": {
      "post": {
        "tags": [
          "Event Task Definitions"
        ],
        "description": "Creates a new event task definition.",
        "operationId": "createEventTaskDefinition",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createCustomBusinessProcessEventTaskDetail"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Creates a new custom event task definition instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customBusinessProcessEventTaskDetail"
                }
              }
            }
          },
          "400": {
            "description": "Poossible Validations:\n\n-The name for event task definition is required and must be unique across all event task definitions.\n\n-VPS application is a required field.\n\n-VPS site is a required field.\n\n-The referenceIdValue must be unique across all VPS definitions.\n"
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      },
      "get": {
        "tags": [
          "Event Task Definitions"
        ],
        "description": "Returns summary of all event task definitions",
        "operationId": "getEventTaskDefinition",
        "responses": {
          "200": {
            "description": "Returns summary of all event task definitions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/allCustomBusinessProcessEventTaskDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      }
    },
    "/eventTaskDefinitions/{id}": {
      "get": {
        "tags": [
          "Event Task Definitions"
        ],
        "description": "Returns a event task definition",
        "operationId": "viewEventTaskDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Workday Id of the event task definition",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a event task definition for the Id supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customBusinessProcessEventTaskDetail"
                }
              }
            }
          },
          "404": {
            "description": "Not Found."
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Event Task Definitions"
        ],
        "description": "Updates a event task definition.",
        "operationId": "updateEventTaskDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Workday Id of the event task definition",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/editCustomBusinessProcessEventTaskDetail"
              }
            }
          },
          "description": "Event task definition data to be updated.",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updates a event task definition for the Id supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customBusinessProcessEventTaskDetail"
                }
              }
            }
          },
          "400": {
            "description": "Possible Validations:\n\n-The name for event task definition is required and must be unique across all event task definitions.\n\n-VPS application is a required field.\n\n-VPS site is a required field.\n\n-The referenceIdValue must be unique across all event task definitions.\n"
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Event Task Definitions"
        ],
        "description": "Updates a event task definition.",
        "operationId": "patchEventTaskDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Workday Id of the event task definition",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/patchCustomBusinessProcessEventTaskDetail"
              }
            }
          },
          "description": "Event task definition data to be updated.",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updates a event task definition for the Id supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/customBusinessProcessEventTaskDetail"
                }
              }
            }
          },
          "400": {
            "description": "Possible Validations:\n\n-The name for event task definition is required and must be unique across all event task definitions.\n\n-VPS application is a required field.\n\n-VPS site is a required field.\n\n-The referenceIdValue must be unique across all event task definitions.\n"
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Event Task Definitions"
        ],
        "description": "Deletes a event task definition",
        "operationId": "deleteEventTaskDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The Workday Id of the event task definition",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deletes a event task definition for the Id supplied"
          },
          "400": {
            "description": "The event task definition cannot be deleted because it has references."
          },
          "404": {
            "description": "Not Found."
          }
        },
        "security": [
          {
            "oAuth2": [
              "write",
              "read"
            ]
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.workday.com/customBusinessProcessConfig/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "oAuth2": {
        "type": "oauth2",
        "description": "Register an API Client",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://auth.api.workday.com/v1/authorize",
            "scopes": {
              "write": "modify custom business process types",
              "read": "read custom business process types"
            }
          }
        }
      }
    },
    "schemas": {
      "allCustomBusinessProcessTypeDetails": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/customBusinessProcessTypeDetail"
            }
          }
        }
      },
      "customBusinessProcessTypeDetail": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "Custom_Business_Process_Type_ID": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean"
          },
          "referenceIdValue": {
            "type": "string"
          },
          "eventActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/eventActionWithID"
            }
          },
          "eventActionTaskConfig": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/eventActionEventTaskConfigResponse"
            }
          },
          "initiatingActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/initiatingActionDetailResponse"
            }
          },
          "stepActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/stepActionDetailResponse"
            }
          },
          "customObjectDefinition": {
            "$ref": "#/components/schemas/instanceWithIdAndDescriptor"
          },
          "targetBusinessObject": {
            "$ref": "#/components/schemas/instanceWithIdAndDescriptor"
          }
        }
      },
      "createCustomBusinessProcessTypeDetail": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "referenceIdValue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean"
          },
          "eventActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/instanceWithId"
            }
          },
          "eventActionTaskConfig": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/eventActionEventTaskConfigRequest"
            }
          },
          "initiatingActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/initiatingActionDetailRequest"
            }
          },
          "stepActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/stepActionDetailRequest"
            }
          },
          "customObjectDefinition": {
            "$ref": "#/components/schemas/instanceWithId"
          },
          "targetBusinessObject": {
            "$ref": "#/components/schemas/instanceWithId"
          }
        }
      },
      "eventActionEventTaskConfigResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "eventAction": {
            "$ref": "#/components/schemas/eventActionWithID"
          },
          "eventTaskDefinition": {
            "$ref": "#/components/schemas/instanceWithIdAndDescriptor"
          }
        }
      },
      "eventActionEventTaskConfigRequest": {
        "type": "object",
        "required": [
          "eventAction",
          "eventTaskDefinition"
        ],
        "properties": {
          "eventAction": {
            "$ref": "#/components/schemas/instanceWithId"
          },
          "eventTaskDefinition": {
            "$ref": "#/components/schemas/instanceWithId"
          }
        }
      },
      "eventActionWithID": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "descriptor": {
            "type": "string"
          },
          "Event_Action_Type_ID": {
            "type": "string"
          }
        }
      },
      "editCustomBusinessProcessTypeDetail": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "referenceIdValue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean"
          },
          "customObjectDefinition": {
            "$ref": "#/components/schemas/instanceWithId"
          },
          "targetBusinessObject": {
            "$ref": "#/components/schemas/instanceWithId"
          }
        }
      },
      "initiatingActionDetailResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "Initiating_Action_ID": {
            "type": "string"
          },
          "referenceIdValue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean"
          },
          "default": {
            "type": "boolean"
          },
          "customTask": {
            "$ref": "#/components/schemas/instanceWithIdAndDescriptor"
          }
        }
      },
      "initiatingActionDetailRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "referenceIdValue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean"
          },
          "default": {
            "type": "boolean"
          },
          "customTask": {
            "$ref": "#/components/schemas/instanceWithId"
          }
        }
      },
      "stepActionDetailResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "Step_Action_ID": {
            "type": "string"
          },
          "referenceIdValue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean"
          },
          "eventTaskDefinition": {
            "$ref": "#/components/schemas/instanceWithIdAndDescriptor"
          }
        }
      },
      "stepActionDetailRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "referenceIdValue": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean"
          },
          "eventTaskDefinition": {
            "$ref": "#/components/schemas/instanceWithId"
          }
        }
      },
      "instanceWithId": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "instanceWithIdAndDescriptor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "descriptor": {
            "type": "string"
          }
        }
      },
      "createCustomBusinessProcessEventTaskDetail": {
        "type": "object",
        "required": [
          "vpsApplication",
          "name",
          "vpsSite"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "vpsApplication": {
            "type": "string"
          },
          "vpsSite": {
            "type": "string"
          },
          "vpsRoute": {
            "type": "string"
          },
          "referenceIdValue": {
            "type": "string"
          }
        }
      },
      "editCustomBusinessProcessEventTaskDetail": {
        "type": "object",
        "required": [
          "vpsApplication",
          "name",
          "vpsSite"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "vpsApplication": {
            "type": "string"
          },
          "vpsSite": {
            "type": "string"
          },
          "vpsRoute": {
            "type": "string"
          },
          "referenceIdValue": {
            "type": "string"
          }
        }
      },
      "patchCustomBusinessProcessEventTaskDetail": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "vpsApplication": {
            "type": "string"
          },
          "vpsSite": {
            "type": "string"
          },
          "vpsRoute": {
            "type": "string"
          },
          "referenceIdValue": {
            "type": "string"
          }
        }
      },
      "customBusinessProcessEventTaskDetail": {
        "type": "object",
        "required": [
          "vpsApplication",
          "name",
          "vpsSite"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "Event_Task_Definition_ID": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "referenceIdValue": {
            "type": "string"
          },
          "vpsApplication": {
            "type": "string"
          },
          "vpsSite": {
            "type": "string"
          },
          "vpsRoute": {
            "type": "string"
          }
        }
      },
      "allCustomBusinessProcessEventTaskDetails": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/customBusinessProcessEventTaskDetail"
            }
          }
        }
      }
    }
  }
}