{
  "openapi": "3.0.1",
  "info": {
    "title": "Approval Type Management",
    "version": "9.1.20.0",
    "description": "Create and administer approval type resources.",
    "x-introduced": "9.1.0.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Approval Types",
      "description": "Provide RESTful services to manage approval type resources."
    }
  ],
  "paths": {
    "/approval-types": {
      "get": {
        "tags": [
          "Approval Types"
        ],
        "summary": "Get a collection approval types.",
        "description": "Get a collection of approval types.",
        "operationId": "getApprovalTypes",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "The comma-separated set of properties that control the order of the listed items. Properties can be prefixed by either (-) to sort in descending order, or (+) to sort in ascending order. By default, properties are sorted in ascending order. For example, sort=name,-description will order the items first based on the name value in ascending order, and then by their description value in descending order.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "searchString",
            "in": "query",
            "description": "Limits search results to only include approval types with a description that matches the value of this parameter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalTypeCollection"
                },
                "example": {
                  "offset": "0,",
                  "count": "16,",
                  "Limit": "16,",
                  "items": [
                    {
                      "name": "RFQResponseApprovalGroup",
                      "role": "Sales Manager",
                      "description": "RFQ Response Approvals",
                      "id": "10001"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      }
    },
    "/approval-types/{id}": {
      "get": {
        "tags": [
          "Approval Types"
        ],
        "summary": "Get an approval type by ID.",
        "description": "Get an approval type by ID.",
        "operationId": "getApprovalTypeById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the approval type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalType"
                },
                "example": {
                  "role": "Seller Administrator,Site Administrator,Channel Manager",
                  "name": "-21001ResellerRegistrationApprovalGroup",
                  "description": "Reseller Registration Approval - SapphirePlus ()",
                  "id": "13001"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      }
    },
    "/approval-type-assignments": {
      "get": {
        "tags": [
          "Approval Types"
        ],
        "summary": "Gets a collection of approval type assignments.",
        "description": "Gets a collection of approval type assignments.",
        "operationId": "getApprovalTypeAssignments",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "description": "Limits results to only include approval type assignments with the specified organization ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approvalTypeId",
            "in": "query",
            "description": "Limits results to only include approval type assignments with the specified approval type ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalTypeAssignmentCollection"
                },
                "example": {
                  "offset": 0,
                  "count": 1,
                  "limit": 1,
                  "items": [
                    {
                      "organizationId": "-2000",
                      "approvalTypeId": "10008"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Approval Types"
        ],
        "summary": "Create an approval type assignment.",
        "description": "Create an approval type assignment.",
        "operationId": "createApprovalTypeAssignment",
        "requestBody": {
          "description": "Request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalTypeAssignment"
              },
              "example": {
                "organizationId": "-2001",
                "approvalTypeId": "11501"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The requested resource has been created.",
            "headers": {
              "Location": {
                "description": "The URI of the Approval Type.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "links": {
              "GetApprovalTypeAssignmentsByOrganizationIdApprovalTypeId": {
                "operationRef": "#/paths/~1/approval-type-assignments~1organizationId:{organizationId},approvalTypeId:{approvalTypeId}/get",
                "parameters": {
                  "organizationId": "$request.body#/organizationId",
                  "approvalTypeId": "$request.body#/approvalTypeId"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `GET /approval-type-assignments/organizationId:{organizationId},approvalTypeId:{approvalTypeId}`.\n"
              },
              "DeleteApprovalTypeAssignmentsByOrganizationIdApprovalTypeId": {
                "operationRef": "#/paths/~1/approval-type-assignments~1organizationId:{organizationId},approvalTypeId:{approvalTypeId}/delete",
                "parameters": {
                  "organizationId": "$request.body#/organizationId",
                  "approvalTypeId": "$request.body#/approvalTypeId"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `DELETE /approval-type-assignments/organizationId:{organizationId},approvalTypeId:{approvalTypeId}`.\n"
              }
            },
            "content": {}
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/approval-type-assignments/organizationId:{organizationId},approvalTypeId:{approvalTypeId}": {
      "get": {
        "tags": [
          "Approval Types"
        ],
        "summary": "Get an approval type assignment by ID.",
        "description": "Get an approval type assignment by ID.",
        "operationId": "getApprovalTypeAssignmentsById",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "The unique numeric ID of the organization to which the approval type is assigned.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approvalTypeId",
            "in": "path",
            "description": "The unique numeric ID of the approval type that is assigned to the organization.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalTypeAssignment"
                },
                "example": {
                  "organizationId": "-2001",
                  "approvalTypeId": "11501"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Approval Types"
        ],
        "summary": "Delete an approval type assignment.",
        "description": "Delete an approval type assignment.",
        "operationId": "deleteApprovalTypeAssignment",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "description": "The unique numeric ID of the organization to which the approval type is assigned.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "approvalTypeId",
            "in": "path",
            "description": "The unique numeric ID of the approval type that is assigned to the organization.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The requested resource has been deleted.",
            "content": {}
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponseContainer": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "requestId": {
            "type": "string",
            "description": "The request identifier."
          }
        },
        "description": "The error message model."
      },
      "Error": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string",
            "description": "The error message code."
          },
          "errorMessage": {
            "type": "string",
            "description": "The error message."
          },
          "errorKey": {
            "type": "string",
            "description": "The error message key."
          },
          "errorParameters": {
            "type": "array",
            "description": "The arguments used to construct the error message.",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "errorLevel": {
            "type": "string",
            "description": "The error level."
          },
          "errorHref": {
            "type": "string",
            "description": "The error hypertext reference."
          }
        },
        "description": "The error message item model."
      },
      "ApprovalType": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "A comma separated list of role names that are associated with this approval type."
          },
          "name": {
            "type": "string",
            "description": "The name of the approval type"
          },
          "description": {
            "type": "string",
            "description": "The description of the approval type."
          },
          "id": {
            "type": "string",
            "description": "The unique numeric ID for identifying the approval type."
          }
        }
      },
      "ApprovalTypeCollection": {
        "type": "object",
        "properties": {
          "offset": {
            "minimum": 0,
            "type": "integer",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "format": "int32"
          },
          "count": {
            "minimum": 0,
            "type": "integer",
            "description": "The total number of item records that match the query parameters.",
            "format": "int32"
          },
          "limit": {
            "maximum": 500,
            "type": "integer",
            "description": "The maximum number of records to return.",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalType"
            }
          }
        }
      },
      "ApprovalTypeAssignment": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "description": "The unique numeric ID of the organization to which the approval type is assigned."
          },
          "approvalTypeId": {
            "type": "string",
            "description": "The unique numeric ID of the approval type that is assigned to the organization."
          }
        }
      },
      "ApprovalTypeAssignmentCollection": {
        "type": "object",
        "properties": {
          "offset": {
            "minimum": 0,
            "type": "integer",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "format": "int32"
          },
          "count": {
            "minimum": 0,
            "type": "integer",
            "description": "The total number of item records that match the query parameters.",
            "format": "int32"
          },
          "limit": {
            "maximum": 500,
            "type": "integer",
            "description": "The maximum number of records to return.",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalTypeAssignment"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}
