{
  "openapi": "3.0.1",
  "info": {
    "title": "Workspaces",
    "description": "Create and administer workspaces.",
    "version": "9.1.20.0",
    "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": "Workspaces",
      "description": "Create and administer workspaces."
    }
  ],
  "paths": {
    "/workspaces": {
      "get": {
        "summary": "Get the workspaces.",
        "tags": [
          "Workspaces"
        ],
        "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",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceCollection"
                }
              }
            },
            "x-entity-path": "dataArea/workspace"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/Workspace",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "getWorkspace",
        "x-parameters": {
          "accessProfile": "IBM_Admin_All"
        },
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.GetWorkspaceType"
      },
      "post": {
        "summary": "Create a workspace.",
        "tags": [
          "Workspaces"
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Workspace"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The operation is successful.",
            "content": {},
            "headers": {
              "Location": {
                "description": "The URI of the Workspace.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "links": {
              "GetWorkspacesById": {
                "operationRef": "#/paths/~1Workspaces~1{id}/get",
                "parameters": {
                  "id": "$request.body#/id"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `GET /Workspaces/{id}`.\n"
              },
              "DeleteWorkspacesById": {
                "operationRef": "#/paths/~1Workspaces~1{id}/delete",
                "parameters": {
                  "id": "$request.body#/id"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `DELETE /workspaces/{id}`.\n"
              },
              "UpdateWorkspacesById": {
                "operationRef": "#/paths/~1Workspaces~1{id}/patch",
                "parameters": {
                  "id": "$request.body#/id"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `PATCH /Workspaces/{id}`.\n"
              },
              "CreateWorkspacesCancelById": {
                "operationRef": "#/paths/~1workspaces~1{id}~1cancel/post",
                "parameters": {
                  "id": "$request.body#/id"
                },
                "description": "The `id` value used in the request body can be used as the `id` parameter in `POST /workspaces/{id}/cancel`.\n"
              }
            },
            "x-entity-path": "dataArea/workspace[1]/workspaceIdentifier/uniqueID"
          }
        },
        "x-action-code": "Create",
        "x-expression-template": "/Workspace[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processWorkspace",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessWorkspaceType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/workspaces/{id}": {
      "get": {
        "summary": "Get a workspace.",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The workspace ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            },
            "x-entity-path": "dataArea/workspace[1]"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}'}/Workspace[WorkspaceIdentifier[(UniqueID='{id}')]]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "getWorkspace",
        "x-parameters": {
          "accessProfile": "IBM_Admin_All"
        },
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.GetWorkspaceType"
      },
      "delete": {
        "summary": "Delete a workspace. The task group must be in either the \"0: Inactive\", \"6: Cancelled\", \"5: Complete\" or \"13: Publish Failed\" state before it can be deleted.",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The workspace ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/workspace[1]/workspaceIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/workspace[1]/workspaceIdentifier/uniqueID"
          }
        ],
        "responses": {
          "204": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Delete",
        "x-expression-template": "/Workspace[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processWorkspace",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessWorkspaceType"
      },
      "patch": {
        "summary": "Update a workspace.",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The workspace ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/workspace[1]/workspaceIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/workspace[1]/workspaceIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Workspace"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Change",
        "x-expression-template": "/Workspace[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "changeWorkspace",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ChangeWorkspaceType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/workspaces/{id}/cancel": {
      "post": {
        "summary": "Cancel a workspace. The task group must be in \" 0: Inactive\" state before it can be cancelled.",
        "tags": [
          "Workspaces"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The workspace ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/workspace[1]/workspaceIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/workspace[1]/workspaceIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Workspace"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Cancel",
        "x-expression-template": "/Workspace[1]",
        "x-facade-client-class": "com.ibm.commerce.content.facade.client.ContentFacadeClient",
        "x-facade-client-method": "processWorkspace",
        "x-request-bod-class": "com.ibm.commerce.content.facade.datatypes.ProcessWorkspaceType"
      }
    }
  },
  "components": {
    "schemas": {
      "Workspace": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "The workspace description."
          },
          "emergencyUse": {
            "type": "boolean",
            "description": "The workspace is emergency use or not."
          },
          "id": {
            "type": "integer",
            "description": "The workspace ID.",
            "format": "int64",
            "readOnly": true,
            "x-entity-path": "workspaceIdentifier/uniqueID"
          },
          "identifier": {
            "type": "string",
            "description": "The workspace identifier.",
            "readOnly": true,
            "x-entity-path": "workspaceIdentifier/identifier"
          },
          "name": {
            "type": "string",
            "description": "The workspace name."
          },
          "persistent": {
            "type": "boolean",
            "description": "Thw workspace is persistent or not."
          },
          "status": {
            "type": "string",
            "description": "The workspace status, value: active, complete, cancelled, cancel in progress.",
            "readOnly": true
          }
        },
        "description": "A workspace.",
        "x-entity-class": "com.ibm.commerce.content.facade.datatypes.WorkspaceType"
      },
      "WorkspaceCollection": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Workspace"
            }
          },
          "limit": {
            "type": "integer",
            "description": "The maximum number of records to return.",
            "format": "int32"
          },
          "offset": {
            "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"
          }
        },
        "description": "A collection of workspaces."
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
