{
  "swagger": "2.0",
  "info": {
    "title": "Workspace service",
    "version": "0.1507.0",
    "description": "Send your API key as a bearer token: `Authorization: Bearer <api key>`."
  },
  "tags": [
    {
      "name": "WorkspaceService",
      "x-displayName": "Workspace service",
      "description": "This service provides information about workspaces. Workspaces provide access control boundaries. All resources in Nominal live within a workspace.",
      "x-errors": [
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "NominalWorkspacesV1:SecurityErrorForbiddenCrossWorkspaceOperation",
          "message": "Workspaces are hard boundaries in Nominal. Resources from different workspaces cannot be combined."
        },
        {
          "status": 404,
          "errorCode": "NOT_FOUND",
          "errorName": "NominalWorkspacesV1:SecurityErrorWorkspaceNotFound",
          "message": "The workspace with the specified rid was not found."
        },
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "NominalWorkspacesV1:SecurityErrorWorkspaceNotSpecified",
          "message": "A workspace was not specified and could not be inferred."
        }
      ]
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/workspaces/v2/default-workspace": {
      "get": {
        "operationId": "WorkspaceService_GetDefaultWorkspace",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetDefaultWorkspaceResponse"
            },
            "x-example": {
              "workspace": {
                "id": "<id>",
                "rid": "<rid>",
                "org": "<org>",
                "displayName": "<display name>",
                "symbol": {
                  "icon": "<icon>"
                },
                "settings": {
                  "refNames": {
                    "v1": [
                      {
                        "name": "<name>",
                        "type": "DATASET"
                      }
                    ]
                  },
                  "procedures": {
                    "v1": {
                      "workspaceProcedures": [
                        "<workspace procedures>"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "WorkspaceService"
        ],
        "summary": "Get default workspace",
        "description": "Gets the default workspace for the requesting user. If the user belongs to a single workspace, that workspace is returned. Otherwise, if the user's organization has a default workspace and the user belongs to it, that will be returned."
      }
    },
    "/workspaces/v2/workspaces": {
      "get": {
        "operationId": "WorkspaceService_GetWorkspaces",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetWorkspacesResponse"
            },
            "x-example": {
              "workspaces": [
                {
                  "id": "<id>",
                  "rid": "<rid>",
                  "org": "<org>",
                  "displayName": "<display name>",
                  "symbol": {
                    "icon": "<icon>"
                  },
                  "settings": {
                    "refNames": {
                      "v1": [
                        {
                          "name": "<name>",
                          "type": "DATASET"
                        }
                      ]
                    },
                    "procedures": {
                      "v1": {
                        "workspaceProcedures": [
                          "<workspace procedures>"
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        },
        "parameters": [
          {
            "name": "filterBySessionOrg",
            "description": "When unset, defaults to true.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "includeGuestWorkspaces",
            "description": "When unset, defaults to false.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "includeRoleBoundWorkspaces",
            "description": "When unset, defaults to false. Also returns the session org's workspaces where a role binding grants the caller workspace:view.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "WorkspaceService"
        ],
        "summary": "Get workspaces",
        "description": "Gets all workspaces that the requesting user belongs to."
      }
    },
    "/workspaces/v2/workspaces/{rid}": {
      "put": {
        "operationId": "WorkspaceService_UpdateWorkspace",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/UpdateWorkspaceResponse"
            },
            "x-example": {
              "workspace": {
                "id": "<id>",
                "rid": "<rid>",
                "org": "<org>",
                "displayName": "<display name>",
                "symbol": {
                  "icon": "<icon>"
                },
                "settings": {
                  "refNames": {
                    "v1": [
                      {
                        "name": "<name>",
                        "type": "DATASET"
                      }
                    ]
                  },
                  "procedures": {
                    "v1": {
                      "workspaceProcedures": [
                        "<workspace procedures>"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateWorkspaceBody"
            },
            "x-example": {
              "request": {
                "displayName": {
                  "displayName": "<display name>"
                },
                "symbol": {
                  "symbol": {
                    "icon": "<icon>"
                  }
                },
                "settings": {
                  "refNames": {
                    "v1": [
                      {
                        "name": "<name>",
                        "type": "DATASET"
                      }
                    ]
                  },
                  "procedures": {
                    "v1": {
                      "workspaceProcedures": [
                        "<workspace procedures>"
                      ]
                    }
                  }
                }
              }
            }
          }
        ],
        "tags": [
          "WorkspaceService"
        ],
        "summary": "Update workspace",
        "description": "Updates the settings of the workspace with the specified WorkspaceRid."
      }
    },
    "/workspaces/v2/workspaces/{workspaceRid}": {
      "get": {
        "operationId": "WorkspaceService_GetWorkspace",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetWorkspaceResponse"
            },
            "x-example": {
              "workspace": {
                "id": "<id>",
                "rid": "<rid>",
                "org": "<org>",
                "displayName": "<display name>",
                "symbol": {
                  "icon": "<icon>"
                },
                "settings": {
                  "refNames": {
                    "v1": [
                      {
                        "name": "<name>",
                        "type": "DATASET"
                      }
                    ]
                  },
                  "procedures": {
                    "v1": {
                      "workspaceProcedures": [
                        "<workspace procedures>"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspaceRid",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WorkspaceService"
        ],
        "summary": "Get workspace",
        "description": "Gets the workspace with the specified WorkspaceRid."
      }
    },
    "/workspaces/v2/workspaces/{workspaceRid}/banner": {
      "get": {
        "operationId": "WorkspaceService_GetWorkspaceBanner",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetWorkspaceBannerResponse"
            },
            "x-example": {
              "bannerConfig": {
                "cui": {}
              }
            }
          }
        },
        "parameters": [
          {
            "name": "workspaceRid",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "WorkspaceService"
        ],
        "summary": "Get workspace banner",
        "description": "Gets the classification banner (e.g. CUI, ITAR) configured for a workspace."
      }
    }
  },
  "definitions": {
    "DataSourceType": {
      "type": "string",
      "enum": [
        "DATA_SOURCE_TYPE_UNSPECIFIED",
        "DATASET",
        "CONNECTION",
        "VIDEO",
        "SPATIAL"
      ],
      "default": "DATA_SOURCE_TYPE_UNSPECIFIED",
      "example": "DATASET"
    },
    "RefNameAndType": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/DataSourceType"
        }
      }
    },
    "BannerConfig": {
      "type": "object",
      "properties": {
        "cui": {
          "$ref": "#/definitions/CuiBannerConfig",
          "description": "The workspace may contain Controlled Unclassified Information (CUI)."
        },
        "noItar": {
          "$ref": "#/definitions/NoItarBannerConfig",
          "description": "The workspace is not authorized to store ITAR-controlled data."
        },
        "secret": {
          "$ref": "#/definitions/SecretBannerConfig",
          "description": "The workspace may contain SECRET classified data."
        }
      },
      "x-oneofs": [
        {
          "fields": [
            "cui",
            "noItar",
            "secret"
          ],
          "required": true
        }
      ],
      "description": "Set exactly one of the fields below.",
      "example": {
        "cui": {}
      }
    },
    "CuiBannerConfig": {
      "type": "object"
    },
    "GetDefaultWorkspaceResponse": {
      "type": "object",
      "properties": {
        "workspace": {
          "$ref": "#/definitions/Workspace"
        }
      }
    },
    "GetWorkspaceBannerResponse": {
      "type": "object",
      "properties": {
        "bannerConfig": {
          "$ref": "#/definitions/BannerConfig",
          "description": "Unset if the workspace has no banner configured, or is unrecognized."
        }
      }
    },
    "GetWorkspaceResponse": {
      "type": "object",
      "properties": {
        "workspace": {
          "$ref": "#/definitions/Workspace"
        }
      }
    },
    "GetWorkspacesResponse": {
      "type": "object",
      "properties": {
        "workspaces": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Workspace"
          }
        }
      }
    },
    "NoItarBannerConfig": {
      "type": "object"
    },
    "PreferredRefNameConfiguration": {
      "type": "object",
      "properties": {
        "v1": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/RefNameAndType"
          }
        }
      }
    },
    "ProcedureSettings": {
      "type": "object",
      "properties": {
        "v1": {
          "$ref": "#/definitions/ProcedureSettingsV1"
        }
      },
      "x-oneofs": [
        {
          "fields": [
            "v1"
          ],
          "required": true
        }
      ],
      "example": {
        "v1": {
          "workspaceProcedures": [
            "string"
          ]
        }
      }
    },
    "ProcedureSettingsV1": {
      "type": "object",
      "properties": {
        "workspaceProcedures": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of procedures that are elevated to the workspace-level. They will be available for execution in a top-level context, rather than just from the procedure details page."
        }
      }
    },
    "RemoveType": {
      "type": "object",
      "description": "The request to remove a field from a workspace."
    },
    "SecretBannerConfig": {
      "type": "object"
    },
    "UpdateOrRemoveWorkspaceDisplayName": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string"
        },
        "removeType": {
          "$ref": "#/definitions/RemoveType"
        }
      },
      "description": "The request to update the display name of the workspace. The request will replace the existing display name with the display name specified if it's provided. Otherwise, the current display name will be removed from the workspace.\n\nSet exactly one of the fields below.",
      "x-oneofs": [
        {
          "fields": [
            "displayName",
            "removeType"
          ],
          "required": true
        }
      ],
      "example": {
        "displayName": "string"
      }
    },
    "UpdateOrRemoveWorkspaceSymbol": {
      "type": "object",
      "properties": {
        "symbol": {
          "$ref": "#/definitions/WorkspaceSymbol"
        },
        "removeType": {
          "$ref": "#/definitions/RemoveType"
        }
      },
      "description": "The request to update the symbol of the workspace. The request will replace the existing symbol with the symbol specified if it's provided. Otherwise, the current symbol will be removed from the workspace.\n\nSet exactly one of the fields below.",
      "x-oneofs": [
        {
          "fields": [
            "symbol",
            "removeType"
          ],
          "required": true
        }
      ],
      "example": {
        "symbol": {
          "icon": "string"
        }
      }
    },
    "UpdateWorkspaceRequest": {
      "type": "object",
      "properties": {
        "displayName": {
          "$ref": "#/definitions/UpdateOrRemoveWorkspaceDisplayName"
        },
        "symbol": {
          "$ref": "#/definitions/UpdateOrRemoveWorkspaceSymbol"
        },
        "settings": {
          "$ref": "#/definitions/WorkspaceSettings",
          "description": "Excluded fields in the settings update will be ignored."
        }
      }
    },
    "UpdateWorkspaceResponse": {
      "type": "object",
      "properties": {
        "workspace": {
          "$ref": "#/definitions/Workspace"
        }
      }
    },
    "Workspace": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "A unique identifier for the workspace within the organization. The workspace ID must be lower case alphanumeric characters, optionally separated by hyphens."
        },
        "rid": {
          "type": "string"
        },
        "org": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "symbol": {
          "$ref": "#/definitions/WorkspaceSymbol"
        },
        "settings": {
          "$ref": "#/definitions/WorkspaceSettings"
        }
      }
    },
    "UpdateWorkspaceBody": {
      "type": "object",
      "properties": {
        "request": {
          "$ref": "#/definitions/UpdateWorkspaceRequest"
        }
      },
      "example": {
        "request": {
          "displayName": {
            "displayName": "<display name>"
          },
          "symbol": {
            "symbol": {
              "icon": "<icon>"
            }
          },
          "settings": {
            "refNames": {
              "v1": [
                {
                  "name": "<name>",
                  "type": "DATASET"
                }
              ]
            },
            "procedures": {
              "v1": {
                "workspaceProcedures": [
                  "<workspace procedures>"
                ]
              }
            }
          }
        }
      }
    },
    "WorkspaceSettings": {
      "type": "object",
      "properties": {
        "refNames": {
          "$ref": "#/definitions/PreferredRefNameConfiguration"
        },
        "procedures": {
          "$ref": "#/definitions/ProcedureSettings"
        }
      }
    },
    "WorkspaceSymbol": {
      "type": "object",
      "properties": {
        "icon": {
          "type": "string",
          "title": "Workspace icon name (e.g. castle)"
        },
        "emoji": {
          "type": "string",
          "title": "Workspace emoji name (e.g. :castle:)"
        },
        "image": {
          "type": "string",
          "title": "Workspace image url (e.g. https://example.com/image.png)"
        }
      },
      "x-oneofs": [
        {
          "fields": [
            "icon",
            "emoji",
            "image"
          ],
          "required": true
        }
      ],
      "description": "Set exactly one of the fields below.",
      "example": {
        "icon": "string"
      }
    }
  },
  "securityDefinitions": {
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Your API key as a bearer token: `Authorization: Bearer <api key>`."
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}
